Skip to content

Commit

Permalink
tools: hide some debugging tools behind the config option BUILD_DEVTOOLS
Browse files Browse the repository at this point in the history
Also do not install them. If one really needs them they can still be copied by
hand.
  • Loading branch information
DerDakon committed Sep 30, 2023
1 parent fbd422a commit 29b5e57
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions ctest_qsmtp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
51 changes: 27 additions & 24 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,37 @@ 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
qsmtp_lib
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)

Expand All @@ -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
Expand Down

0 comments on commit 29b5e57

Please sign in to comment.