Skip to content

Commit

Permalink
Test can run in Debug build on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Nov 24, 2023
1 parent 5aab43f commit f2c25c0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ include(GoogleTest)
gtest_add_tests(TARGET test_executables)

if (WIN32)
add_custom_command(TARGET test_executables POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "../bin/Release/gtest.dll" "./Release/"
COMMAND ${CMAKE_COMMAND} -E copy "../bin/Release/gtest_main.dll" "./Release/"
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_custom_command(TARGET test_executables POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "../bin/Debug/gtest.dll" "./Debug/"
COMMAND ${CMAKE_COMMAND} -E copy "../bin/Debug/gtest_main.dll" "./Debug/"
)
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET test_executables POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "../bin/Release/gtest.dll" "./Release/"
COMMAND ${CMAKE_COMMAND} -E copy "../bin/Release/gtest_main.dll" "./Release/"
)
endif()
endif()

0 comments on commit f2c25c0

Please sign in to comment.