2013-12-10 18:41:43 +00:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
|
2013-12-28 22:46:23 +01:00
|
|
|
# Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html )
|
|
|
|
enable_language(CXX C)
|
|
|
|
|
2014-03-10 13:52:13 -07:00
|
|
|
# These env variables are used for configuring Travis CI builds.
|
|
|
|
# See https://github.com/mc-server/MCServer/pull/767
|
|
|
|
if(DEFINED ENV{TRAVIS_MCSERVER_BUILD_TYPE})
|
|
|
|
message("Setting build type to $ENV{TRAVIS_MCSERVER_BUILD_TYPE}")
|
|
|
|
set(CMAKE_BUILD_TYPE $ENV{TRAVIS_MCSERVER_BUILD_TYPE})
|
2014-03-07 20:16:16 +00:00
|
|
|
endif()
|
|
|
|
|
2014-03-10 13:52:13 -07:00
|
|
|
if(DEFINED ENV{TRAVIS_MCSERVER_FORCE32})
|
|
|
|
set(FORCE32 $ENV{TRAVIS_MCSERVER_FORCE32})
|
2014-03-07 20:16:16 +00:00
|
|
|
endif()
|
|
|
|
|
2014-02-16 05:55:37 -08:00
|
|
|
# This has to be done before any flags have been set up.
|
2014-02-16 03:37:31 -08:00
|
|
|
if(${BUILD_TOOLS})
|
|
|
|
add_subdirectory(Tools/MCADefrag/)
|
2014-02-16 04:30:45 -08:00
|
|
|
add_subdirectory(Tools/ProtoProxy/)
|
2014-02-16 03:37:31 -08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${BUILD_UNSTABLE_TOOLS})
|
|
|
|
add_subdirectory(Tools/GeneratorPerformanceTest/)
|
|
|
|
endif()
|
|
|
|
|
2014-02-15 15:17:58 -08:00
|
|
|
include(SetFlags.cmake)
|
|
|
|
set_flags()
|
|
|
|
set_lib_flags()
|
|
|
|
enable_profile()
|
2014-01-14 11:05:57 +01:00
|
|
|
|
2013-12-27 12:01:45 +01:00
|
|
|
# Under Windows, we need Lua as DLL; on *nix we need it linked statically:
|
|
|
|
if (WIN32)
|
|
|
|
add_definitions(-DLUA_BUILD_AS_DLL)
|
|
|
|
endif()
|
|
|
|
|
2014-01-14 11:05:57 +01:00
|
|
|
|
2013-12-27 12:01:45 +01:00
|
|
|
# The Expat library is linked in statically, make the source files aware of that:
|
2013-12-27 11:51:08 +01:00
|
|
|
add_definitions(-DXML_STATIC)
|
2013-12-21 13:45:27 +00:00
|
|
|
|
2014-02-05 10:10:45 -08:00
|
|
|
# Self Test Mode enables extra checks at startup
|
|
|
|
if(${SELF_TEST})
|
|
|
|
add_definitions(-DSELF_TEST)
|
|
|
|
endif()
|
2013-12-28 22:46:23 +01:00
|
|
|
|
|
|
|
|
2014-01-14 11:05:57 +01:00
|
|
|
|
2014-02-15 15:17:58 -08:00
|
|
|
|
|
|
|
|
2013-12-28 22:46:23 +01:00
|
|
|
project (MCServer)
|
|
|
|
|
2013-12-28 16:03:57 +01:00
|
|
|
# Include all the libraries:
|
2013-12-10 18:41:43 +00:00
|
|
|
add_subdirectory(lib/inifile/)
|
2013-12-10 21:39:20 +00:00
|
|
|
add_subdirectory(lib/jsoncpp/)
|
2013-12-10 23:26:55 +00:00
|
|
|
add_subdirectory(lib/zlib/)
|
2013-12-18 23:14:11 +00:00
|
|
|
add_subdirectory(lib/lua/)
|
2013-12-18 23:54:55 +00:00
|
|
|
add_subdirectory(lib/tolua++/)
|
2013-12-19 00:28:48 +00:00
|
|
|
add_subdirectory(lib/sqlite/)
|
2013-12-19 00:52:52 +00:00
|
|
|
add_subdirectory(lib/expat/)
|
|
|
|
add_subdirectory(lib/luaexpat/)
|
2013-12-19 00:55:01 +00:00
|
|
|
add_subdirectory(lib/md5/)
|
2013-12-10 21:39:20 +00:00
|
|
|
|
2014-01-22 22:19:33 +01:00
|
|
|
|
|
|
|
# We use EXCLUDE_FROM_ALL so that only the explicit dependencies are used
|
|
|
|
# (PolarSSL also has test and example programs in their CMakeLists.txt, we don't want those)
|
2014-02-16 04:30:45 -08:00
|
|
|
include(lib/polarssl.cmake)
|
2014-01-22 22:19:33 +01:00
|
|
|
|
2014-02-15 15:17:58 -08:00
|
|
|
set_exe_flags()
|
2013-12-27 11:51:08 +01:00
|
|
|
|
2014-01-15 13:54:06 +01:00
|
|
|
add_subdirectory (src)
|
2013-12-10 18:41:43 +00:00
|
|
|
|