File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,26 @@ option(NBYTES_DEVELOPMENT_CHECKS "Enable development checks" OFF)
1212
1313include (GNUInstallDirs )
1414include (FetchContent )
15+ include (CTest )
16+
17+ option (NBYTES_ENABLE_TESTING "Enable testing" ${BUILD_TESTING} )
1518
16- FetchContent_Declare (
17- googletest
18- URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
19- )
20- # For Windows: Prevent overriding the parent project's compiler/linker settings
21- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
22- FetchContent_MakeAvailable (googletest)
2319
2420add_subdirectory (src )
25- enable_testing ()
26- add_subdirectory (tests )
21+
22+ if (NBYTES_ENABLE_TESTING)
23+ FetchContent_Declare (
24+ googletest
25+ URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
26+ URL_HASH SHA256=edd885a1ab32b6999515a880f669efadb80b3f880215f315985fa3f6eca7c4d3
27+ FIND_PACKAGE_ARGS NAMES GTest
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+
33+ add_subdirectory (tests )
34+ endif ()
2735
2836install (
2937 FILES include/nbytes.h
You can’t perform that action at this time.
0 commit comments