Skip to content

Commit

Permalink
fix linking libicuuc (#1359) (#1370)
Browse files Browse the repository at this point in the history
* copy the icu libraries only for mingw

Co-authored-by: arun3688 <rain100falls@gmail.com>
  • Loading branch information
lochel and arun3688 authored Nov 21, 2024
1 parent 74b2cae commit fa72030
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 3rdParty
23 changes: 22 additions & 1 deletion src/OMSimulatorLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit fa72030

Please sign in to comment.