cmake: Fix copy to rundir in Release and MinSizeRel configurations

Generated post build action batch scripts retained an empty token to
the copy command with the used generator expression (as PDBs are only
generated for Debug and RelWithDebInfo configurations).

Moving their copy step into its own command (and using the `true`
CMake command, which is a no-op) ensures that builds in Release and
MinSizeRel correctly finish this step.
This commit is contained in:
PatTheMav
2023-07-01 15:34:56 +02:00
committed by Patrick Heyer
parent 7773ea0180
commit 61bed7a828
+2 -1
View File
@@ -228,7 +228,8 @@ function(_target_install_obs target)
TARGET ${target}
POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_OUTPUT_DIR}/$<CONFIG>/${_TIO_DESTINATION}"
COMMAND "${CMAKE_COMMAND}" -E copy ${target_file} "$<$<CONFIG:Debug,RelWithDebInfo>:${target_pdb_file}>"
COMMAND "${CMAKE_COMMAND}" -E copy ${target_file} "${OBS_OUTPUT_DIR}/$<CONFIG>/${_TIO_DESTINATION}"
COMMAND "${CMAKE_COMMAND}" -E $<IF:$<CONFIG:Debug,RelWithDebInfo>,copy,true> ${target_pdb_file}
"${OBS_OUTPUT_DIR}/$<CONFIG>/${_TIO_DESTINATION}"
COMMENT "${comment}"
VERBATIM)