From 0f3da1ccc72ccc1189b1c02048ff822d7a490d6b Mon Sep 17 00:00:00 2001 From: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> Date: Mon, 6 Jul 2020 18:53:30 +0200 Subject: [PATCH] [Fix] Correct path for each build configuration Used the cmake generator expression to determine the full path to the target file. Link: https://cmake.org/cmake/help/v3.0/manual/cmake-generator-expressions.7.html#informational-expressions --- cmake/Dependencies.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index f30a31ba..b3327f47 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -173,10 +173,8 @@ macro(DeployUnix TARGET) endmacro() macro(DeployWindows TARGET) - # TODO Find out what build type it is - set(TARGET_FILE ${CMAKE_BINARY_DIR}/bin/Release/${TARGET}.exe) - if(EXISTS ${TARGET_FILE}) + message(STATUS "Collecting Dependencies for target file: ${TARGET_FILE}") find_package(Qt5Core REQUIRED) # Find the windeployqt binaries @@ -277,7 +275,7 @@ macro(DeployWindows TARGET) # Run CMake after target was built add_custom_command( TARGET ${TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} + COMMAND "${CMAKE_COMMAND}" "-DTARGET_FILE=$" ARGS ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} VERBATIM