server/CMakeLists.txt

73 lines
2.1 KiB
Text
Raw Normal View History

cmake_minimum_required(VERSION 2.9)
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)
2019-04-06 11:41:56 +02:00
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
2018-01-01 00:43:08 +01:00
2017-03-28 16:25:56 +02:00
if (MSVC)
2019-04-06 11:41:56 +02:00
find_package (PDCurses)
set (CURSES_FOUND ${PDCURSES_FOUND})
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
2021-02-13 12:10:47 +01:00
set (CURSES_INCLUDE_DIRS ${PDCURSES_INCLUDE_DIR})
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)
2019-04-06 11:41:56 +02:00
include (MSVC)
2018-01-01 00:43:08 +01:00
else (MSVC)
2019-04-06 11:41:56 +02:00
include (CheckIncludeFile)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(execinfo.h HAVE_EXECINFO_H)
include (CheckLibraryExists)
check_library_exists(m sin "" HAVE_LIBM)
check_library_exists(bsd strlcat "" HAVE_LIBBSD)
2017-12-31 21:33:31 +01:00
2019-04-06 11:41:56 +02:00
include (CheckFunctionExists)
check_function_exists(strdup HAVE_STRDUP)
check_function_exists(strlcat HAVE_STRLCAT)
2019-04-06 11:41:56 +02:00
if (HAVE_LIBBSD)
set (HAVE_STRLCAT 1)
2019-04-06 11:41:56 +02:00
endif (HAVE_LIBBSD)
2018-01-01 01:06:14 +01:00
endif (MSVC)
2021-02-13 12:10:47 +01:00
if (NOT CURSES_FOUND)
find_package (Curses)
endif (NOT CURSES_FOUND)
find_package (SQLite3 REQUIRED)
find_package (IniParser REQUIRED)
2021-02-13 15:10:48 +01:00
find_package (CJSON REQUIRED)
find_package (EXPAT REQUIRED)
if (TOLUA_FOUND)
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
find_package (Lua 5.2 REQUIRED)
else()
2018-01-11 16:30:34 +01:00
find_package (Lua51 REQUIRED)
endif()
endif(TOLUA_FOUND)
2017-03-28 16:25:56 +02:00
enable_testing()
add_subdirectory (tolua)
add_subdirectory (storage)
add_subdirectory (clibs)
add_subdirectory (process)
add_subdirectory (src eressea)
2017-03-28 16:25:56 +02:00
install(DIRECTORY etc DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.txt")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.po")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.json")
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY lunit DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY share DESTINATION ${CMAKE_INSTALL_PREFIX})
2017-03-28 16:25:56 +02:00
2018-01-11 16:30:34 +01:00