88# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
99# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
11- cmake_minimum_required (VERSION 3.11 )
11+ cmake_minimum_required (VERSION 3.18 )
1212
1313# add this options before PROJECT keyword
1414set (CMAKE_DISABLE_SOURCE_CHANGES ON )
@@ -19,32 +19,29 @@ project(TrinityCore)
1919
2020# CMake policies (can not be handled elsewhere)
2121cmake_policy (SET CMP0005 NEW )
22- if (CMAKE_VERSION VERSION_LESS "3.16.0" )
23- cmake_policy (SET CMP0043 OLD ) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties'
24- else ()
25- cmake_policy (SET CMP0043 NEW ) # Cotire isn't used so set to NEW
26- endif ()
22+ cmake_policy (SET CMP0043 NEW ) # Ignore COMPILE_DEFINITIONS_<Config> properties
2723cmake_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")
24+ cmake_policy (SET CMP0067 NEW ) # Honor language standard in try_compile() source-file signature
25+ cmake_policy (SET CMP0074 NEW ) # find_package() uses <PackageName>_ROOT variables
26+
27+ if (POLICY CMP0144)
28+ cmake_policy (SET CMP0144 NEW ) # find_package() uses upper-case <PACKAGENAME>_ROOT variables
29+ endif ()
2830
29- if (POLICY CMP0074 )
30- cmake_policy (SET CMP0074 NEW ) # find_package () uses <PackageName>_ROOT variables
31+ if (POLICY CMP0153 )
32+ cmake_policy (SET CMP0153 NEW ) # The exec_program () command should not be called
3133endif ()
3234
3335# Set RPATH-handing (CMake parameters)
3436set (CMAKE_SKIP_BUILD_RPATH 0)
3537set (CMAKE_BUILD_WITH_INSTALL_RPATH 0)
36- set ( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib" )
38+ list ( APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib" )
3739set (CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
3840
3941# set macro-directory
4042list (APPEND CMAKE_MODULE_PATH
4143 "${CMAKE_SOURCE_DIR} /cmake/macros" )
4244
43- if (CMAKE_VERSION VERSION_LESS "3.16.0" )
44- list (APPEND CMAKE_MODULE_PATH
45- "${CMAKE_SOURCE_DIR} /dep/cotire/CMake" )
46- endif ()
47-
4845# build in Release-mode by default if not explicitly set
4946if (CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" )
5047 set (CMAKE_DEFAULT_BUILD_TYPE "RelWithDebInfo" CACHE INTERNAL "" )
@@ -73,12 +70,14 @@ include(GroupSources)
7370include (AutoCollect )
7471
7572find_package (PCHSupport )
76- find_package (MySQL )
7773
7874if (NOT WITHOUT_GIT)
7975 find_package (Git 1.7 )
8076endif ()
8177
78+ # find mysql client binary (needed by genrev)
79+ find_package (MySQL OPTIONAL_COMPONENTS binary )
80+
8281# Find revision ID and hash of the sourcetree
8382include (cmake/genrev.cmake )
8483
0 commit comments