Skip to content

Commit

Permalink
Allow CMake build to skip test progs
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Oct 25, 2024
1 parent 96a3d74 commit 6738e2c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions prog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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()

0 comments on commit 6738e2c

Please sign in to comment.