DB/Quest: Suspicious Hoofprints (Horde Version)
[trinitycore] / CMakeLists.txt
1 # Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
2 #
3 # This file is free software; as a special exception the author gives
4 # unlimited permission to copy and/or distribute it, with or without
5 # modifications, as long as this notice is preserved.
6 #
7 # This program is distributed in the hope that it will be useful, but
8 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
11 # We require CMake >= 3.2
12 cmake_minimum_required(VERSION 3.2)
13
14 # add this options before PROJECT keyword
15 set(CMAKE_DISABLE_SOURCE_CHANGES ON)
16 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
17
18 # Set projectname (must be done AFTER setting configurationtypes)
19 project(TrinityCore)
20
21 # CMake policies (can not be handled elsewhere)
22 cmake_policy(SET CMP0005 OLD)
23 if(POLICY CMP0043)
24 cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties'
25 endif()
26
27 if(POLICY CMP0054)
28 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")
29 endif()
30
31 # Set RPATH-handing (CMake parameters)
32 set(CMAKE_SKIP_BUILD_RPATH 0)
33 set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
34 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
35 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
36
37 # set macro-directory
38 list(APPEND CMAKE_MODULE_PATH
39 "${CMAKE_SOURCE_DIR}/cmake/macros"
40 "${CMAKE_SOURCE_DIR}/dep/cotire/CMake")
41
42 # build in Release-mode by default if not explicitly set
43 if( NOT CMAKE_BUILD_TYPE )
44 set(CMAKE_BUILD_TYPE "RelWithDebInfo")
45 endif()
46
47 include(CheckCXXSourceRuns)
48 include(CheckIncludeFiles)
49 include(ConfigureScripts)
50
51 # set default buildoptions and print them
52 include(cmake/options.cmake)
53
54 # turn off PCH totally if enabled (hidden setting, mainly for devs)
55 if( NOPCH )
56 set(USE_COREPCH 0)
57 set(USE_SCRIPTPCH 0)
58 endif()
59
60 include(ConfigureBaseTargets)
61 include(CheckPlatform)
62
63 include(GroupSources)
64 include(AutoCollect)
65
66 find_package(PCHSupport)
67 find_package(MySQL)
68
69 if(NOT WITHOUT_GIT)
70 find_package(Git)
71 endif()
72
73 # Find revision ID and hash of the sourcetree
74 include(cmake/genrev.cmake)
75
76 # print out the results before continuing
77 include(cmake/showoptions.cmake)
78
79 # add dependencies
80 add_subdirectory(dep)
81
82 # add core sources
83 add_subdirectory(src)