Fix ctest

This commit is contained in:
Stepanov Igor 2024-12-22 01:00:23 +03:00
parent 885438999d
commit 2229cd538c

View File

@ -15,16 +15,15 @@ target_link_libraries(
GTest::gtest_main GTest::gtest_main
) )
# HACK: copy res to test/ folder for fixing # HACK: copy res to test/ folder for fixing problem compatibility MultiConfig and non
# problem compatibility MultiConfig and non # MultiConfig builds. Delete in future and use only root res folder
# MultiConfig builds. Delete in future and # Also this resolve problem with ctests, because it set cwd to CMAKE_CURRENT_BINARY_DIR
# use only root res folder
add_custom_command( add_custom_command(
TARGET ${PROJECT_NAME} TARGET ${PROJECT_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different
${CMAKE_SOURCE_DIR}/res ${CMAKE_SOURCE_DIR}/res
$<TARGET_FILE_DIR:${PROJECT_NAME}>/res ${CMAKE_CURRENT_BINARY_DIR}/res
) )
include(GoogleTest) include(GoogleTest)