File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,16 @@ if(BUILD_EXAMPLES)
14
14
endif ()
15
15
16
16
option (BUILD_TESTS "Build tests" ON )
17
+ set (GOOGLE_TEST_DIR "" CACHE PATH "Path to GoogleTest source" )
18
+
17
19
if (BUILD_TESTS)
18
- set (GOOGLE_TEST_DIR "" CACHE PATH "Path to GoogleTest source" )
20
+ enable_testing ()
21
+
22
+ if (GOOGLE_TEST_DIR)
23
+ add_subdirectory (${GOOGLE_TEST_DIR} googletest)
24
+ else ()
25
+ find_package (GTest REQUIRED)
26
+ endif ()
27
+
19
28
add_subdirectory (test )
20
29
endif ()
Original file line number Diff line number Diff line change 1
1
# test
2
2
3
- enable_testing ()
4
-
5
- if (GOOGLE_TEST_DIR)
6
- add_subdirectory (${GOOGLE_TEST_DIR} googletest)
7
- else ()
8
- find_package (GTest REQUIRED)
9
- endif ()
10
-
11
3
add_executable (test_args test_args.cpp)
12
4
target_link_libraries (test_args pgm::args GTest::gtest_main)
13
5
You can’t perform that action at this time.
0 commit comments