2012-06-04 08:39:32 +02:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
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)
|
|
|
|
|
2013-12-27 01:02:41 +01:00
|
|
|
project (eressea-server C)
|
2010-08-08 07:17:11 +02:00
|
|
|
|
2014-03-16 06:02:49 +01:00
|
|
|
|
2012-06-04 03:47:43 +02:00
|
|
|
enable_testing()
|
2012-05-23 22:51:52 +02:00
|
|
|
|
2013-05-12 23:51:54 +02:00
|
|
|
INCLUDE (CheckIncludeFiles)
|
|
|
|
INCLUDE (CheckSymbolExists)
|
|
|
|
CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)
|
2014-03-15 19:29:11 +01:00
|
|
|
CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H)
|
2014-03-15 20:35:20 +01:00
|
|
|
CHECK_INCLUDE_FILES (io.h HAVE_IO_H)
|
2013-05-12 23:51:54 +02:00
|
|
|
CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H)
|
2014-03-15 19:29:11 +01:00
|
|
|
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
|
2014-03-15 20:35:20 +01:00
|
|
|
IF (HAVE_IO_H)
|
|
|
|
CHECK_SYMBOL_EXISTS (_access "io.h" HAVE__ACCESS)
|
|
|
|
ENDIF (HAVE_IO_H)
|
2014-03-15 19:29:11 +01:00
|
|
|
IF (HAVE_WINDOWS_H)
|
|
|
|
CHECK_SYMBOL_EXISTS (_sleep "windows.h" HAVE__SLEEP)
|
|
|
|
ENDIF(HAVE_WINDOWS_H)
|
|
|
|
IF(HAVE_STDBOOL_H)
|
|
|
|
CHECK_SYMBOL_EXISTS (_Bool "stdbool.h" HAVE__BOOL)
|
|
|
|
ENDIF(HAVE_STDBOOL_H)
|
|
|
|
IF(HAVE_UNISTD_H)
|
|
|
|
CHECK_SYMBOL_EXISTS (sleep "unistd.h" HAVE_SLEEP)
|
|
|
|
CHECK_SYMBOL_EXISTS (usleep "unistd.h" HAVE_USLEEP)
|
2014-03-15 21:18:36 +01:00
|
|
|
CHECK_SYMBOL_EXISTS (access "unistd.h" HAVE_ACCESS)
|
2014-03-15 19:29:11 +01:00
|
|
|
ENDIF(HAVE_UNISTD_H)
|
|
|
|
CHECK_SYMBOL_EXISTS (strcasecmp "string.h" HAVE_STRCASECMP)
|
|
|
|
CHECK_SYMBOL_EXISTS (strncasecmp "string.h" HAVE_STRNCASECMP)
|
|
|
|
CHECK_SYMBOL_EXISTS (_strlwr "string.h" HAVE__STRLWR)
|
|
|
|
CHECK_SYMBOL_EXISTS (_strcmpl "string.h" HAVE__STRCMPL)
|
2013-12-29 09:19:22 +01:00
|
|
|
CHECK_SYMBOL_EXISTS (_strdup "string.h" HAVE__STRDUP)
|
2014-03-15 19:29:11 +01:00
|
|
|
CHECK_SYMBOL_EXISTS (_stricmp "string.h" HAVE__STRICMP)
|
|
|
|
CHECK_SYMBOL_EXISTS (_memicmp "string.h" HAVE__MEMICMP)
|
|
|
|
CHECK_SYMBOL_EXISTS (strcmpl "string.h" HAVE_STRCMPL)
|
|
|
|
CHECK_SYMBOL_EXISTS (strdup "string.h" HAVE_STRDUP)
|
|
|
|
CHECK_SYMBOL_EXISTS (stricmp "string.h" HAVE_STRICMP)
|
|
|
|
CHECK_SYMBOL_EXISTS (memicmp "string.h" HAVE_MEMICMP)
|
|
|
|
CHECK_SYMBOL_EXISTS (strlwr "string.h" HAVE_STRLWR)
|
|
|
|
CHECK_SYMBOL_EXISTS (snprintf "stdio.h" HAVE_SNPRINTF)
|
|
|
|
CHECK_SYMBOL_EXISTS (_snprintf "stdio.h" HAVE__SNPRINTF)
|
|
|
|
CHECK_SYMBOL_EXISTS (mkdir "sys/stat.h" HAVE_SYS_STAT_MKDIR)
|
|
|
|
CHECK_SYMBOL_EXISTS (mkdir "direct.h" HAVE_DIRECT_MKDIR)
|
|
|
|
CHECK_SYMBOL_EXISTS (_mkdir "direct.h" HAVE_DIRECT__MKDIR)
|
2013-05-12 23:51:54 +02:00
|
|
|
|
|
|
|
CONFIGURE_FILE (
|
2014-03-15 19:29:11 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/autoconf.h.in
|
|
|
|
${CMAKE_BINARY_DIR}/include/autoconf.h)
|
2013-05-12 23:51:54 +02:00
|
|
|
INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/include)
|
2014-03-15 19:29:11 +01:00
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_AUTOCONF")
|
2013-05-12 23:51:54 +02:00
|
|
|
|
2013-05-05 02:29:39 +02:00
|
|
|
|
2014-06-10 04:04:11 +02:00
|
|
|
find_package (LibXml2)
|
2014-06-12 05:30:34 +02:00
|
|
|
find_package (SQLite3)
|
|
|
|
find_package (Curses)
|
2013-12-29 00:13:22 +01:00
|
|
|
find_package (Lua REQUIRED)
|
|
|
|
find_package (ToLua REQUIRED)
|
2013-05-05 00:47:53 +02:00
|
|
|
|
2013-12-31 09:05:52 +01:00
|
|
|
add_subdirectory (cutest)
|
2012-06-07 21:44:25 +02:00
|
|
|
add_subdirectory (crypto)
|
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)
|
2013-12-31 09:05:52 +01:00
|
|
|
add_subdirectory (quicklist)
|
2012-06-07 21:44:25 +02:00
|
|
|
add_subdirectory (critbit)
|
2014-02-18 05:45:00 +01:00
|
|
|
add_subdirectory (src eressea)
|
2014-08-17 11:19:04 +02:00
|
|
|
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
|
2014-07-17 15:55:50 +02:00
|
|
|
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
|
2014-08-17 11:19:04 +02:00
|
|
|
|