2012-12-31 23:15:50 +01:00
|
|
|
# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
2010-06-09 15:39:34 +02:00
|
|
|
#
|
|
|
|
|
# This file is free software; as a special exception the author gives
|
|
|
|
|
# unlimited permission to copy and/or distribute it, with or without
|
|
|
|
|
# modifications, as long as this notice is preserved.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
|
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# Set projectname (must be done AFTER setting configurationtypes)
|
2010-07-29 21:08:16 +02:00
|
|
|
project(TrinityCore)
|
2010-06-24 15:08:01 +02:00
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# CMake policies (can not be handled elsewhere)
|
2012-11-27 00:43:38 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2013-01-29 23:18:25 +01:00
|
|
|
cmake_policy(SET CMP0005 OLD)
|
2013-01-29 15:53:21 +01:00
|
|
|
|
|
|
|
|
# add this options before PROJECT keyword
|
|
|
|
|
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
|
|
|
|
|
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
|
2010-06-14 02:00:30 +02:00
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# Set RPATH-handing (CMake parameters)
|
|
|
|
|
set(CMAKE_SKIP_BUILD_RPATH 0)
|
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
|
|
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
|
2010-08-09 05:22:58 +02:00
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# set macro-directory
|
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/macros")
|
2010-06-24 15:08:01 +02:00
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# build in Release-mode by default if not explicitly set
|
|
|
|
|
if( NOT CMAKE_BUILD_TYPE )
|
|
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
2010-06-24 15:08:01 +02:00
|
|
|
endif()
|
2009-01-17 09:23:33 -05:00
|
|
|
|
2010-08-20 04:09:39 +02:00
|
|
|
include(CheckCXXSourceRuns)
|
2009-06-29 00:47:19 +02:00
|
|
|
include(CheckIncludeFiles)
|
2010-08-28 21:42:07 +02:00
|
|
|
|
2010-08-28 23:19:43 +02:00
|
|
|
# set default buildoptions and print them
|
|
|
|
|
include(cmake/options.cmake)
|
|
|
|
|
|
2010-08-28 21:42:07 +02:00
|
|
|
# turn off PCH totally if enabled (hidden setting, mainly for devs)
|
|
|
|
|
if( NOPCH )
|
|
|
|
|
set(USE_COREPCH 0)
|
|
|
|
|
set(USE_SCRIPTPCH 0)
|
|
|
|
|
endif()
|
|
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
include(CheckPlatform)
|
2010-08-20 04:09:39 +02:00
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# basic packagesearching and setup (further support will be needed, this is a preliminary release!)
|
2010-08-20 04:09:39 +02:00
|
|
|
find_package(PCHSupport)
|
|
|
|
|
find_package(ACE REQUIRED)
|
|
|
|
|
find_package(OpenSSL REQUIRED)
|
2010-09-08 19:20:38 +02:00
|
|
|
if( NOT USE_MYSQL_SOURCES )
|
2010-09-08 14:40:45 +02:00
|
|
|
find_package(MySQL REQUIRED)
|
|
|
|
|
endif()
|
|
|
|
|
|
2010-06-24 15:08:01 +02:00
|
|
|
if( UNIX )
|
2010-08-20 04:09:39 +02:00
|
|
|
find_package(Readline)
|
|
|
|
|
find_package(ZLIB)
|
|
|
|
|
find_package(BZip2)
|
2010-06-24 15:08:01 +02:00
|
|
|
endif()
|
2010-05-18 00:17:14 +02:00
|
|
|
|
2013-02-11 23:27:20 +01:00
|
|
|
if(NOT WITHOUT_GIT)
|
2013-02-11 20:04:27 +01:00
|
|
|
find_package(Git)
|
|
|
|
|
endif()
|
|
|
|
|
|
2010-10-03 16:55:24 +02:00
|
|
|
# Find revision ID and hash of the sourcetree
|
|
|
|
|
include(cmake/genrev.cmake)
|
|
|
|
|
|
2010-08-28 21:51:28 +02:00
|
|
|
# print out the results before continuing
|
|
|
|
|
include(cmake/showoptions.cmake)
|
|
|
|
|
|
2010-08-28 18:49:17 +02:00
|
|
|
# add dependencies
|
2010-08-17 02:14:20 +02:00
|
|
|
add_subdirectory(dep)
|
2010-08-28 18:49:17 +02:00
|
|
|
|
|
|
|
|
# add core sources
|
2009-01-17 09:23:33 -05:00
|
|
|
add_subdirectory(src)
|