Merge branch 'master' of git://github.com/TrinityCore/TrinityCore
[st4rcore.git] / CMakeLists.txt
blob5f1ca3c4b5e03d1d7490e6882aba1c305c37e0b0
1 # Copyright (C) 2005-2010 Trinity <http://www.trinitycore.org/>
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.
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.
11 # Set projectname (must be done AFTER setting configurationtypes)
12 project(TrinityCore)
14 # CMake policies (can not be handled elsewhere)
15 cmake_minimum_required(VERSION 2.6)
16 cmake_policy(SET CMP0005 OLD)
18 # Set RPATH-handing (CMake parameters)
19 set(CMAKE_SKIP_BUILD_RPATH 0)
20 set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
21 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
22 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
24 # set macro-directory
25 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/macros")
27 # build in Release-mode by default if not explicitly set
28 if( NOT CMAKE_BUILD_TYPE )
29   set(CMAKE_BUILD_TYPE "Release")
30 endif()
32 include(CheckCXXSourceRuns)
33 include(CheckIncludeFiles)
35 # set default buildoptions and print them
36 include(cmake/options.cmake)
38 # turn off PCH totally if enabled (hidden setting, mainly for devs)
39 if( NOPCH )
40   set(USE_COREPCH 0)
41   set(USE_SCRIPTPCH 0)
42 endif()
44 include(CheckPlatform)
46 # basic packagesearching and setup (further support will be needed, this is a preliminary release!)
47 find_package(PCHSupport)
48 find_package(ACE REQUIRED)
49 find_package(OpenSSL REQUIRED)
50 if( NOT USE_MYSQL_SOURCES )
51   find_package(MySQL REQUIRED)
52 endif()
54 if( UNIX )
55   find_package(Readline)
56   find_package(ZLIB)
57   find_package(BZip2)
58 endif()
60 # Find revision ID and hash of the sourcetree
61 include(cmake/genrev.cmake)
63 # print out the results before continuing
64 include(cmake/showoptions.cmake)
66 # add dependencies
67 add_subdirectory(dep)
69 # add core sources
70 add_subdirectory(src)
72 # add sql-files
73 add_subdirectory(sql)