X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=CMakeLists.txt;h=c81d5cb59725b7109a2740d301d59c79ec92a30f;hp=31359159a4062b05b26f92decd9aa061e5d8cc4d;hb=5c0453c8697cfaa843dd7f799e5404733ee56e13;hpb=b9c3763a932cebaa015a27fe111017f6f34dfbaa diff --git a/CMakeLists.txt b/CMakeLists.txt index 3135915..c81d5cb 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 @@ -20,6 +22,9 @@ src/uuidgenerator.cpp src/db/sqlite3db.cpp src/db/sqlite3recordset.cpp src/db/sqlite3statement.cpp +src/freenet/boardlistinserter.cpp +src/freenet/boardlistrequester.cpp +src/freenet/boardlistxml.cpp src/freenet/fcpv2.cpp src/freenet/freenetmasterthread.cpp src/freenet/freenetssk.cpp @@ -39,6 +44,7 @@ src/freenet/messagelistxml.cpp src/freenet/messagerequester.cpp src/freenet/messagexml.cpp src/freenet/periodicdbmaintenance.cpp +src/freenet/siteinserter.cpp src/freenet/trustlistinserter.cpp src/freenet/trustlistrequester.cpp src/freenet/trustlistxml.cpp @@ -48,14 +54,19 @@ src/freenet/captcha/easybmp/EasyBMP.cpp src/freenet/captcha/easybmp/EasyBMP_Font.cpp src/freenet/captcha/easybmp/EasyBMP_Geometry.cpp src/http/httpthread.cpp +src/http/identityexportxml.cpp src/http/ipagehandler.cpp src/http/pages/addpeerpage.cpp src/http/pages/announceidentitypage.cpp +src/http/pages/boardspage.cpp src/http/pages/controlboardpage.cpp src/http/pages/createidentitypage.cpp +src/http/pages/execquerypage.cpp src/http/pages/homepage.cpp src/http/pages/localidentitiespage.cpp src/http/pages/optionspage.cpp +src/http/pages/peerdetailspage.cpp +src/http/pages/peermaintenancepage.cpp src/http/pages/peertrustpage.cpp src/http/pages/showcaptchapage.cpp src/nntp/nntpconnection.cpp @@ -73,6 +84,12 @@ src/pthreadwrapper/threadedexecutor.cpp src/xyssl/sha1.c ) +IF(WIN32) + SET(FMS_PLATFORM_SRC src/fmsservice.cpp) +ELSE(WIN32) + SET(FMS_PLATFORM_SRC src/fmsdaemon.cpp) +ENDIF(WIN32) + ADD_DEFINITIONS(-DTIXML_USE_STL) # was for ZThreads @@ -81,26 +98,47 @@ ADD_DEFINITIONS(-DTIXML_USE_STL) # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") #ENDIF(CMAKE_COMPILER_IS_GNUCXX) -ADD_EXECUTABLE(fms ${FMS_SRC}) +ADD_EXECUTABLE(fms ${FMS_SRC} ${FMS_PLATFORM_SRC}) -# For SQLite3 and shttpd +# link dl - For SQLite3 and shttpd - not for FreeBSD IF(CMAKE_COMPILER_IS_GNUCC) - TARGET_LINK_LIBRARIES(fms dl) + IF(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) +# add -lcompat only for FreeBSD +IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + IF(CMAKE_COMPILER_IS_GNUCXX) + TARGET_LINK_LIBRARIES(fms compat) + ENDIF(CMAKE_COMPILER_IS_GNUCXX) +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + +# link ws2_32 for Windows IF(WIN32) TARGET_LINK_LIBRARIES(fms ws2_32) ENDIF(WIN32) -FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3_s) +# add -lxnet and -lsocket on solaris +IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + TARGET_LINK_LIBRARIES(fms xnet) + TARGET_LINK_LIBRARIES(fms socket) +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + +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) @@ -133,6 +171,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)