Skip to content

Commit ae88148

Browse files
thewtexjcfr
andcommitted
BUG: Set BUILD_TESTING on CMake CACHE
Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
1 parent f9b1049 commit ae88148

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ if(POLICY CMP0077)
99
endif()
1010

1111
include(FetchContent)
12-
set(_itk_build_testing ${BUILD_TESTING})
12+
if(DEFINED BUILD_TESTING)
13+
set(_itk_build_testing ${BUILD_TESTING})
14+
else()
15+
set(_itk_build_testing OFF) # Default
16+
endif()
1317
if(WASI OR EMSCRIPTEN)
1418
# Cleaver lib vendored GTest incompatibility
1519
set(BUILD_TESTING OFF CACHE BOOL "Build testing code" FORCE)
@@ -38,7 +42,7 @@ if(NOT cleaver_lib_POPULATED)
3842
endif()
3943
# Debugging / development, symlink Cleaver2 into the source tree
4044
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Cleaver2/src)
41-
set(BUILD_TESTING ${_itk_build_testing})
45+
set(BUILD_TESTING ${_itk_build_testing} CACHE BOOL "Build testing code" FORCE)
4246
set(BUILD_SHARED_LIBS ${_itk_build_shared})
4347

4448
set(Cleaver_LIBRARIES cleaver jsoncpp)

0 commit comments

Comments
 (0)