X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=CMakeLists.txt;h=ebff7582aec94cd638c1741a90d8ecade4051785;hp=9c0e66a8b2d6a20c11e09b4235cf7945e858b474;hb=63376b2a82c3f6cdf2df56b1f134bd7df0aaab3a;hpb=4430e7762844c66428b6f822288beb71b7f82b95 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c0e66a..ebff758 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ PROJECT(fms) +OPTION(USE_BUNDLED_SQLITE "Use the bundled SQLite3 library." OFF) +OPTION(DO_CHARSET_CONVERSION "Do charset conversion on sent messages to UTF-8. This requires libiconv." OFF) + SET(FMS_SRC src/base64.cpp src/board.cpp @@ -8,6 +11,7 @@ src/commandthread.cpp src/datetime.cpp src/global.cpp src/hex.cpp +src/localidentity.cpp src/logfile.cpp src/main.cpp src/message.cpp @@ -24,6 +28,7 @@ src/freenet/boardlistinserter.cpp src/freenet/boardlistrequester.cpp src/freenet/boardlistxml.cpp src/freenet/fcpv2.cpp +src/freenet/fileinserter.cpp src/freenet/freenetmasterthread.cpp src/freenet/freenetssk.cpp src/freenet/identityinserter.cpp @@ -42,6 +47,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 @@ -60,6 +66,7 @@ src/http/pages/controlboardpage.cpp src/http/pages/createidentitypage.cpp src/http/pages/execquerypage.cpp src/http/pages/homepage.cpp +src/http/pages/insertedfilespage.cpp src/http/pages/localidentitiespage.cpp src/http/pages/optionspage.cpp src/http/pages/peerdetailspage.cpp @@ -81,6 +88,10 @@ src/pthreadwrapper/threadedexecutor.cpp src/xyssl/sha1.c ) +IF(DO_CHARSET_CONVERSION) + SET(FMS_SRC ${FMS_SRC} src/charsetconverter.cpp) +ENDIF(DO_CHARSET_CONVERSION) + IF(WIN32) SET(FMS_PLATFORM_SRC src/fmsservice.cpp) ELSE(WIN32) @@ -123,15 +134,20 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") 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) +FIND_LIBRARY(ICONV_LIBRARY NAMES iconv iconv_s libiconv libiconv_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) @@ -164,6 +180,17 @@ 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) + +IF(DO_CHARSET_CONVERSION) + ADD_DEFINITIONS(-DDO_CHARSET_CONVERSION) + IF(ICONV_LIBRARY) + TARGET_LINK_LIBRARIES(fms ${ICONV_LIBRARY}) + ELSE(ICONV_LIBRARY) + IF(WIN32) + MESSAGE(FATAL ERROR "Could not find iconv library. You must set the location manually, or turn off charset conversion.") + ENDIF(WIN32) + ENDIF(ICONV_LIBRARY) +ENDIF(DO_CHARSET_CONVERSION)