X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=CMakeLists.txt;h=3758251a06ecf0fcf87cb713a467d418c754246f;hb=0574a75431d98ed64c5cc6291600bb3759b399a6;hp=c81d5cb59725b7109a2740d301d59c79ec92a30f;hpb=8a0a83a78390f22f99d4487cda2569909dfbc28e;p=fms.git diff --git a/CMakeLists.txt b/CMakeLists.txt index c81d5cb..3758251 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ PROJECT(fms) -OPTION(USE_BUNDLED_SQLITE "Use the bundled SQLite3 library" OFF) +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 @@ -10,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 @@ -84,6 +86,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) @@ -132,6 +138,7 @@ 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 shttpd_s) +FIND_LIBRARY(ICONV_LIBRARY NAMES iconv iconv_s libiconv libiconv_s) IF(SQLITE3_LIBRARY) TARGET_LINK_LIBRARIES(fms ${SQLITE3_LIBRARY}) @@ -174,3 +181,14 @@ ELSE(SHTTPD_LIBRARY) 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)