CMakeLists.txt 1.34 KiB
cmake_minimum_required(VERSION 3.15)
# ------------------------------------------------------------------------------
# dependencies
# ------------------------------------------------------------------------------
find_package(GTest REQUIRED)
# ------------------------------------------------------------------------------
# build
# ------------------------------------------------------------------------------
OPTION(EVALHYD_TESTING_OS "OS system used to run tests")
if(CMAKE_HOST_APPLE)
    set(EVALHYD_TESTING_OS "MACOS")
elseif(CMAKE_HOST_WIN32)
    set(EVALHYD_TESTING_OS "WINDOWS")
elseif(CMAKE_HOST_UNIX)
    set(EVALHYD_TESTING_OS "LINUX")
else()
    message(SEND_ERROR "OS not supported to run tests")
endif()
add_executable(
        evalhyd_tests
        test_determinist.cpp
        test_probabilist.cpp
        test_uncertainty.cpp
set_target_properties(
        evalhyd_tests
        PROPERTIES
                VISIBILITY_INLINES_HIDDEN ON
target_include_directories(
        evalhyd_tests
        PRIVATE
                ${CMAKE_SOURCE_DIR}/include/evalhyd
target_compile_definitions(
        evalhyd_tests
        PRIVATE
                EVALHYD_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
target_link_libraries(
        evalhyd_tests
        PRIVATE
                EvalHyd::evalhyd
                GTest::GTest
                GTest::Main