2021-03-16 21:35:33 +01:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2021-02-20 23:22:10 +01:00
|
|
|
|
2014-03-16 06:02:49 +01:00
|
|
|
if (WIN32)
|
2021-02-14 11:05:28 +01:00
|
|
|
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
|
|
|
|
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
|
2014-03-16 06:02:49 +01:00
|
|
|
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/")
|
2021-02-21 09:53:30 +01:00
|
|
|
if (WIN32)
|
|
|
|
# make subdirectories build to the same output folders (DLLs):
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
|
|
|
endif (WIN32)
|
2018-01-01 00:43:08 +01:00
|
|
|
|
2017-03-28 16:25:56 +02:00
|
|
|
if (MSVC)
|
2021-03-16 21:29:05 +01:00
|
|
|
find_package (PDCurses)
|
|
|
|
set (CURSES_FOUND ${PDCURSES_FOUND})
|
|
|
|
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
|
|
|
|
set (CURSES_INCLUDE_DIRS ${PDCURSES_INCLUDE_DIR})
|
|
|
|
endif(MSVC)
|
|
|
|
|
|
|
|
if (NOT CURSES_FOUND)
|
|
|
|
set(CURSES_NEED_WIDE TRUE)
|
|
|
|
set(CURSES_NEED_NCURSES TRUE)
|
|
|
|
find_package (Curses)
|
|
|
|
if (NOT CURSES_FOUND)
|
|
|
|
set(CURSES_NEED_WIDE FALSE)
|
|
|
|
find_package (Curses REQUIRED)
|
|
|
|
endif(NOT CURSES_FOUND)
|
|
|
|
endif (NOT CURSES_FOUND)
|
|
|
|
|
|
|
|
find_package (ToLua 5.2 REQUIRED)
|
|
|
|
#find_package (BerkeleyDB REQUIRED)
|
|
|
|
find_package (SQLite3 REQUIRED)
|
|
|
|
find_package (IniParser REQUIRED)
|
|
|
|
find_package (CJSON REQUIRED)
|
|
|
|
find_package (EXPAT REQUIRED)
|
|
|
|
|
|
|
|
find_package (Lua)
|
|
|
|
if (NOT LUA_FOUND)
|
|
|
|
find_package (Lua51 REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (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)
|
2019-04-06 11:41:56 +02:00
|
|
|
include (CheckIncludeFile)
|
2021-02-14 11:05:28 +01:00
|
|
|
check_include_file(signal.h HAVE_SIGNAL_H)
|
|
|
|
check_include_file(execinfo.h HAVE_EXECINFO_H)
|
|
|
|
|
|
|
|
include (CheckLibraryExists)
|
2021-02-19 18:13:05 +01:00
|
|
|
check_library_exists(m fmin "" HAVE_LIBM)
|
2021-02-14 11:05:28 +01:00
|
|
|
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)
|
2021-02-14 11:05:28 +01:00
|
|
|
check_function_exists(strdup HAVE_STRDUP)
|
|
|
|
check_function_exists(strlcat HAVE_STRLCAT)
|
|
|
|
|
2019-04-06 11:41:56 +02:00
|
|
|
if (HAVE_LIBBSD)
|
2021-02-14 11:05:28 +01:00
|
|
|
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)
|
|
|
|
|
2017-03-28 16:25:56 +02:00
|
|
|
enable_testing()
|
|
|
|
|
2021-02-14 18:51:57 +01:00
|
|
|
add_subdirectory (tools)
|
2013-12-31 10:06:28 +01:00
|
|
|
add_subdirectory (storage)
|
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")
|
2018-05-18 21:14:14 +02:00
|
|
|
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.po")
|
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
|
|
|
|