Skip to content

Commit

Permalink
updating test of jcm_collect_subdirectory_targets to consider conditi…
Browse files Browse the repository at this point in the history
…onally enabled targets
  • Loading branch information
justend29 committed Mar 9, 2024
1 parent 595c831 commit 8ea3ea3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/libsingle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ jcm_install_config_file_package(
CONFIGURE_PACKAGE_CONFIG_FILES
TARGETS libsingle::libsingle)

# Testing jcm_collect_subdirectory_targets:
jcm_collect_subdirectory_targets(OUT_VAR targets)
set(expected_targets "libsingle_libsingle;clang-format;clang-format-check")
set(expected_targets "libsingle_libsingle" "clang-format" "clang-format-check")
if(LIBSINGLE_BUILD_DOCS)
list(APPEND expected_targets "doxygen-docs")
endif()
if(LIBSINGLE_BUILD_TESTS)
list(APPEND expected_targets "libsingle-integration-test" "widget-unit-test")
endif()
if(NOT targets STREQUAL expected_targets)
message(FATAL_ERROR "jcm_collect_subdirectory_targets failed. \n"
"Found targets:\n\t'${targets}'.\n\n Expected targets:\n\t'${targets}'")
"Found targets:\n\t'${targets}'.\n\n Expected targets:\n\t'${expected_targets}'")
endif()

0 comments on commit 8ea3ea3

Please sign in to comment.