Skip to content

Commit

Permalink
Fixup copy DLLS
Browse files Browse the repository at this point in the history
  • Loading branch information
marcothaller committed Nov 10, 2024
1 parent 033c39c commit 342e975
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,14 @@ if (WIN32)
$<TARGET_RUNTIME_DLLS:${TARGET_NAME}>
$<TARGET_FILE_DIR:${TARGET_NAME}> COMMAND_EXPAND_LISTS
)
# Deployment: On Windows, copy the mosquitto DLLs next to the application binary so that they're found.
# TODO -> this can probably be dropped in case we add all mosquitto dlls to TARGET_RUNTIME_DLLS
if (BUILD_INTEGRATION_MQTT)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"C:/Program Files/mosquitto/mosquitto.dll"
$<TARGET_FILE_DIR:${TARGET_NAME}>)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"C:/Program Files/mosquitto/mosquittopp.dll"
$<TARGET_FILE_DIR:${TARGET_NAME}>)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"C:/Program Files/mosquitto/libcrypto-3-x64.dll"
$<TARGET_FILE_DIR:${TARGET_NAME}>)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"C:/Program Files/mosquitto/libssl-3-x64.dll"
$<TARGET_FILE_DIR:${TARGET_NAME}>)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"C:/Program Files/mosquitto/pthreadVC3.dll"
$<TARGET_FILE_DIR:${TARGET_NAME}>)
# Deployment: On Windows, copy all DLLs from the mosquitto install directory next to the application binary so that they're found.
if (BUILD_INTEGRATION_MQTT AND MOSQUITTO_RUNTIME_DLLS)
foreach(MOSQUITTO_RUNTIME_DLL ${MOSQUITTO_RUNTIME_DLLS})
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${MOSQUITTO_RUNTIME_DLL}"
$<TARGET_FILE_DIR:${TARGET_NAME}>
)
endforeach()
endif()
endif()

0 comments on commit 342e975

Please sign in to comment.