diff --git a/CMakeLists.txt b/CMakeLists.txt index a976b54b..c6b16df5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,6 +258,9 @@ include_directories( add_subdirectory(lib) add_subdirectory(qsmtpd) add_subdirectory(qremote) + +option(BUILD_DEVTOOLS "Build also tools only useful for development" OFF) + add_subdirectory(tools) if (BUILD_TESTING) diff --git a/ctest_qsmtp.cmake b/ctest_qsmtp.cmake index ab003cd9..13c0ce89 100644 --- a/ctest_qsmtp.cmake +++ b/ctest_qsmtp.cmake @@ -142,6 +142,8 @@ list(APPEND CONF_OPTIONS "-DCMAKE_BUILD_TYPE=Debug") list(APPEND CONF_OPTIONS "-DAUTOQMAIL=${CTEST_BINARY_DIRECTORY}/var/qmail") # get more coverage: enable some optional features list(APPEND CONF_OPTIONS "-DCHUNKING=On" "-DAUTHCRAM=On") +# build all the tools +list(APPEND CONF_OPTIONS "-DBUILD_DEVTOOLS=On") ctest_configure( OPTIONS "${CONF_OPTIONS}" diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index e4841ac7..6e521f0b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -21,11 +21,13 @@ install(TARGETS COMPONENT tools ) -add_executable(testspf testspf.c ${CMAKE_SOURCE_DIR}/qsmtpd/spf.c ${CMAKE_SOURCE_DIR}/qsmtpd/antispam.c) -target_link_libraries(testspf - qsmtp_lib - qsmtp_io_lib -) +if (BUILD_DEVTOOLS) + add_executable(testspf testspf.c ${CMAKE_SOURCE_DIR}/qsmtpd/spf.c ${CMAKE_SOURCE_DIR}/qsmtpd/antispam.c) + target_link_libraries(testspf + qsmtp_lib + qsmtp_io_lib + ) +endif () add_executable(spfquery spfquery.c ${CMAKE_SOURCE_DIR}/qsmtpd/spf.c ${CMAKE_SOURCE_DIR}/qsmtpd/antispam.c) target_link_libraries(spfquery @@ -33,21 +35,23 @@ target_link_libraries(spfquery qsmtp_io_lib ) -add_executable(qpencode - qp.c - ${CMAKE_SOURCE_DIR}/qremote/mime.c - ${CMAKE_SOURCE_DIR}/qremote/qrdata.c -) -target_link_libraries(qpencode - qsmtp_lib - qsmtp_io_lib -) +if (BUILD_DEVTOOLS) + add_executable(qpencode + qp.c + ${CMAKE_SOURCE_DIR}/qremote/mime.c + ${CMAKE_SOURCE_DIR}/qremote/qrdata.c + ) + target_link_libraries(qpencode + qsmtp_lib + qsmtp_io_lib + ) -add_executable(clearpass clearpass.c) -target_link_libraries(clearpass - qsmtp_lib - qsmtp_io_lib -) + add_executable(clearpass clearpass.c) + target_link_libraries(clearpass + qsmtp_lib + qsmtp_io_lib + ) +endif () add_executable(addipbl addipbl.c) @@ -56,19 +60,18 @@ target_link_libraries(dumpipbl qsmtp_lib ) -add_executable(sendremote sendremote.c) +if (BUILD_DEVTOOLS) + add_executable(sendremote sendremote.c) +endif () include_directories( ${OWFAT_INCLUDE_DIRS} ) install(TARGETS - testspf - qpencode - clearpass addipbl dumpipbl - sendremote + spfquery # fcshell DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools