2017-03-27 21:10:30 +02:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2017-03-28 16:25:56 +02:00
|
|
|
|
2014-03-16 06:02:49 +01:00
|
|
|
if (WIN32)
|
|
|
|
FILE(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
|
|
|
|
FILE(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
|
|
|
|
endif(WIN32)
|
|
|
|
|
2018-01-01 00:43:08 +01:00
|
|
|
project (eressea-server C)
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH})
|
|
|
|
|
2017-03-28 16:25:56 +02:00
|
|
|
if (MSVC)
|
|
|
|
include(MSVC)
|
2018-01-01 00:43:08 +01:00
|
|
|
set (HAVE_STRDUP 0)
|
|
|
|
set (HAVE_STRLCAT 0)
|
|
|
|
set (HAVE_LIBBSD 0)
|
2018-03-11 16:52:07 +01:00
|
|
|
set (HAVE_SIGNAL_H 0)
|
|
|
|
set (HAVE_EXECINFO_H 0)
|
2018-01-01 00:43:08 +01:00
|
|
|
else (MSVC)
|
2017-03-27 20:25:27 +02:00
|
|
|
|
2017-12-31 21:33:31 +01:00
|
|
|
INCLUDE (CheckIncludeFile)
|
2018-03-11 16:52:07 +01:00
|
|
|
CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
|
|
|
|
CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H)
|
2017-12-31 21:33:31 +01:00
|
|
|
CHECK_INCLUDE_FILE(bsd/string.h HAVE_LIBBSD)
|
|
|
|
|
|
|
|
INCLUDE (CheckFunctionExists)
|
|
|
|
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
|
|
|
|
IF (HAVE_LIBBSD)
|
|
|
|
INCLUDE (CheckLibraryExists)
|
|
|
|
CHECK_LIBRARY_EXISTS(bsd strlcat "bsd/string.h" HAVE_STRLCAT)
|
|
|
|
ELSE (HAVE_LIBBSD)
|
|
|
|
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
|
|
|
|
ENDIF(HAVE_LIBBSD)
|
2017-12-11 08:53:10 +01:00
|
|
|
|
2018-01-01 00:43:08 +01:00
|
|
|
endif (MSVC)
|
|
|
|
|
2018-01-01 01:06:14 +01:00
|
|
|
if (MSVC)
|
|
|
|
find_package (PDCurses)
|
|
|
|
SET(CURSES_FOUND ${PDCURSES_FOUND})
|
|
|
|
SET(CURSES_LIBRARIES ${PDCURSES_LIBRARY})
|
|
|
|
SET(CURSES_INCLUDE_DIR ${PDCURSES_INCLUDE_DIR})
|
|
|
|
else (MSVC)
|
|
|
|
find_package (Curses)
|
|
|
|
endif (MSVC)
|
|
|
|
|
2018-02-25 16:36:22 +01:00
|
|
|
find_package (Readline)
|
|
|
|
|
2018-02-02 18:25:18 +01:00
|
|
|
if (ERESSEA_DB STREQUAL "db")
|
|
|
|
find_package (BerkeleyDB REQUIRED QUIET)
|
|
|
|
else()
|
|
|
|
find_package (SQLite3 REQUIRED QUIET)
|
|
|
|
endif()
|
|
|
|
|
2018-04-24 21:50:49 +02:00
|
|
|
find_package(EXPAT)
|
2018-01-01 01:06:14 +01:00
|
|
|
find_package (LibXml2 REQUIRED)
|
2017-03-27 21:30:46 +02:00
|
|
|
find_package (ToLua REQUIRED)
|
|
|
|
if (TOLUA_FOUND)
|
2018-01-11 16:30:34 +01:00
|
|
|
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
|
2017-03-27 21:30:46 +02:00
|
|
|
find_package (Lua 5.2 REQUIRED)
|
2018-01-11 16:30:34 +01:00
|
|
|
else ()
|
|
|
|
find_package (Lua51 REQUIRED)
|
2017-03-27 21:30:46 +02:00
|
|
|
endif()
|
|
|
|
endif(TOLUA_FOUND)
|
2012-05-23 22:51:52 +02:00
|
|
|
|
2017-03-28 16:25:56 +02:00
|
|
|
enable_testing()
|
|
|
|
|
2014-03-06 16:15:43 +01:00
|
|
|
add_subdirectory (cJSON)
|
2013-12-31 10:06:28 +01:00
|
|
|
add_subdirectory (storage)
|
2012-06-07 21:44:25 +02:00
|
|
|
add_subdirectory (iniparser)
|
2016-12-19 21:35:02 +01:00
|
|
|
add_subdirectory (clibs)
|
2016-02-10 23:06:41 +01:00
|
|
|
add_subdirectory (process)
|
2014-02-18 05:45:00 +01:00
|
|
|
add_subdirectory (src eressea)
|
2017-03-28 16:25:56 +02:00
|
|
|
|
2017-09-03 11:09:15 +02:00
|
|
|
install(DIRECTORY etc DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.txt")
|
2014-08-17 11:19:04 +02:00
|
|
|
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
|
2015-02-08 12:05:50 +01:00
|
|
|
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.json")
|
2014-07-17 15:55:50 +02:00
|
|
|
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
|
2017-01-20 08:32:31 +01:00
|
|
|
install(DIRECTORY lunit DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
|
2015-06-17 07:29:22 +02:00
|
|
|
install(DIRECTORY share DESTINATION ${CMAKE_INSTALL_PREFIX})
|
2017-03-28 16:25:56 +02:00
|
|
|
|
2018-01-11 16:30:34 +01:00
|
|
|
|