From c8f8c064d3528976d86d401b9dff3357ef1f280e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 21 May 2012 03:25:07 +0200 Subject: [PATCH] introduce an option to compile the sqlite from external into the executable --- CMakeLists.txt | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79ce71ee7..9b5624c81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,12 @@ cmake_minimum_required(VERSION 2.4) project(eressea C) +## CMake configuration ## +# You can pass these to cmake with -DNEED_OPTION=1 +# +# if your system does not have libsqlite3-dev installed: +# set(NEED_SQLITE 1) + if (${CMAKE_C_COMPILER} MATCHES ".*tcc") set(CMAKE_C_FLAGS "-Wall -g") add_definitions(-DTINYCC) @@ -18,7 +24,6 @@ endif (WIN32) include_directories (../external ../shared/src) set (LIB_SRCS -# ../external/sqlite3.c ../external/md5.c ../external/bson/bson.c ../external/bson/numbers.c @@ -30,6 +35,17 @@ set (LIB_SRCS ../shared/src/build/util.c ) +set (LINK_LIBS tolua xml2 ncurses lua5.1 pthread) + +if (NEED_SQLITE) + set(LIB_SRCS + ${LIB_SRCS} + ../external/sqlite3.c + ) +else (NEED_SQLITE) + set (LINK_LIBS ${LINK_LIBS} sqlite3) +endif (NEED_SQLITE) + set (ERESSEA_SRCS src/server.c ) @@ -37,7 +53,7 @@ set (ERESSEA_SRCS add_executable (eressea ${LIB_SRCS} ${ERESSEA_SRCS}) if (WIN32) else (WIN32) - target_link_libraries (eressea tolua xml2 ncurses lua5.1 pthread sqlite3) + target_link_libraries (eressea ${LINK_LIBS}) endif (WIN32) add_definitions(-DUNITY_BUILD)