Skip to content

Commit

Permalink
Add CMake logic to copy DLL dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Oct 25, 2023
1 parent e29c83a commit f1341be
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ if (TACTILE_BUILD_TESTS MATCHES ON)

tactile_prepare_target(${TACTILE_CORE_TEST_TARGET})

tactile_set_output_dir(${TACTILE_CORE_TEST_TARGET} "${TACTILE_BUILD_DIR}/test")

target_link_libraries(${TACTILE_CORE_TEST_TARGET}
PRIVATE
${TACTILE_CORE_TARGET}
GTest::gtest
)

if (WIN32)
add_custom_command(TARGET ${TACTILE_CORE_TEST_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:${TACTILE_CORE_TEST_TARGET}> $<TARGET_FILE_DIR:${TACTILE_CORE_TEST_TARGET}>
COMMAND_EXPAND_LISTS
)
endif ()
endif ()
9 changes: 9 additions & 0 deletions modules/editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,18 @@ if (TACTILE_BUILD_TESTS MATCHES ON)

tactile_prepare_target(${TACTILE_EDITOR_TEST_TARGET})

tactile_set_output_dir(${TACTILE_EDITOR_TEST_TARGET} "${TACTILE_BUILD_DIR}/test")

target_link_libraries(${TACTILE_EDITOR_TEST_TARGET}
PRIVATE
${TACTILE_EDITOR_TARGET}
GTest::gtest
)

if (WIN32)
add_custom_command(TARGET ${TACTILE_EDITOR_TEST_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:${TACTILE_EDITOR_TEST_TARGET}> $<TARGET_FILE_DIR:${TACTILE_EDITOR_TEST_TARGET}>
COMMAND_EXPAND_LISTS
)
endif ()
endif ()
9 changes: 9 additions & 0 deletions modules/tmj-format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,18 @@ if (TACTILE_BUILD_TESTS MATCHES ON)

tactile_prepare_target(${TACTILE_TMJ_FORMAT_TEST_TARGET})

tactile_set_output_dir(${TACTILE_TMJ_FORMAT_TEST_TARGET} "${TACTILE_BUILD_DIR}/test")

target_link_libraries(${TACTILE_TMJ_FORMAT_TEST_TARGET}
PRIVATE
${TACTILE_TMJ_FORMAT_TARGET}
GTest::gtest
)

if (WIN32)
add_custom_command(TARGET ${TACTILE_TMJ_FORMAT_TEST_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:${TACTILE_TMJ_FORMAT_TEST_TARGET}> $<TARGET_FILE_DIR:${TACTILE_TMJ_FORMAT_TEST_TARGET}>
COMMAND_EXPAND_LISTS
)
endif ()
endif ()

0 comments on commit f1341be

Please sign in to comment.