diff options
author | Carbenium <carbenium@outlook.com> | 2020-06-14 22:11:23 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-06-16 09:29:31 +0200 |
commit | f387673aa328f3ff5941437149ba369d3c9a2806 (patch) | |
tree | 1aaa3e0e4f1bb6854bb916165cdc4b8c3347e2eb /CMakeLists.txt | |
parent | 18ad76722663c6e8cd462645b995080c67b5bff2 (diff) |
CMake: Use target_precompile_headers instead of cotire with CMake >= 3.16.0
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e09ffecb382..6a94e1adbb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,11 @@ project(TrinityCore) # CMake policies (can not be handled elsewhere) cmake_policy(SET CMP0005 NEW) -cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties' +if (CMAKE_VERSION VERSION_LESS "3.16.0") + cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties' +else() + cmake_policy(SET CMP0043 NEW) # Cotire isn't used so set to NEW +endif() cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted - prevents intepreting if (SOME_STRING_VARIABLE MATCHES "MSVC") as if (SOME_STRING_VARIABLE MATCHES "1") if(POLICY CMP0074) @@ -35,8 +39,12 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1) # set macro-directory list(APPEND CMAKE_MODULE_PATH - "${CMAKE_SOURCE_DIR}/cmake/macros" - "${CMAKE_SOURCE_DIR}/dep/cotire/CMake") + "${CMAKE_SOURCE_DIR}/cmake/macros") + +if (CMAKE_VERSION VERSION_LESS "3.16.0") + list(APPEND CMAKE_MODULE_PATH + "${CMAKE_SOURCE_DIR}/dep/cotire/CMake") +endif() # build in Release-mode by default if not explicitly set if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config") |