File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ option(TESTDICOM2MESH "Test Dicom2Mesh" OFF)
2020IF (${TESTDICOM2MESH} )
2121 MESSAGE (STATUS "Test dicom2mesh activated" )
2222
23- # Download and build gtest
24- include (FetchContent )
25- FetchContent_Declare (
26- googletest
27- # Specify the commit you depend on and update it regularly.
28- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
29- )
30- # For Windows: Prevent overriding the parent project's compiler/linker settings
31- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
32- FetchContent_MakeAvailable (googletest )
23+ if ( NOT TARGET gtest_main)
24+ include (FetchContent )
25+ FetchContent_Declare (
26+ googletest
27+ URL https://github.com/google/googletest/archive/refs/tags/v1.17.0.zip
28+ )
29+ # For Windows: Prevent overriding the parent project's compiler/linker settings
30+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
31+ FetchContent_MakeAvailable (googletest )
32+ endif ( )
3333
3434 FILE (GLOB_RECURSE D2M_TESTS_INC test /*.h )
3535 FILE (GLOB_RECURSE D2M_TESTS_SRC test /*.cpp )
Original file line number Diff line number Diff line change @@ -62,16 +62,16 @@ option(TESTDICOM2MESHLIB "Test library" OFF)
6262IF (${TESTDICOM2MESHLIB} )
6363 MESSAGE (STATUS "Test library activated" )
6464
65- # Download and build gtest
66- include (FetchContent )
67- FetchContent_Declare (
68- googletest
69- # Specify the commit you depend on and update it regularly.
70- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
71- )
72- # For Windows: Prevent overriding the parent project's compiler/linker settings
73- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
74- FetchContent_MakeAvailable (googletest )
65+ if ( NOT TARGET gtest_main)
66+ include (FetchContent )
67+ FetchContent_Declare (
68+ googletest
69+ URL https://github.com/google/googletest/archive/refs/tags/v1.17.0.zip
70+ )
71+ # For Windows: Prevent overriding the parent project's compiler/linker settings
72+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
73+ FetchContent_MakeAvailable (googletest )
74+ endif ( )
7575
7676 FILE (GLOB_RECURSE D2M_LIB_TESTS_INC test /*.h )
7777 FILE (GLOB_RECURSE D2M_LIB_TESTS_SRC test /*.cpp )
@@ -81,4 +81,3 @@ IF(${TESTDICOM2MESHLIB})
8181 target_compile_features ( runLibTests PRIVATE cxx_std_17 )
8282 target_compile_options ( runLibTests PRIVATE -Wall -Wno-extra-semi )
8383ENDIF ()
84-
You can’t perform that action at this time.
0 commit comments