aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/Tools/AuthoringLibrary/compiler
diff options
context:
space:
mode:
authorMarijn Tamis <[email protected]>2018-09-12 14:12:47 +0200
committerMarijn Tamis <[email protected]>2018-09-12 14:12:47 +0200
commit7bceea80d4a04649f495f4f4331d7e3bdcdb05ca (patch)
tree824767cccf7b516a8c0b32467c6314eaa802f58d /NvCloth/Tools/AuthoringLibrary/compiler
parentAdded missing GenerateProjectsIOS.sh file (diff)
downloadnvcloth-7bceea80d4a04649f495f4f4331d7e3bdcdb05ca.tar.xz
nvcloth-7bceea80d4a04649f495f4f4331d7e3bdcdb05ca.zip
1.1.5 Release (24934621)
Diffstat (limited to 'NvCloth/Tools/AuthoringLibrary/compiler')
-rw-r--r--NvCloth/Tools/AuthoringLibrary/compiler/cmake/AuthoringLibrary.cmake73
-rw-r--r--NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/AuthoringLibrary.cmake44
-rw-r--r--NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/CMakeLists.txt82
3 files changed, 199 insertions, 0 deletions
diff --git a/NvCloth/Tools/AuthoringLibrary/compiler/cmake/AuthoringLibrary.cmake b/NvCloth/Tools/AuthoringLibrary/compiler/cmake/AuthoringLibrary.cmake
new file mode 100644
index 0000000..e649116
--- /dev/null
+++ b/NvCloth/Tools/AuthoringLibrary/compiler/cmake/AuthoringLibrary.cmake
@@ -0,0 +1,73 @@
+#
+# Build AUTHORINGLIBRARY Common
+#
+
+MESSAGE("AuthoringLibrary.cmake [begin]")
+
+MESSAGE("CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH})
+
+#SET(SB_SOURCE_DIR ${PROJECT_SOURCE_DIR}/..)
+
+
+FIND_PACKAGE(PxShared "1.0.21467209.1" REQUIRED)
+
+
+# Include here after the directories are defined so that the platform specific file can use the variables.
+include(${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/AuthoringLibrary.cmake)
+
+
+SET(HEADERS
+ ${PROJECT_SOURCE_DIR}/include/NvClothAuthoringLibrary/Parameters.h
+ ${PROJECT_SOURCE_DIR}/include/NvClothAuthoringLibrary/DebugVisualization.h
+ ${PROJECT_SOURCE_DIR}/include/NvClothAuthoringLibrary/CollisionVisualization.h
+)
+
+SET(SOURCE
+ ${PROJECT_SOURCE_DIR}/src/Parameters.cpp
+ ${PROJECT_SOURCE_DIR}/src/DebugVisualization.cpp
+ ${PROJECT_SOURCE_DIR}/src/CollisionVisualization.cpp
+)
+
+ADD_LIBRARY(NvClothAuthoringLibrary
+ ${HEADERS}
+ ${SOURCE}
+)
+
+SOURCE_GROUP("include\\NvClothAuthoringLibrary" FILES ${HEADERS})
+SOURCE_GROUP("src" FILES ${SOURCE})
+
+
+# Target specific compile options
+
+TARGET_INCLUDE_DIRECTORIES(NvClothAuthoringLibrary
+ PRIVATE ${AUTHORINGLIBRARY_PLATFORM_INCLUDES}
+
+ PRIVATE ${PXSHARED_ROOT_DIR}/include/foundation
+ PRIVATE ${PXSHARED_ROOT_DIR}/include
+ PRIVATE ${PXSHARED_ROOT_DIR}/src/foundation/include
+
+ PRIVATE ${NVCLOTH_ROOT_DIR}/include
+ PRIVATE ${NVCLOTH_ROOT_DIR}/extensions/include
+
+ PRIVATE ${PROJECT_SOURCE_DIR}/include
+)
+
+TARGET_COMPILE_DEFINITIONS(NvClothAuthoringLibrary
+ PRIVATE ${AUTHORINGLIBRARY_COMPILE_DEFS}
+)
+
+SET_TARGET_PROPERTIES(NvClothAuthoringLibrary PROPERTIES
+ COMPILE_PDB_NAME_DEBUG "NvClothAuthoringLibrary${CMAKE_DEBUG_POSTFIX}"
+ COMPILE_PDB_NAME_CHECKED "NvClothAuthoringLibrary${CMAKE_CHECKED_POSTFIX}"
+ COMPILE_PDB_NAME_PROFILE "NvClothAuthoringLibrary${CMAKE_PROFILE_POSTFIX}"
+ COMPILE_PDB_NAME_RELEASE "NvClothAuthoringLibrary${CMAKE_RELEASE_POSTFIX}"
+)
+
+TARGET_COMPILE_OPTIONS(NvClothAuthoringLibrary PRIVATE /wd4005 /wd4244)
+
+TARGET_LINK_LIBRARIES(NvClothAuthoringLibrary PUBLIC PxFoundation)
+TARGET_LINK_LIBRARIES(NvClothAuthoringLibrary PUBLIC NvCloth)
+
+SET_TARGET_PROPERTIES(NvClothAuthoringLibrary PROPERTIES LINK_FLAGS ${AUTHORINGLIBRARY_LINK_FLAGS})
+
+MESSAGE("AUTHORINGLIBRARY.cmake [end]") \ No newline at end of file
diff --git a/NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/AuthoringLibrary.cmake b/NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/AuthoringLibrary.cmake
new file mode 100644
index 0000000..88a3dd5
--- /dev/null
+++ b/NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/AuthoringLibrary.cmake
@@ -0,0 +1,44 @@
+#
+# Build AuthoringLibrary Windows
+#
+
+SET(AUTHORINGLIBRARY_PLATFORM_COMMON_FILES
+)
+
+SET(AUTHORINGLIBRARY_COMPILE_DEFS
+ # Common to all configurations
+ ${SAMPLES_SLN_COMPILE_DEFS}
+
+ $<$<CONFIG:debug>:${SAMPLES_SLN_DEBUG_COMPILE_DEFS}>
+ $<$<CONFIG:checked>:${SAMPLES_SLN_CHECKED_COMPILE_DEFS}>
+ $<$<CONFIG:profile>:${SAMPLES_SLN_PROFILE_COMPILE_DEFS}>
+ $<$<CONFIG:release>:${SAMPLES_SLN_RELEASE_COMPILE_DEFS}>
+)
+
+SET(AUTHORINGLIBRARY_LINK_FLAGS "/SUBSYSTEM:WINDOWS")
+
+SET(AUTHORINGLIBRARY_ADDITIONAL_DLLS "")
+
+#TODO: Move this to an external dep
+if (CMAKE_CL_64)
+ SET(SHADOW_LIB ${NVCLOTH_ROOT_DIR}/samples/external/shadow_lib/GFSDK_ShadowLib_DX11.win64.lib)
+ SET(SHADOW_DLLS ${NVCLOTH_ROOT_DIR}/samples/external/shadow_lib/GFSDK_ShadowLib_DX11.win64.dll)
+
+ SET(HBAO_LIB ${NVCLOTH_ROOT_DIR}/samples/external/hbao/GFSDK_SSAO_D3D11.win64.lib)
+ SET(HBAO_DLLS ${NVCLOTH_ROOT_DIR}/samples/external/hbao/GFSDK_SSAO_D3D11.win64.dll)
+
+ SET(D3DCOMPILER_DLL "\"$(VC_ExecutablePath_x64_x64)/d3dcompiler_47.dll\"")
+
+ SET(ASSIMP_DLLS ${ASSIMP_DLL_PATH}/Release/assimp-vc140-mt.dll)
+else()
+ SET(SHADOW_LIB ${NVCLOTH_ROOT_DIR}/samples/external/shadow_lib/GFSDK_ShadowLib_DX11.win32.lib)
+ SET(SHADOW_DLLS ${NVCLOTH_ROOT_DIR}/samples/external/shadow_lib/GFSDK_ShadowLib_DX11.win32.dll)
+
+ SET(HBAO_LIB ${NVCLOTH_ROOT_DIR}/samples/external/hbao/GFSDK_SSAO_D3D11.win32.lib)
+ SET(HBAO_DLLS ${NVCLOTH_ROOT_DIR}/samples/external/hbao/GFSDK_SSAO_D3D11.win32.dll)
+
+ SET(D3DCOMPILER_DLL "\"$(VC_ExecutablePath_x86_x86)/d3dcompiler_47.dll\"")
+
+ SET(ASSIMP_DLLS ${ASSIMP_DLL_PATH}/Release/assimp-vc140-mt.dll)
+endif()
+
diff --git a/NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/CMakeLists.txt b/NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/CMakeLists.txt
new file mode 100644
index 0000000..fd9d4bd
--- /dev/null
+++ b/NvCloth/Tools/AuthoringLibrary/compiler/cmake/windows/CMakeLists.txt
@@ -0,0 +1,82 @@
+#Platform specific compile flags and project includes
+
+SET(GW_DEPS_ROOT $ENV{GW_DEPS_ROOT})
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}; $ENV{GW_DEPS_ROOT}/sw/physx/tools/CMakeModules)
+
+IF(EXISTS $ENV{GW_DEPS_ROOT}/Externals/CMakeModules)
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}; $ENV{GW_DEPS_ROOT}/Externals/CMakeModules)
+ENDIF()
+
+
+IF(EXISTS $ENV{GW_DEPS_ROOT}/Externals/CMakeModules)
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}; $ENV{GW_DEPS_ROOT}/Externals/CMakeModules)
+ENDIF()
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}; "${CMAKE_CURRENT_SOURCE_DIR}/../..")
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}; "${CMAKE_CURRENT_SOURCE_DIR}/external/CMakeModules")
+MESSAGE("CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH})
+
+#NOTE: Warnings lowered on the sample projects as it's got a lot of warnings. Defines below hide more.
+SET(CMAKE_CXX_FLAGS "/GR- /GF /MP /Gy /EHsc /d2Zi+ /errorReport:prompt /fp:fast /Gd /Gm- /GS- /nologo /W3 /WX /Zc:forScope /Zc:inline /Zc:wchar_t /Zi")
+
+# Are we using the static or dynamic RT library? Whatever we use, it needs to be the same in any dependencies
+# we pull in or we're potentially having mismatch issues.
+IF(STATIC_WINCRT)
+ SET(WINCRT_NDEBUG "/MT")
+ SET(WINCRT_DEBUG "/MTd")
+ELSE()
+ SET(WINCRT_NDEBUG "/MD")
+ SET(WINCRT_DEBUG "/MDd")
+ENDIF()
+
+SET(CMAKE_CXX_FLAGS_DEBUG "/Od /RTCsu ${WINCRT_DEBUG}")
+SET(CMAKE_CXX_FLAGS_CHECKED "/Ox ${WINCRT_NDEBUG}")
+SET(CMAKE_CXX_FLAGS_PROFILE "/Ox ${WINCRT_NDEBUG}")
+SET(CMAKE_CXX_FLAGS_RELEASE "/Ox ${WINCRT_NDEBUG}")
+
+# Build PDBs for all configurations
+SET(CMAKE_SHARED_LINKER_FLAGS "/DEBUG")
+
+IF(CMAKE_CL_64)
+ ADD_DEFINITIONS(-DWIN64)
+ENDIF(CMAKE_CL_64)
+
+SET(SAMPLES_SLN_COMPILE_DEFS _UNICODE;UNICODE;WIN32;WIN64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_RUNTIME_LIBRARY_MISMATCH;__GFSDK_DX11__;)
+#NvBlastExt doesn't have the _CONSOLE flag
+
+SET(SAMPLES_SLN_DEBUG_COMPILE_DEFS _DEBUG;NV_DEBUG=1;)
+SET(SAMPLES_SLN_CHECKED_COMPILE_DEFS NDEBUG;NV_CHECKED=1;)
+SET(SAMPLES_SLN_PROFILE_COMPILE_DEFS NDEBUG;NV_PROFILE=1;)
+SET(SAMPLES_SLN_RELEASE_COMPILE_DEFS NDEBUG;)
+
+IF(CMAKE_CL_64)
+ SET(LIBPATH_SUFFIX "x64")
+ELSE(CMAKE_CL_64)
+ SET(LIBPATH_SUFFIX "x86")
+ENDIF(CMAKE_CL_64)
+
+SET(CMAKE_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}_${LIBPATH_SUFFIX}")
+SET(CMAKE_PROFILE_POSTFIX "${CMAKE_PROFILE_POSTFIX}_${LIBPATH_SUFFIX}")
+SET(CMAKE_CHECKED_POSTFIX "${CMAKE_CHECKED_POSTFIX}_${LIBPATH_SUFFIX}")
+SET(CMAKE_RELEASE_POSTFIX "${CMAKE_RELEASE_POSTFIX}_${LIBPATH_SUFFIX}")
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}; "${CMAKE_CURRENT_SOURCE_DIR}/../../../..")
+
+SET(PX_SELECT_COMPONENTS PxFoundation)
+FIND_PACKAGE(PxShared REQUIRED)
+FIND_PACKAGE(NvCloth REQUIRED)
+
+# Include the PxShared-exports.cmake file that PxShared created. There's other ways to do this, but there's a bunch of issues with it in a CI environment
+# such as - we don't want to be installing any built artifacts on this server, etc. So for now we hack it.
+
+# Add PxShared as a dependency so that we can use project references
+#ADD_SUBDIRECTORY(${PXSHARED_ROOT_DIR}/src/compiler/cmake/windows "${CMAKE_CURRENT_BINARY_DIR}/pxshared_bin")
+#MESSAGE("NVCLOTH_ROOT_DIR = ${NVCLOTH_ROOT_DIR}")
+ADD_SUBDIRECTORY(${NVCLOTH_ROOT_DIR}/compiler/cmake/windows "${CMAKE_CURRENT_BINARY_DIR}/NvCloth_bin")
+
+
+# Include all of the projects
+INCLUDE(${PROJECT_CMAKE_FILES_DIR}/AuthoringLibrary.cmake)
+
+