monorepo/App/Tests/CMakeLists.txt

28 lines
526 B
CMake

cmake_minimum_required (VERSION 3.8)
enable_testing()
add_executable(
AppTest
MathTest.cpp
)
target_include_directories(App PUBLIC "${CMAKE_SOURCE_DIR}/AppLib/include/AppLib")
find_package(GTest CONFIG REQUIRED)
target_link_libraries(AppTest PRIVATE
GTest::gtest
GTest::gtest_main
GTest::gmock
GTest::gmock_main
AppLib
)
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET AppLib PROPERTY CXX_STANDARD 20)
endif()
include(GoogleTest)
gtest_discover_tests(AppTest)
add_test(MathTest AppTest)