-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
45 lines (40 loc) · 1.7 KB
/
CMakeLists.txt
File metadata and controls
45 lines (40 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
find_package(GTest REQUIRED)
if(WIN32)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif(WIN32)
include_directories(${CMAKE_SOURCE_DIR}/src/include)
include_directories(${CMAKE_SOURCE_DIR}/src/tree)
macro(add_target_test target)
string(REPLACE ".cpp" "" target_name ${target})
string(REPLACE "_test.cpp" "" source_name ${target})
add_executable(${target_name} ${target} "${CMAKE_SOURCE_DIR}/src/tree/${source_name}.cpp")
target_link_libraries(${target_name} PRIVATE GTest::gtest_main ${ARGN})
if(MSVC)
### Edit and Continue for CMake projects
target_compile_options(${target_name} PUBLIC "/Zi")
target_link_options(${target_name} PUBLIC "/INCREMENTAL")
endif()
gtest_discover_tests(${target_name})
endmacro()
macro(add_target_header_test target)
string(REPLACE ".cpp" "" target_name ${target})
add_executable(${target_name} ${target})
target_link_libraries(${target_name} PRIVATE GTest::gtest_main ${ARGN})
if(MSVC)
### Edit and Continue for CMake projects
target_compile_options(${target_name} PUBLIC "/Zi")
target_link_options(${target_name} PUBLIC "/INCREMENTAL")
endif()
gtest_discover_tests(${target_name})
endmacro()
add_target_test(b_tree_test.cpp)
add_target_test(balanced_tree_status_test.cpp)
add_target_header_test(binary_search_tree_test.cpp)
add_target_test(binary_tree_exterior_test.cpp)
add_target_header_test(construct_binary_search_tree_test.cpp)
add_target_test(leaf_node_list_test.cpp)
add_target_test(lowest_common_ancestor_test.cpp)
# add_target_test(red_black_tree_test.cpp)
add_target_test(right_sibling_test.cpp)
add_target_test(sum_root_to_leaf_test.cpp)
add_target_test(tree_symmetric_test.cpp)