24 lines
587 B
CMake
24 lines
587 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(sandbox LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
add_executable(sandbox main.cpp)
|
|
|
|
enable_testing()
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
googletest
|
|
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
|
|
)
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
add_executable(test_main tests/test_main.cpp)
|
|
target_link_libraries(test_main GTest::gtest_main)
|
|
|
|
include(GoogleTest)
|
|
gtest_discover_tests(test_main) |