diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 1d1681f5dd977cf94225058762c219441b7667fc..4959aa704149e392dcaaa2c39b827e9c701e442f 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -248,11 +248,24 @@ if(WIN32) install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll DESTINATION ${destination_lib} COMPONENT Libraries) + set(Cerf_LIB ${Cerf_LIBRARIES}) # we take for granted that there is only one cerf.lib + get_filename_component(DIR ${Cerf_LIB} DIRECTORY) + get_filename_component(cerf ${Cerf_LIB} NAME_WE) + + set(DLL_MSG "") + foreach(LIB IN ITEMS ${cerf} libgcc_s_seh-1 libstdc++-6 libwinpthread-1) + set(DLL "${DIR}/${LIB}.dll") + if (NOT EXISTS ${DLL}) + message(FATAL_ERROR "Dynamic load library ${DLL} (needed for cerf) does not exist") + endif() + install(FILES ${DLL} DESTINATION ${destination_lib} COMPONENT Libraries) + string(APPEND DLL_MSG " ${DLL}") + endforeach() + message(STATUS "Cerf dlls: ${DLL_MSG}") + set(DLL_MSG "") - foreach(LIB IN LISTS FFTW3_LIBRARIES TIFF_LIBRARIES Cerf_LIBRARIES) - # From LIB, which has the form X.lib or X.dll.a, we now derive the DLL path X.dll. + foreach(LIB IN LISTS FFTW3_LIBRARIES TIFF_LIBRARIES) string(REPLACE ".lib" ".dll" DLL "${LIB}") - string(REPLACE ".dll.a" ".dll" DLL "${DLL}") if (NOT EXISTS ${DLL}) message(FATAL_ERROR "Dynamic load library ${DLL} (derived from ${LIB}) does not exist") endif()