Commit 7637021b authored by Ben Boeckel's avatar Ben Boeckel

cmb: add an option to run CMB tests from the superbuild

This is done in the top-level because cmb.cmake does not have knowledge
of the cmb target (all the logic is done in the module system).
parent 9ca10bef
function (subdirs subdir)
if (implicit_root)
set(old_implicit_root "${implicit_root}")
set(implicit_root "${implicit_root}${subdir}/")
endif ()
_subdirs("${old_implicit_root}${subdir}")
endfunction ()
set(extra_ctest_dirs "@extra_ctest_dirs@")
foreach (extra_ctest_dir IN LISTS extra_ctest_dirs)
set(implicit_root "${extra_ctest_dir}/")
include("${extra_ctest_dir}/CTestTestfile.cmake")
endforeach ()
set(implicit_root)
......@@ -323,3 +323,30 @@ option(NIGHTLY_BINARY_TESTING "Run Nightly-Binary CMB Testing" OFF)
if (NIGHTLY_BINARY_TESTING)
add_subdirectory(tests)
endif()
set(extra_ctest_dirs)
option(CMB_RUN_TESTS "Run CMB tests from the superbuild" ON)
if (TARGET cmb AND CMB_RUN_TESTS)
set(cmb_binary_dir "<BINARY_DIR>")
_ep_replace_location_tags(cmb cmb_binary_dir)
list(APPEND extra_ctest_dirs "${cmb_binary_dir}")
endif ()
option(SMTK_RUN_TESTS "Run SMTK tests from the superbuild" ON)
if (TARGET smtk AND SMTK_RUN_TESTS)
set(smtk_binary_dir "<BINARY_DIR>")
_ep_replace_location_tags(smtk smtk_binary_dir)
list(APPEND extra_ctest_dirs "${smtk_binary_dir}")
endif ()
if (extra_ctest_dirs)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmb_testing_trampoline.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmb_testing_trampoline.cmake"
@ONLY)
set_property(
DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
PROPERTY
TEST_INCLUDE_FILE "${CMAKE_CURRENT_BINARY_DIR}/cmb_testing_trampoline.cmake")
endif ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment