Skip configuration of tests unless `BUILD_TESTING` is set
See https://github.com/Martchus/tagparser/issues/26 and https://cmake.org/cmake/help/latest/module/CTest.html
This commit is contained in:
parent
c71f835ad0
commit
938da48da0
|
@ -8,6 +8,9 @@ if (TEST_CONFIG_DONE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(TestUtilities)
|
include(TestUtilities)
|
||||||
|
if(NOT BUILD_TESTING)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
# find and link against CppUnit if required (used by all my projects, so it is required by default)
|
# find and link against CppUnit if required (used by all my projects, so it is required by default)
|
||||||
if (NOT META_NO_CPP_UNIT)
|
if (NOT META_NO_CPP_UNIT)
|
||||||
|
|
|
@ -6,6 +6,9 @@ if (DEFINED TESTING_UTILITIES_LOADED)
|
||||||
endif ()
|
endif ()
|
||||||
set(TESTING_UTILITIES_LOADED YES)
|
set(TESTING_UTILITIES_LOADED YES)
|
||||||
|
|
||||||
|
# ensure CTest is loaded (e.g. for BUILD_TESTING variable)
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
set(EXCLUDE_TEST_TARGET_BY_DEFAULT ON)
|
set(EXCLUDE_TEST_TARGET_BY_DEFAULT ON)
|
||||||
if (ENABLE_DEVEL_DEFAULTS)
|
if (ENABLE_DEVEL_DEFAULTS)
|
||||||
set(EXCLUDE_TEST_TARGET_BY_DEFAULT OFF)
|
set(EXCLUDE_TEST_TARGET_BY_DEFAULT OFF)
|
||||||
|
|
Loading…
Reference in New Issue