X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=CMakeLists.txt;h=024be6a4a6b9ada8359bcbab735f3bca639f7993;hp=ddf3dadc0a86fec3d945bcdd0a7c5bb5e4c22964;hb=f60495a029c54358f82956482fe203fe2b7b5b23;hpb=868c533e84b3c81b6604b45b84efa32073aa20b4 diff --git a/CMakeLists.txt b/CMakeLists.txt index ddf3dad..024be6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ src/messagelist.cpp src/option.cpp src/socketdefines.cpp src/stringfunctions.cpp +src/threadcontroller.cpp src/uuidgenerator.cpp src/db/sqlite3db.cpp src/db/sqlite3recordset.cpp @@ -29,7 +30,6 @@ src/freenet/identityintroductionxml.cpp src/freenet/identityrequester.cpp src/freenet/identityxml.cpp src/freenet/introductionpuzzleinserter.cpp -src/freenet/introductionpuzzleremover.cpp src/freenet/introductionpuzzlerequester.cpp src/freenet/introductionpuzzlexml.cpp src/freenet/messageinserter.cpp @@ -38,6 +38,7 @@ src/freenet/messagelistrequester.cpp src/freenet/messagelistxml.cpp src/freenet/messagerequester.cpp src/freenet/messagexml.cpp +src/freenet/periodicdbmaintenance.cpp src/freenet/trustlistinserter.cpp src/freenet/trustlistrequester.cpp src/freenet/trustlistxml.cpp @@ -46,6 +47,19 @@ src/freenet/captcha/simplecaptcha.cpp 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/controlboardpage.cpp +src/http/pages/createidentitypage.cpp +src/http/pages/homepage.cpp +src/http/pages/localidentitiespage.cpp +src/http/pages/optionspage.cpp +src/http/pages/peerdetailspage.cpp +src/http/pages/peertrustpage.cpp +src/http/pages/showcaptchapage.cpp src/nntp/nntpconnection.cpp src/nntp/nntplistener.cpp src/nntp/uwildmat.cpp @@ -53,14 +67,34 @@ src/nntp/mime/Mime.cpp src/nntp/mime/MimeChar.cpp src/nntp/mime/MimeCode.cpp src/nntp/mime/MimeType.cpp +src/pthreadwrapper/guard.cpp +src/pthreadwrapper/mutex.cpp +src/pthreadwrapper/runnable.cpp +src/pthreadwrapper/thread.cpp +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) -ADD_EXECUTABLE(fms ${FMS_SRC}) +# was for ZThreads +#IF(CMAKE_COMPILER_IS_GNUCXX) +# #ADD_DEFINITIONS(-fpermissive) +# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") +#ENDIF(CMAKE_COMPILER_IS_GNUCXX) -INCLUDE_DIRECTORIES(libs/sqlite3 libs/tinyxml) +ADD_EXECUTABLE(fms ${FMS_SRC} ${FMS_PLATFORM_SRC}) + +# For SQLite3 and shttpd +IF(CMAKE_COMPILER_IS_GNUCC) + TARGET_LINK_LIBRARIES(fms dl) +ENDIF(CMAKE_COMPILER_IS_GNUCC) IF(WIN32) TARGET_LINK_LIBRARIES(fms ws2_32) @@ -68,7 +102,8 @@ ENDIF(WIN32) FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3_s) FIND_LIBRARY(TINYXML_LIBRARY NAMES tinyxml tinyxml_s) -FIND_LIBRARY(ZTHREADS_LIBRARY NAMES zthread ZThread zthread_s) +FIND_LIBRARY(PTHREADS_LIBRARY NAMES pthread pthreads pthreadvc2) +FIND_LIBRARY(SHTTPD_LIBRARY NAMES shttpd) IF(SQLITE3_LIBRARY) TARGET_LINK_LIBRARIES(fms ${SQLITE3_LIBRARY}) @@ -76,8 +111,7 @@ ELSE(SQLITE3_LIBRARY) MESSAGE(STATUS "Could not find system SQLite library. Will compile from included source.") ADD_LIBRARY(sqlite3 libs/sqlite3/sqlite3.c) TARGET_LINK_LIBRARIES(fms sqlite3) -ADD_LIBRARY(tinyxml libs/tinyxml/tinystr.cpp libs/tinyxml/tinyxml.cpp libs/tinyxml/tinyxmlerror.cpp libs/tinyxml/tinyxmlparser.cpp) - + INCLUDE_DIRECTORIES(libs/sqlite3) ENDIF(SQLITE3_LIBRARY) IF(TINYXML_LIBRARY) @@ -86,10 +120,27 @@ ELSE(TINYXML_LIBRARY) MESSAGE(STATUS "Could not find system TinyXML library. Will compile from included source.") ADD_LIBRARY(tinyxml libs/tinyxml/tinystr.cpp libs/tinyxml/tinyxml.cpp libs/tinyxml/tinyxmlerror.cpp libs/tinyxml/tinyxmlparser.cpp) TARGET_LINK_LIBRARIES(fms tinyxml) + INCLUDE_DIRECTORIES(libs/tinyxml) ENDIF(TINYXML_LIBRARY) -IF(ZTHREADS_LIBRARY) - TARGET_LINK_LIBRARIES(fms ${ZTHREADS_LIBRARY}) -ELSE(ZTHREADS_LIBRARY) - MESSAGE(FATAL_ERROR "Could not find ZThreads library. You must set the location manually.") -ENDIF(ZTHREADS_LIBRARY) +IF(PTHREADS_LIBRARY) + TARGET_LINK_LIBRARIES(fms ${PTHREADS_LIBRARY}) +ELSE(PTHREADS_LIBRARY) + MESSAGE(FATAL ERROR "Could not find pthreads library. You must set the location manually.") +ENDIF(PTHREADS_LIBRARY) + +IF(SHTTPD_LIBRARY) + TARGET_LINK_LIBRARIES(fms ${SHTTPD_LIBRARY}) +ELSE(SHTTPD_LIBRARY) + MESSAGE(STATUS "Could not find shttpd library. Will compile from included source.") + ADD_DEFINITIONS(-DEMBEDDED) + INCLUDE_DIRECTORIES(libs/shttpd/include) + IF(WIN32) + ADD_DEFINITIONS(-DNO_GUI) + SET(SHTTPD_PLATFORM_SRC libs/shttpd/compat_win32.c) + 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) + TARGET_LINK_LIBRARIES(fms shttpd) +ENDIF(SHTTPD_LIBRARY)