From 6738e2ca27098d59daa4da130eb8eeabdcab661a Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Fri, 25 Oct 2024 11:52:59 -0400 Subject: [PATCH] Allow CMake build to skip test progs --- prog/CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/prog/CMakeLists.txt b/prog/CMakeLists.txt index 73fd28b59..37e71494a 100644 --- a/prog/CMakeLists.txt +++ b/prog/CMakeLists.txt @@ -1,10 +1,21 @@ set(math_progs "dna_reg|extrema_reg|insert_reg|locminmax_reg|numa1_reg|otsutest1|plottest|pta_reg|rotatefastalt|watershed_reg") +set (INSTALL_PROGS + convertfilestopdf convertfilestops + convertformat convertsegfilestopdf convertsegfilestops + converttopdf converttops fileinfo imagetops xtractprotos +) + +option(BUILD_TESTING "Build test programs" ON) + ######################################## # FUNCTION add_prog_target ######################################## function(add_prog_target target) + if(NOT BUILD_TESTING AND NOT target IN_LIST INSTALL_PROGS) + return() + endif() set (${target}_src "${ARGN}") add_executable (${target} ${${target}_src}) string(FIND ${target} "gif" GIF_TEST_FOUND) @@ -327,12 +338,6 @@ add_prog_target(writemtiff writemtiff.c) add_prog_target(xtractprotos xtractprotos.c) add_prog_target(yuvtest yuvtest.c) -set (INSTALL_PROGS - convertfilestopdf convertfilestops - convertformat convertsegfilestopdf convertsegfilestops - converttopdf converttops fileinfo imagetops xtractprotos -) - foreach(make_install ${INSTALL_PROGS}) install(TARGETS ${make_install} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) endforeach()