diff --git a/CMakeLists.txt b/CMakeLists.txt index 878b83b..c9364fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,34 +5,34 @@ project(leetcode) set(CMAKE_CXX_STANDARD 11) include(FetchContent) -FetchContent_Declare( +fetchcontent_declare( googletest - URL https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip + URL https://archive.fastgit.org/google/googletest/archive/refs/tags/release-1.11.0.zip ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest) +fetchcontent_makeavailable(googletest) enable_testing() -FILE(GLOB Sources src/*.cpp) -FILE(GLOB Tests tests/*.cpp) +file(GLOB Sources src/*.cpp) +file(GLOB Tests tests/*.cpp) add_executable( - leetcode + leetcode_tests ${Sources} ${Tests} ) target_link_libraries( - leetcode + leetcode_tests gtest_main ) include(GoogleTest) -gtest_discover_tests(leetcode) +gtest_discover_tests(leetcode_tests) -target_include_directories(leetcode +target_include_directories( + leetcode_tests PRIVATE - include + include ) -