fix: copy targets instead of renaming in-place

This was stopping Visual Studio from finding and launching the correct
file.
This commit is contained in:
Cat Flynn 2023-07-30 19:43:43 +02:00
parent 319f1c4224
commit 881677b300
1 changed files with 4 additions and 2 deletions

View File

@ -25,12 +25,14 @@ else()
# Rename the target to include the version string
execute_process(
COMMAND ${CMAKE_COMMAND} -E rename ${TARGET} "${VERSIONED_PATH}${TARGET_EXTENSION}"
COMMAND ${CMAKE_COMMAND} -E copy ${TARGET} "${VERSIONED_PATH}${TARGET_EXTENSION}"
)
# Rename program database file created by VS
if (EXISTS ${TARGET_PATH}.pdb)
file(RENAME "${TARGET_PATH}.pdb" "${VERSIONED_PATH}.pdb")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${TARGET_PATH}.pdb" "${VERSIONED_PATH}.pdb"
)
endif()
endif()