X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=CMakeLists.txt;h=00b85c5b2605ff83ba3d214a1f0fb446629ef7b7;hb=175f098e7e712b839db433b93fe8649a402c6784;hp=5f976acc73cfdf7309636334bbeb30b8fb400e76;hpb=ee580d19b7920904587e18d72a3465d52eab6204;p=fms.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f976ac..00b85c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ PROJECT(fms) +OPTION(USE_BUNDLED_SQLITE "Use the bundled SQLite3 library" OFF) + SET(FMS_SRC src/base64.cpp src/board.cpp @@ -100,7 +102,7 @@ ADD_EXECUTABLE(fms ${FMS_SRC} ${FMS_PLATFORM_SRC}) # link dl - For SQLite3 and shttpd - not for FreeBSD IF(CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + ELSE(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") TARGET_LINK_LIBRARIES(fms dl) ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ENDIF(CMAKE_COMPILER_IS_GNUCC) @@ -108,7 +110,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) # add -lcompat only for FreeBSD IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") IF(CMAKE_COMPILER_IS_GNUCXX) - ADD_DEFINITIONS(-lcompat) + TARGET_LINK_LIBRARIES(fms compat) ENDIF(CMAKE_COMPILER_IS_GNUCXX) ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") @@ -119,18 +121,23 @@ ENDIF(WIN32) # add -lxnet and -lsocket on solaris IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") - ADD_DEFINITIONS(-lxnet -lsocket) + TARGET_LINK_LIBRARIES(fms xnet) + TARGET_LINK_LIBRARIES(fms socket) ENDIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") -FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3_s) +IF(NOT USE_BUNDLED_SQLITE) + FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3_s) +ENDIF(NOT USE_BUNDLED_SQLITE) FIND_LIBRARY(TINYXML_LIBRARY NAMES tinyxml tinyxml_s) FIND_LIBRARY(PTHREADS_LIBRARY NAMES pthread pthreads pthreadvc2) -FIND_LIBRARY(SHTTPD_LIBRARY NAMES shttpd) +FIND_LIBRARY(SHTTPD_LIBRARY NAMES shttpd shttpd_s) IF(SQLITE3_LIBRARY) TARGET_LINK_LIBRARIES(fms ${SQLITE3_LIBRARY}) ELSE(SQLITE3_LIBRARY) - MESSAGE(STATUS "Could not find system SQLite library. Will compile from included source.") + IF(NOT USE_BUNDLED_SQLITE) + MESSAGE(STATUS "Could not find system SQLite library. Will compile from included source.") + ENDIF(NOT USE_BUNDLED_SQLITE) ADD_LIBRARY(sqlite3 libs/sqlite3/sqlite3.c) TARGET_LINK_LIBRARIES(fms sqlite3) INCLUDE_DIRECTORIES(libs/sqlite3) @@ -163,6 +170,6 @@ ELSE(SHTTPD_LIBRARY) ELSE(WIN32) SET(SHTTPD_PLATFORM_SRC libs/shttpd/compat_unix.c) ENDIF(WIN32) - ADD_LIBRARY(shttpd ${SHTTPD_PLATFORM_SRC} libs/shttpd/auth.c libs/shttpd/cgi.c libs/shttpd/config.c libs/shttpd/io_cgi.c libs/shttpd/io_dir.c libs/shttpd/io_emb.c libs/shttpd/io_file.c libs/shttpd/io_socket.c libs/shttpd/io_ssi.c libs/shttpd/io_ssl.c libs/shttpd/log.c libs/shttpd/md5.c libs/shttpd/mime_type.c libs/shttpd/shttpd.c libs/shttpd/string.c) + ADD_LIBRARY(shttpd ${SHTTPD_PLATFORM_SRC} libs/shttpd/auth.c libs/shttpd/cgi.c libs/shttpd/config.c libs/shttpd/io_cgi.c libs/shttpd/io_dir.c libs/shttpd/io_emb.c libs/shttpd/io_file.c libs/shttpd/io_socket.c libs/shttpd/io_ssi.c libs/shttpd/io_ssl.c libs/shttpd/log.c libs/shttpd/md5.c libs/shttpd/shttpd.c libs/shttpd/string.c) TARGET_LINK_LIBRARIES(fms shttpd) ENDIF(SHTTPD_LIBRARY)