version 0.1.10
[fms.git] / CMakeLists.txt
index be285e2..024be6a 100644 (file)
@@ -15,6 +15,7 @@ src/messagelist.cpp
 src/option.cpp\r
 src/socketdefines.cpp\r
 src/stringfunctions.cpp\r
+src/threadcontroller.cpp\r
 src/uuidgenerator.cpp\r
 src/db/sqlite3db.cpp\r
 src/db/sqlite3recordset.cpp\r
@@ -29,7 +30,6 @@ src/freenet/identityintroductionxml.cpp
 src/freenet/identityrequester.cpp\r
 src/freenet/identityxml.cpp\r
 src/freenet/introductionpuzzleinserter.cpp\r
-src/freenet/introductionpuzzleremover.cpp\r
 src/freenet/introductionpuzzlerequester.cpp\r
 src/freenet/introductionpuzzlexml.cpp\r
 src/freenet/messageinserter.cpp\r
@@ -38,6 +38,7 @@ src/freenet/messagelistrequester.cpp
 src/freenet/messagelistxml.cpp\r
 src/freenet/messagerequester.cpp\r
 src/freenet/messagexml.cpp\r
+src/freenet/periodicdbmaintenance.cpp\r
 src/freenet/trustlistinserter.cpp\r
 src/freenet/trustlistrequester.cpp\r
 src/freenet/trustlistxml.cpp\r
@@ -46,6 +47,19 @@ src/freenet/captcha/simplecaptcha.cpp
 src/freenet/captcha/easybmp/EasyBMP.cpp\r
 src/freenet/captcha/easybmp/EasyBMP_Font.cpp\r
 src/freenet/captcha/easybmp/EasyBMP_Geometry.cpp\r
+src/http/httpthread.cpp\r
+src/http/identityexportxml.cpp\r
+src/http/ipagehandler.cpp\r
+src/http/pages/addpeerpage.cpp\r
+src/http/pages/announceidentitypage.cpp\r
+src/http/pages/controlboardpage.cpp\r
+src/http/pages/createidentitypage.cpp\r
+src/http/pages/homepage.cpp\r
+src/http/pages/localidentitiespage.cpp\r
+src/http/pages/optionspage.cpp\r
+src/http/pages/peerdetailspage.cpp\r
+src/http/pages/peertrustpage.cpp\r
+src/http/pages/showcaptchapage.cpp\r
 src/nntp/nntpconnection.cpp\r
 src/nntp/nntplistener.cpp\r
 src/nntp/uwildmat.cpp\r
@@ -53,18 +67,34 @@ src/nntp/mime/Mime.cpp
 src/nntp/mime/MimeChar.cpp\r
 src/nntp/mime/MimeCode.cpp\r
 src/nntp/mime/MimeType.cpp\r
+src/pthreadwrapper/guard.cpp\r
+src/pthreadwrapper/mutex.cpp\r
+src/pthreadwrapper/runnable.cpp\r
+src/pthreadwrapper/thread.cpp\r
+src/pthreadwrapper/threadedexecutor.cpp\r
 src/xyssl/sha1.c\r
 )\r
 \r
+IF(WIN32)\r
+       SET(FMS_PLATFORM_SRC src/fmsservice.cpp)\r
+ELSE(WIN32)\r
+       SET(FMS_PLATFORM_SRC src/fmsdaemon.cpp)\r
+ENDIF(WIN32)\r
+\r
 ADD_DEFINITIONS(-DTIXML_USE_STL)\r
 \r
-IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)\r
-       ADD_DEFINITIONS(-fpermissive)\r
-ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)\r
+# was for ZThreads\r
+#IF(CMAKE_COMPILER_IS_GNUCXX)\r
+#      #ADD_DEFINITIONS(-fpermissive)\r
+#      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")\r
+#ENDIF(CMAKE_COMPILER_IS_GNUCXX)\r
 \r
-ADD_EXECUTABLE(fms ${FMS_SRC})\r
+ADD_EXECUTABLE(fms ${FMS_SRC} ${FMS_PLATFORM_SRC})\r
 \r
