!I integrate from //ce/main...
[CRYENGINE.git] / Tools / CMake / CrossPlatformSetup.cmake
blob290db0fa83238f4c57ca37e541f2e0c49d0de078
1 cmake_policy(SET CMP0011 NEW) # Included scripts do automatic cmake_policy PUSH and POP if this is not set.
2 cmake_policy(SET CMP0048 NEW) # Set VERSION as documented by the project() command.
3 cmake_policy(SET CMP0053 NEW) # Use the simpler variable expansion and escape sequence evaluation rules.
4 cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted if this is not set.
5 cmake_policy(SET CMP0063 NEW) # Honor the visibility properties for all target types.
6 cmake_policy(SET CMP0067 NEW) # Honor language standard in try_compile() source-file signature.
8 set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug Profile)
10 # Turn on the ability to create folders to organize projects (.vcproj)
11 # It creates "CMakePredefinedTargets" folder by default and adds CMake
12 # defined projects like INSTALL.vcproj and ZERO_CHECK.vcproj
13 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
15 if(NOT DEFINED CRYENGINE_DIR)
16         set(CRYENGINE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
17 endif()
19 if(NOT DEFINED PROJECT_DIR)
20         set(PROJECT_DIR "${CMAKE_SOURCE_DIR}")
21 endif()
22         
23 set(TOOLS_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}")
25 #Fix slashes on paths
26 string(REPLACE "\\" "/" CRYENGINE_DIR "${CRYENGINE_DIR}")
27 string(REPLACE "\\" "/" PROJECT_DIR "${PROJECT_DIR}")
28 string(REPLACE "\\" "/" TOOLS_CMAKE_DIR "${TOOLS_CMAKE_DIR}")
30 set(CMAKE_MODULE_PATH "${TOOLS_CMAKE_DIR}/modules")
32 if(NOT DEFINED SDK_DIR)
33         set(SDK_DIR "${CRYENGINE_DIR}/Code/SDKs")
34 endif()
36 message(STATUS "CMAKE_GENERATOR = ${CMAKE_GENERATOR}")
37 message(STATUS "CMAKE_CONFIGURATION_TYPES = ${CMAKE_CONFIGURATION_TYPES}")
38 message(STATUS "OPTION_PROFILE = ${OPTION_PROFILE}")
39 message(STATUS "OPTION_PCH = ${OPTION_PCH}")
40 message(STATUS "CRYENGINE_DIR = ${CRYENGINE_DIR}")
41 message(STATUS "SDK_DIR = ${SDK_DIR}")
42 message(STATUS "PROJECT_DIR = ${PROJECT_DIR}")
43 message(STATUS "TOOLS_CMAKE_DIR = ${TOOLS_CMAKE_DIR}")
45 # Bootstrap support
46 if(EXISTS "${TOOLS_CMAKE_DIR}/Bootstrap.cmake")
47         include("${TOOLS_CMAKE_DIR}/Bootstrap.cmake")
48         if(OPTION_AUTO_BOOTSTRAP)
49                 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "bootstrap.dat")
50         endif()
51 elseif(EXISTS "${TOOLS_CMAKE_DIR}/DownloadSDKs.cmake")
52         include("${TOOLS_CMAKE_DIR}/DownloadSDKs.cmake")
53 endif()