-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (34 loc) · 1.22 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.14)
project(leetcode)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(
solution_test
/Users/peter/Codes/leetcode/test/solution_test.cpp
# /Users/peter/Codes/leetcode/test/yanghui_test.cpp
# /Users/peter/Codes/leetcode/test/rob_test.cpp
# /Users/peter/Codes/leetcode/test/num_square_test.cpp
# /Users/peter/Codes/leetcode/test/length_of_LIS_test.cpp
/Users/peter/Codes/leetcode/test/max_product_test.cpp
/Users/peter/Codes/leetcode/src/solution.cpp
)
# Add the include path for the solution.h file
include_directories(/Users/peter/Codes/leetcode/include)
# Add the source file for the Solution class
# add_library(solution /Users/peter/Codes/leetcode/src/solution.cpp)
target_link_libraries(
solution_test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(solution_test)