VoxelEngine/test/CMakeLists.txt
ShiftyX1 51ff1868ac
Some checks failed
Build and Release / prepare (push) Successful in 1s
Build and Release / build_linux (push) Successful in 10m25s
Build and Release / build_macos (push) Failing after 12s
Build and Release / build_windows (push) Failing after 12s
Build and Release / publish_release (push) Has been skipped
fix: replace copy_directory_if_different with copy_directory in test CMakeLists
2025-12-08 23:49:58 +03:00

23 lines
718 B
CMake

project(VoxelEngineTest)
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
find_package(GTest)
add_executable(VoxelEngineTest ${sources})
target_link_libraries(VoxelEngineTest PRIVATE VoxelEngineSrc GTest::gtest_main)
# HACK: copy res to test/ folder for fixing problem compatibility MultiConfig
# and non MultiConfig builds. Delete in future and use only root res folder Also
# this resolve problem with ctests, because it set cwd to
# ${CMAKE_CURRENT_BINARY_DIR}
add_custom_command(
TARGET VoxelEngineTest
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/res ${CMAKE_CURRENT_BINARY_DIR}/res)
include(GoogleTest)
gtest_discover_tests(VoxelEngineTest)