X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=CMakeLists.txt;h=7cf50e071ba3437c4135f2dc168f19b543c44b43;hb=dabd19d7f764b8275c9c8370c7b89675b6a78243;hp=03af9bdb9b14f5371d29f7bba8bfdd0d797732a9;hpb=76805933f794915a72b7f0a21b12af6654759f4f;p=fms.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 03af9bd..7cf50e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,9 @@ IF(APPLE) ENDIF(APPLE) OPTION(DO_CHARSET_CONVERSION "Do charset conversion on sent messages to UTF-8. This requires libiconv." ON) OPTION(I_HAVE_READ_THE_README "I have fully read and understood the readme.txt." OFF) +OPTION(ALTERNATE_CAPTCHA "Use alternate captcha. This requires the FreeImage library." OFF) -SET(FMS_SRC +SET(FMS_SRC src/base64.cpp src/bitmapvalidator.cpp src/board.cpp @@ -95,7 +96,9 @@ src/http/pages/optionspage.cpp src/http/pages/peerdetailspage.cpp src/http/pages/peermaintenancepage.cpp src/http/pages/peertrustpage.cpp +src/http/pages/recentlyaddedpage.cpp src/http/pages/showcaptchapage.cpp +src/http/pages/versioninfopage.cpp src/nntp/extensiontrust.cpp src/nntp/mime src/nntp/nntpconnection.cpp @@ -114,6 +117,17 @@ IF(DO_CHARSET_CONVERSION) SET(FMS_SRC ${FMS_SRC} src/charsetconverter.cpp) ENDIF(DO_CHARSET_CONVERSION) +IF(ALTERNATE_CAPTCHA) + SET(FMS_SRC ${FMS_SRC} + src/freenet/captcha/alternatecaptcha1.cpp + src/freenet/captcha/alternatecaptcha2.cpp + src/freenet/captcha/alternatecaptchafonts.cpp + src/freenet/captcha/freeimage/bitmap.cpp + src/freenet/captcha/freeimage/font.cpp) +ELSE(ALTERNATE_CAPTCHA) + MESSAGE(STATUS "You are using the old captcha generator. Add a -D ALTERNATE_CAPTCHA=ON to the command line to use the alternate captcha generator.") +ENDIF(ALTERNATE_CAPTCHA) + IF(NOT I_HAVE_READ_THE_README) MESSAGE(FATAL_ERROR "You must fully read the readme.txt before continuing.") ENDIF(NOT I_HAVE_READ_THE_README) @@ -156,9 +170,16 @@ FIND_LIBRARY(POCO_UTIL_LIBRARY NAMES PocoUtil PocoUtilmt) FIND_LIBRARY(POCO_XML_LIBRARY NAMES PocoXML PocoXMLmt) FIND_LIBRARY(PTHREADS_LIBRARY NAMES pthread pthreads pthreadvc2) FIND_LIBRARY(ICONV_LIBRARY NAMES iconv iconv_s libiconv libiconv_s) +IF(ALTERNATE_CAPTCHA) + FIND_FILE(FREEIMAGE_LIBRARY NAMES libfreeimage.a PATHS /usr/lib/) + IF(NOT FREEIMAGE_LIBRARY) + FIND_LIBRARY(FREEIMAGE_LIBRARY NAMES FreeImage libFreeImage libfreeimage freeimage) + ENDIF(NOT FREEIMAGE_LIBRARY) +ENDIF(ALTERNATE_CAPTCHA) IF(POCO_FOUNDATION_LIBRARY) TARGET_LINK_LIBRARIES(fms ${POCO_FOUNDATION_LIBRARY}) + ADD_DEFINITIONS(-DPOCO_HAVE_IPv6) IF(WIN32) ADD_DEFINITIONS(-DPOCO_STATIC) ENDIF(WIN32) @@ -210,3 +231,17 @@ IF(DO_CHARSET_CONVERSION) ENDIF(WIN32) ENDIF(ICONV_LIBRARY) ENDIF(DO_CHARSET_CONVERSION) + +IF(ALTERNATE_CAPTCHA) + IF(FREEIMAGE_LIBRARY) + TARGET_LINK_LIBRARIES(fms ${FREEIMAGE_LIBRARY}) + ADD_DEFINITIONS("-DALTERNATE_CAPTCHA") + ELSE(FREEIMAGE_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find the FreeImage library. Set the location manually, or turn off the alternate captchas.") + ENDIF(FREEIMAGE_LIBRARY) +ENDIF(ALTERNATE_CAPTCHA) + +# FreeBSD won't find Poco include files without this +IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + INCLUDE_DIRECTORIES(AFTER /usr/local/include) +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")