42_cube3D/MLX42/tests/CMakeLists.txt

41 lines
1.1 KiB
CMake
Raw Permalink Normal View History

2023-04-26 07:39:03 -04:00
# -----------------------------------------------------------------------------
2023-04-26 08:03:40 -04:00
# Codam Coding College, Amsterdam @ 2022-2023 by W2Wizard.
2023-04-26 07:39:03 -04:00
# See README in the root project for more information.
# -----------------------------------------------------------------------------
set(TEST_EXECUTABLE_NAME unit_tests)
# Download GoogleTest
2023-04-26 08:03:40 -04:00
# --------------------------------------------------
2023-04-26 07:39:03 -04:00
include(GoogleTest)
include(FetchContent)
FetchContent_Declare(
googletest
DOWNLOAD_EXTRACT_TIMESTAMP
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG v1.13.0
)
FetchContent_MakeAvailable(googletest)
2023-04-26 08:03:40 -04:00
# --------------------------------------------------
2023-04-26 07:39:03 -04:00
add_executable(
${TEST_EXECUTABLE_NAME}
tests.cpp
)
target_link_libraries(
${TEST_EXECUTABLE_NAME}
GTest::gtest_main
mlx42
)
set_property(TARGET ${TEST_EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
# Add tests to CTest
# Set working directory to the the testing folder so that the test can find their test files
2023-04-26 08:03:40 -04:00
# --------------------------------------------------
2023-04-26 07:39:03 -04:00
gtest_discover_tests(${TEST_EXECUTABLE_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} TEST_PREFIX "MLX42.")
enable_testing()