-INCLUDE_DIRECTORIES(libs/sqlite3 libs/tinyxml)\r
+# For SQLite3 and shttpd\r
+IF(CMAKE_COMPILER_IS_GNUCC)\r
+       TARGET_LINK_LIBRARIES(fms dl)\r
+ENDIF(CMAKE_COMPILER_IS_GNUCC)\r
 \r
 IF(WIN32)\r
        TARGET_LINK_LIBRARIES(fms ws2_32)\r
@@ -72,7 +102,8 @@ ENDIF(WIN32)
 \r
 FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3_s)\r
 FIND_LIBRARY(TINYXML_LIBRARY NAMES tinyxml tinyxml_s)\r
-FIND_LIBRARY(ZTHREADS_LIBRARY NAMES zthread ZThread zthread_s)\r
+FIND_LIBRARY(PTHREADS_LIBRARY NAMES pthread pthreads pthreadvc2)\r
+FIND_LIBRARY(SHTTPD_LIBRARY NAMES shttpd)\r
 \r
 IF(SQLITE3_LIBRARY)\r
        TARGET_LINK_LIBRARIES(fms ${SQLITE3_LIBRARY})\r
@@ -80,8 +111,7 @@ ELSE(SQLITE3_LIBRARY)
        MESSAGE(STATUS "Could not find system SQLite library.  Will compile from included source.")\r
        ADD_LIBRARY(sqlite3 libs/sqlite3/sqlite3.c)\r
        TARGET_LINK_LIBRARIES(fms sqlite3)\r
-ADD_LIBRARY(tinyxml libs/tinyxml/tinystr.cpp libs/tinyxml/tinyxml.cpp libs/tinyxml/tinyxmlerror.cpp libs/tinyxml/tinyxmlparser.cpp)\r
-\r
+       INCLUDE_DIRECTORIES(libs/sqlite3)\r
 ENDIF(SQLITE3_LIBRARY)\r
 \r
 IF(TINYXML_LIBRARY)\r
@@ -90,10 +120,27 @@ ELSE(TINYXML_LIBRARY)
        MESSAGE(STATUS "Could not find system TinyXML library.  Will compile from included source.")\r
        ADD_LIBRARY(tinyxml libs/tinyxml/tinystr.cpp libs/tinyxml/tinyxml.cpp libs/tinyxml/tinyxmlerror.cpp libs/tinyxml/tinyxmlparser.cpp)\r
        TARGET_LINK_LIBRARIES(fms tinyxml)\r
+       INCLUDE_DIRECTORIES(libs/tinyxml)\r
 ENDIF(TINYXML_LIBRARY)\r
 \r
-IF(ZTHREADS_LIBRARY)\r
-       TARGET_LINK_LIBRARIES(fms ${ZTHREADS_LIBRARY})\r
-ELSE(ZTHREADS_LIBRARY)\r
-       MESSAGE(FATAL_ERROR "Could not find ZThreads library.  You must set the location manually.")\r
-ENDIF(ZTHREADS_LIBRARY)\r
+IF(PTHREADS_LIBRARY)\r
+       TARGET_LINK_LIBRARIES(fms ${PTHREADS_LIBRARY})\r
+ELSE(PTHREADS_LIBRARY)\r
+       MESSAGE(FATAL ERROR "Could not find pthreads library.  You must set the location manually.")\r
+ENDIF(PTHREADS_LIBRARY)\r
+\r
+IF(SHTTPD_LIBRARY)\r
+       TARGET_LINK_LIBRARIES(fms ${SHTTPD_LIBRARY})\r
+ELSE(SHTTPD_LIBRARY)\r
+       MESSAGE(STATUS "Could not find shttpd library.  Will compile from included source.")\r
+       ADD_DEFINITIONS(-DEMBEDDED)\r
+       INCLUDE_DIRECTORIES(libs/shttpd/include)\r
+       IF(WIN32)\r
+               ADD_DEFINITIONS(-DNO_GUI)\r
+               SET(SHTTPD_PLATFORM_SRC libs/shttpd/compat_win32.c)\r
+       ELSE(WIN32)\r
+               SET(SHTTPD_PLATFORM_SRC libs/shttpd/compat_unix.c)\r
+       ENDIF(WIN32)\r
+       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)\r
+       TARGET_LINK_LIBRARIES(fms shttpd)\r
+ENDIF(SHTTPD_LIBRARY)\r