2012-06-04 08:39:32 +02:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
2012-06-04 03:55:52 +02:00
|
|
|
project (server C)
|
|
|
|
|
2013-05-05 00:47:53 +02:00
|
|
|
IF(CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
2013-12-29 07:58:39 +01:00
|
|
|
ELSEIF(MSVC)
|
2013-05-05 00:47:53 +02:00
|
|
|
ELSE(CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
|
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
2012-06-04 03:55:52 +02:00
|
|
|
|
2014-02-18 05:45:00 +01:00
|
|
|
find_package (Lua 5 REQUIRED)
|
|
|
|
find_package (ToLua REQUIRED)
|
|
|
|
find_package (SQLite3 REQUIRED)
|
|
|
|
|
|
|
|
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
|
2012-06-04 03:55:52 +02:00
|
|
|
include_directories (${CRITBIT_INCLUDE_DIR})
|
2013-12-31 10:06:28 +01:00
|
|
|
include_directories (${STORAGE_INCLUDE_DIR})
|
2012-06-04 03:55:52 +02:00
|
|
|
include_directories (${CRYPTO_INCLUDE_DIR})
|
|
|
|
include_directories (${QUICKLIST_INCLUDE_DIR})
|
|
|
|
include_directories (${CUTEST_INCLUDE_DIR})
|
|
|
|
include_directories (${LUA_INCLUDE_DIR})
|
|
|
|
include_directories (${LIBXML2_INCLUDE_DIR})
|
|
|
|
include_directories (${BSON_INCLUDE_DIR})
|
|
|
|
include_directories (${INIPARSER_INCLUDE_DIR})
|
2013-05-05 00:47:53 +02:00
|
|
|
include_directories (${CURSES_INCLUDE_DIR})
|
2012-06-04 03:55:52 +02:00
|
|
|
|
2014-02-18 05:45:00 +01:00
|
|
|
add_subdirectory(util)
|
|
|
|
add_subdirectory(kernel)
|
|
|
|
add_subdirectory(items)
|
|
|
|
add_subdirectory(attributes)
|
|
|
|
add_subdirectory(bindings)
|
|
|
|
add_subdirectory(spells)
|
|
|
|
add_subdirectory(triggers)
|
|
|
|
add_subdirectory(modules)
|
|
|
|
add_subdirectory(races)
|
|
|
|
|
|
|
|
set(TESTS
|
|
|
|
laws_test.c
|
|
|
|
economy_test.c
|
|
|
|
market_test.c
|
|
|
|
)
|
|
|
|
|
2012-06-05 06:45:25 +02:00
|
|
|
set (SERVER_SRC
|
2014-02-18 05:45:00 +01:00
|
|
|
eressea.c
|
|
|
|
archetype.c
|
|
|
|
creation.c
|
|
|
|
creport.c
|
|
|
|
economy.c
|
|
|
|
give.c
|
|
|
|
items.c
|
|
|
|
laws.c
|
|
|
|
market.c
|
|
|
|
monster.c
|
|
|
|
randenc.c
|
|
|
|
report.c
|
|
|
|
spy.c
|
|
|
|
study.c
|
|
|
|
summary.c
|
|
|
|
xmlreport.c
|
|
|
|
gmtool.c
|
2012-06-05 06:45:25 +02:00
|
|
|
monsters.c
|
2014-02-18 05:45:00 +01:00
|
|
|
${BINDINGS_SRC}
|
|
|
|
${SPELLS_SRC}
|
|
|
|
${RACES_SRC}
|
|
|
|
${ITEMS_SRC}
|
|
|
|
${MODULES_SRC}
|
|
|
|
${TRIGGERS_SRC}
|
|
|
|
${ATTRIBUTES_SRC}
|
|
|
|
${KERNEL_SRC}
|
|
|
|
${UTIL_SRC}
|
2012-06-05 06:45:25 +02:00
|
|
|
)
|
|
|
|
|
2014-02-18 05:45:00 +01:00
|
|
|
add_executable(eressea ${SERVER_SRC} main.c)
|
|
|
|
target_link_libraries(eressea
|
|
|
|
${LUA_LIBRARIES}
|
|
|
|
${TOLUA_LIBRARIES}
|
|
|
|
${QUICKLIST_LIBRARIES}
|
|
|
|
${LIBXML2_LIBRARIES}
|
|
|
|
${STORAGE_LIBRARIES}
|
|
|
|
${SQLITE3_LIBRARIES}
|
|
|
|
${CRITBIT_LIBRARIES}
|
|
|
|
${CRYPTO_LIBRARIES}
|
|
|
|
${CURSES_LIBRARIES}
|
|
|
|
${INIPARSER_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SERVER_TEST_SRC
|
|
|
|
test_eressea.c
|
|
|
|
tests.c
|
|
|
|
tests_test.c
|
|
|
|
economy_test.c
|
|
|
|
market_test.c
|
|
|
|
laws_test.c
|
|
|
|
${UTIL_TESTS}
|
|
|
|
${KERNEL_TESTS}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(test_eressea ${SERVER_SRC} ${SERVER_TEST_SRC})
|
|
|
|
target_link_libraries(test_eressea ${CUTEST_LIBRARIES})
|
|
|
|
target_link_libraries(test_eressea
|
|
|
|
${LUA_LIBRARIES}
|
|
|
|
${TOLUA_LIBRARIES}
|
|
|
|
${QUICKLIST_LIBRARIES}
|
|
|
|
${LIBXML2_LIBRARIES}
|
|
|
|
${STORAGE_LIBRARIES}
|
|
|
|
${SQLITE3_LIBRARIES}
|
|
|
|
${CRITBIT_LIBRARIES}
|
|
|
|
${CRYPTO_LIBRARIES}
|
|
|
|
${CURSES_LIBRARIES}
|
|
|
|
${INIPARSER_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_test(server test_eressea)
|