From fa720309d0aa407753d112d88240e57a3776c309 Mon Sep 17 00:00:00 2001 From: Lennart Ochel Date: Thu, 21 Nov 2024 21:03:55 +0100 Subject: [PATCH] fix linking libicuuc (#1359) (#1370) * copy the icu libraries only for mingw Co-authored-by: arun3688 --- 3rdParty | 2 +- src/OMSimulatorLib/CMakeLists.txt | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/3rdParty b/3rdParty index abfa73052..18bcec32f 160000 --- a/3rdParty +++ b/3rdParty @@ -1 +1 @@ -Subproject commit abfa73052d75c63489c6cdaad7a0c6581bfaaa22 +Subproject commit 18bcec32f95eda812a8102be9fd1bd20c967d335 diff --git a/src/OMSimulatorLib/CMakeLists.txt b/src/OMSimulatorLib/CMakeLists.txt index f6f716b43..7b0ee8932 100644 --- a/src/OMSimulatorLib/CMakeLists.txt +++ b/src/OMSimulatorLib/CMakeLists.txt @@ -134,7 +134,28 @@ if(MINGW) target_link_libraries(OMSimulatorLib_static PUBLIC shlwapi) endif() - +## copy dependent DLL's for mingw artifacts +if(ICU_FOUND) + message(STATUS "ICU_LIBRARIES_FOUND: ${ICU_LIBRARIES}") + if (MINGW) + list(GET ICU_LIBRARIES 0 ICU_PATH) + get_filename_component(DLL_DIR "${ICU_PATH}/../../bin" ABSOLUTE) + message(STATUS "DLL_DIR: ${DLL_DIR}") + # collect all DLLs matching the pattern + file(GLOB DLL_LIST + "${DLL_DIR}/libicuuc*.dll" + "${DLL_DIR}/libicudt*.dll" + "${DLL_DIR}/libstdc++*.dll") + # Check if the DLL_LIST is not empty before installing + if (DLL_LIST) + # Install the files from the list to the 'bin' directory + install(FILES ${DLL_LIST} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + message(STATUS "Copied files from: ${DLL_LIST} to ${CMAKE_INSTALL_PREFIX}/bin") + else() + message(WARNING "No DLLs found matching the pattern") + endif() + endif() +endif() install(TARGETS OMSimulatorLib) install(TARGETS OMSimulatorLib_static)