aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/samples/CMakeLists.txt
diff options
context:
space:
mode:
authormtamis <[email protected]>2017-02-28 18:24:59 +0100
committermtamis <[email protected]>2017-02-28 18:24:59 +0100
commit5581909a4d19db97304449f66404ff99a0429d3f (patch)
treea90f7eb85c095a8aba45cf5e909c82c1cdbed77d /NvCloth/samples/CMakeLists.txt
parentFix cmake visual studio project generation (locate_gw_root.bat) (diff)
downloadnvcloth-5581909a4d19db97304449f66404ff99a0429d3f.tar.xz
nvcloth-5581909a4d19db97304449f66404ff99a0429d3f.zip
Add visual samples.
Diffstat (limited to 'NvCloth/samples/CMakeLists.txt')
-rw-r--r--NvCloth/samples/CMakeLists.txt82
1 files changed, 82 insertions, 0 deletions
diff --git a/NvCloth/samples/CMakeLists.txt b/NvCloth/samples/CMakeLists.txt
new file mode 100644
index 0000000..3f9d60a
--- /dev/null
+++ b/NvCloth/samples/CMakeLists.txt
@@ -0,0 +1,82 @@
+cmake_minimum_required(VERSION 3.3)
+
+project(NvClothSamples CXX)
+
+CMAKE_POLICY(SET CMP0057 NEW) # Enable IN_LIST
+
+IF(NOT DEFINED SAMPLES_ROOT_DIR)
+
+ STRING(REPLACE "\\" "/" BRD_TEMP $ENV{SAMPLES_ROOT_DIR})
+
+ # This env variable is set by GenerateProjects.bat, and is no longer available when CMake rebuilds, so this stores it in the cache
+ SET(SAMPLES_ROOT_DIR ${BRD_TEMP} CACHE INTERNAL "Root of the Samples source tree")
+
+ENDIF()
+
+IF(NOT EXISTS ${SAMPLES_ROOT_DIR})
+ MESSAGE(FATAL_ERROR "SAMPLES_ROOT_DIR environment variable wasn't set or was invalid.")
+ENDIF()
+
+SET(GW_DEPS_ROOT "${SAMPLES_ROOT_DIR}/external")
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${GW_DEPS_ROOT}/CMakeModules")
+
+MESSAGE("Module path:" ${CMAKE_MODULE_PATH})
+
+
+IF(CMAKE_CONFIGURATION_TYPES)
+ SET(CMAKE_CONFIGURATION_TYPES debug profile checked release)
+ SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
+ "Reset config to what we need"
+ FORCE)
+
+ SET(CMAKE_SHARED_LINKER_FLAGS_CHECKED "")
+ SET(CMAKE_SHARED_LINKER_FLAGS_PROFILE "")
+
+ SET(CMAKE_EXE_LINKER_FLAGS_CHECKED "")
+ SET(CMAKE_EXE_LINKER_FLAGS_PROFILE "")
+
+ENDIF()
+
+# Default to appending "DEBUG", "PROFILE", etc to produced artifacts
+IF(NOT DEFINED APPEND_CONFIG_NAME)
+ SET(APPEND_CONFIG_NAME ON)
+ENDIF()
+
+IF (APPEND_CONFIG_NAME)
+ MESSAGE("Appending config to output names")
+
+ SET(CMAKE_DEBUG_POSTFIX "DEBUG")
+ SET(CMAKE_PROFILE_POSTFIX "PROFILE")
+ SET(CMAKE_CHECKED_POSTFIX "CHECKED")
+ SET(CMAKE_RELEASE_POSTFIX "")
+ENDIF()
+
+INCLUDE(SetOutputPaths)
+
+# Either have to define a single output path, or each one.
+
+IF(NOT DEFINED BL_OUTPUT_DIR)
+ IF (NOT DEFINED BL_LIB_OUTPUT_DIR)
+ MESSAGE(FATAL_ERROR "BL_LIB_OUTPUT_DIR not defined - Define either BL_OUTPUT_DIR or BL_LIB_OUTPUT_DIR and BL_DLL_OUTPUT_DIR and BL_EXE_OUTPUT_DIR")
+ ENDIF()
+
+ IF (NOT DEFINED BL_DLL_OUTPUT_DIR)
+ MESSAGE(FATAL_ERROR "BL_DLL_OUTPUT_DIR not defined - Define either BL_OUTPUT_DIR or BL_LIB_OUTPUT_DIR and BL_DLL_OUTPUT_DIR and BL_EXE_OUTPUT_DIR")
+ ENDIF()
+
+ IF (NOT DEFINED BL_EXE_OUTPUT_DIR)
+ MESSAGE(FATAL_ERROR "BL_EXE_OUTPUT_DIR not defined - Define either BL_OUTPUT_DIR or BL_LIB_OUTPUT_DIR and BL_DLL_OUTPUT_DIR and BL_EXE_OUTPUT_DIR")
+ ENDIF()
+
+ SetLibOutputPath(${BL_LIB_OUTPUT_DIR})
+ SetDllOutputPath(${BL_DLL_OUTPUT_DIR})
+ SetExeOutputPath(${BL_EXE_OUTPUT_DIR})
+ELSE()
+ SetSingleOutputPath(${BL_OUTPUT_DIR})
+ENDIF()
+
+SET(PROJECT_CMAKE_FILES_DIR compiler/cmake/)
+
+# Include the platform specific configuration
+INCLUDE(${PROJECT_CMAKE_FILES_DIR}${TARGET_BUILD_PLATFORM}/CMakeLists.txt OPTIONAL)