Skip to content

Commit fa72030

Browse files
lochelarun3688
andauthored
fix linking libicuuc (#1359) (#1370)
* copy the icu libraries only for mingw Co-authored-by: arun3688 <rain100falls@gmail.com>
1 parent 74b2cae commit fa72030

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

3rdParty

src/OMSimulatorLib/CMakeLists.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,28 @@ if(MINGW)
134134
target_link_libraries(OMSimulatorLib_static PUBLIC shlwapi)
135135
endif()
136136

137-
137+
## copy dependent DLL's for mingw artifacts
138+
if(ICU_FOUND)
139+
message(STATUS "ICU_LIBRARIES_FOUND: ${ICU_LIBRARIES}")
140+
if (MINGW)
141+
list(GET ICU_LIBRARIES 0 ICU_PATH)
142+
get_filename_component(DLL_DIR "${ICU_PATH}/../../bin" ABSOLUTE)
143+
message(STATUS "DLL_DIR: ${DLL_DIR}")
144+
# collect all DLLs matching the pattern
145+
file(GLOB DLL_LIST
146+
"${DLL_DIR}/libicuuc*.dll"
147+
"${DLL_DIR}/libicudt*.dll"
148+
"${DLL_DIR}/libstdc++*.dll")
149+
# Check if the DLL_LIST is not empty before installing
150+
if (DLL_LIST)
151+
# Install the files from the list to the 'bin' directory
152+
install(FILES ${DLL_LIST} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
153+
message(STATUS "Copied files from: ${DLL_LIST} to ${CMAKE_INSTALL_PREFIX}/bin")
154+
else()
155+
message(WARNING "No DLLs found matching the pattern")
156+
endif()
157+
endif()
158+
endif()
138159

139160
install(TARGETS OMSimulatorLib)
140161
install(TARGETS OMSimulatorLib_static)

0 commit comments

Comments
 (0)