@@ -60,9 +60,7 @@ set(OMSIMULATORLIB_SOURCES
6060 SystemSC.cpp
6161 SystemWC.cpp
6262 Values.cpp
63- Variable.cpp
64- whereami.c
65- XercesValidator.cpp)
63+ Variable.cpp)
6664
6765configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /Version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR} /Version.cpp" @ONLY )
6866list (APPEND OMSIMULATORLIB_SOURCES "${CMAKE_CURRENT_BINARY_DIR} /Version.cpp" )
@@ -84,7 +82,6 @@ target_link_libraries(OMSimulatorLib
8482 oms::3rd::lua
8583 oms::3rd::pugixml::header
8684 oms::3rd::json::header
87- oms::3rd::xerces
8885 oms::3rd::ctpl::header )
8986
9087target_link_libraries (OMSimulatorLib PUBLIC ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} )
@@ -116,7 +113,6 @@ target_link_libraries(OMSimulatorLib_static
116113 oms::3rd::lua
117114 oms::3rd::pugixml::header
118115 oms::3rd::json::header
119- oms::3rd::xerces
120116 oms::3rd::ctpl::header )
121117
122118target_link_libraries (OMSimulatorLib_static PUBLIC ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} )
@@ -126,27 +122,27 @@ if(MINGW)
126122endif ()
127123
128124## copy dependent DLL's for mingw artifacts
129- if (ICU_FOUND )
130- message ( STATUS "ICU_LIBRARIES_FOUND: ${ICU_LIBRARIES} " )
131- if (MINGW )
132- list ( GET ICU_LIBRARIES 0 ICU_PATH)
133- get_filename_component ( DLL_DIR " ${ICU_PATH} /../../bin" ABSOLUTE )
134- message ( STATUS "DLL_DIR: ${DLL_DIR } " )
135- # collect all DLLs matching the pattern
136- file ( GLOB DLL_LIST
137- " ${DLL_DIR} /libicuuc*.dll"
138- " ${DLL_DIR} /libicudt*.dll"
139- "${DLL_DIR } /libstdc++*.dll"
140- "${DLL_DIR } /libwinpthread*.dll"
141- "${DLL_DIR } /libgcc_*.dll" )
142- # Check if the DLL_LIST is not empty before installing
143- if ( DLL_LIST)
144- # Install the files from the list to the 'bin' directory
145- install ( FILES ${DLL_LIST} DESTINATION ${CMAKE_INSTALL_PREFIX} / bin)
146- message ( STATUS "Copied files from: ${DLL_LIST} to ${CMAKE_INSTALL_PREFIX} /bin" )
147- else ( )
148- message ( WARNING "No DLLs found matching the pattern" )
149- endif ( )
125+ if (MINGW )
126+ # Extract compiler path (g++ path )
127+ get_filename_component ( COMPILER_DIR " ${CMAKE_CXX_COMPILER} " DIRECTORY )
128+
129+ # MinGW DLLs are usually in the same directory
130+ set (MINGW_BIN_DIR " ${COMPILER_DIR } " )
131+
132+ message ( STATUS "Detected MinGW bin directory: ${MINGW_BIN_DIR} " )
133+
134+ file ( GLOB DLL_LIST
135+ "${MINGW_BIN_DIR } /libstdc++*.dll"
136+ "${MINGW_BIN_DIR } /libwinpthread*.dll"
137+ "${MINGW_BIN_DIR } /libgcc_*.dll"
138+ )
139+ # Check if the DLL_LIST is not empty before installing
140+ if (DLL_LIST)
141+ # Install the files from the list to the ' bin' directory
142+ install ( FILES ${DLL_LIST} DESTINATION ${CMAKE_INSTALL_PREFIX} /bin)
143+ message ( STATUS "Copied files from: ${DLL_LIST} to ${CMAKE_INSTALL_PREFIX} /bin" )
144+ else ( )
145+ message ( WARNING "No DLLs found matching the pattern" )
150146 endif ()
151147endif ()
152148
0 commit comments