diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index 48bdf9da27..ea99d64876 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -614,16 +614,6 @@ if (WIN32) "${DEPLOY_DIR}/discord_partner_sdk.dll" ) - # Copy 3rd party DLLs if missing/different - file(GLOB THIRD_PARTY_DLLS "${REPO_ROOT_DIR}/3rdPartyBinaries/*.dll") - foreach(DLL IN LISTS THIRD_PARTY_DLLS) - get_filename_component(DLL_NAME "${DLL}" NAME) - add_custom_command( - TARGET SerialPrograms POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DLL}" "${DEPLOY_DIR}/${DLL_NAME}" - ) - endforeach() - # Move built .exe and .pdb to deploy folder, print if pdb is missing add_custom_command( TARGET SerialPrograms POST_BUILD @@ -659,6 +649,16 @@ if (WIN32) ) endif() + # Copy 3rd party DLLs if missing/different + file(GLOB THIRD_PARTY_DLLS "${REPO_ROOT_DIR}/3rdPartyBinaries/*.dll") + foreach(DLL IN LISTS THIRD_PARTY_DLLS) + get_filename_component(DLL_NAME "${DLL}" NAME) + add_custom_command( + TARGET SerialPrograms POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DLL}" "${DEPLOY_DIR}/${DLL_NAME}" + ) + endforeach() + # Final target that depends on all deployment steps add_custom_target(DeployRuntime ALL DEPENDS SerialPrograms clone_packages run_windeployqt