26 lines
582 B
CMake

project(economy_tests)
# List sources
set(SOURCES "test_conf.hpp" "main.cpp"
"systems/enterprise_routine.cpp" "systems/mining.cpp" "systems/delivering.cpp")
# Find dependencies
find_package(GTest CONFIG REQUIRED)
# Link
include(GoogleTest)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest_main)
target_link_libraries(${PROJECT_NAME} PRIVATE Economy::Economy)
# Test
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
endif()
gtest_discover_tests(${PROJECT_NAME})