From f2c25c0c9a31b36d49a497bc2bbeea5085ff5c8c Mon Sep 17 00:00:00 2001 From: Aous Naman Date: Fri, 24 Nov 2023 12:49:26 +1100 Subject: [PATCH] Test can run in Debug build on windows. --- tests/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index abcc7ed..b597c26 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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()