diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 7fe50862f6b75129576f58bb2bec1ab99596e36f..460c288b862e6726c8db39f2fa9a4b5c4903e877 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -219,50 +219,6 @@ if(WIN32) ${CMAKE_BINARY_DIR}/lib/${libprefix}${lib}${libsuffix} ) endif() - - # system libraries - foreach(Boost_lib ${Boost_LIBRARIES}) - get_filename_component(UTF_BASE_NAME ${Boost_lib} NAME_WE) - get_filename_component(UTF_PATH ${Boost_lib} PATH) - message(STATUS "Boost dll: ${UTF_PATH}/${UTF_BASE_NAME}.dll") - install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll - DESTINATION ${destination_lib} COMPONENT Libraries) - endforeach() - - set(win_python_lib - "${Python3_LIBRARY_DIRS}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.lib") - get_filename_component(UTF_BASE_NAME ${win_python_lib} NAME_WE) - get_filename_component(UTF_PATH ${Python3_EXECUTABLE} PATH) - message(STATUS "Python dll: ${UTF_PATH}/${UTF_BASE_NAME}.dll") - 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) - string(REPLACE ".lib" ".dll" DLL "${LIB}") - if (NOT EXISTS ${DLL}) - message(FATAL_ERROR "Dynamic load library ${DLL} (derived from ${LIB}) does not exist") - endif() - install(FILES ${DLL} DESTINATION ${destination_lib} COMPONENT Libraries) - string(APPEND DLL_MSG " ${DLL}") - endforeach() - message(STATUS "Other dlls: ${DLL_MSG}") - endif() # Install bornagain/__init__.py and utilites diff --git a/cmake/BornAgain/Dependences.cmake b/cmake/BornAgain/Dependences.cmake index 7c92a1b5edeb10125bddeb86d19db7f2980007d0..19b2f218783404f7f31119a4185a6d8d7110b5f0 100644 --- a/cmake/BornAgain/Dependences.cmake +++ b/cmake/BornAgain/Dependences.cmake @@ -106,3 +106,52 @@ if(CONFIGURE_MANPAGE) endif() message(STATUS "Found pod2man: ${POD2MAN}") endif() + + +# === install Windows DLLs === + +if(WIN32) + # system libraries + foreach(Boost_lib ${Boost_LIBRARIES}) + get_filename_component(UTF_BASE_NAME ${Boost_lib} NAME_WE) + get_filename_component(UTF_PATH ${Boost_lib} PATH) + message(STATUS "Boost dll: ${UTF_PATH}/${UTF_BASE_NAME}.dll") + install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll + DESTINATION ${destination_lib} COMPONENT Libraries) + endforeach() + + set(win_python_lib + "${Python3_LIBRARY_DIRS}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.lib") + get_filename_component(UTF_BASE_NAME ${win_python_lib} NAME_WE) + get_filename_component(UTF_PATH ${Python3_EXECUTABLE} PATH) + message(STATUS "Python dll: ${UTF_PATH}/${UTF_BASE_NAME}.dll") + 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) + string(REPLACE ".lib" ".dll" DLL "${LIB}") + if (NOT EXISTS ${DLL}) + message(FATAL_ERROR "Dynamic load library ${DLL} (derived from ${LIB}) does not exist") + endif() + install(FILES ${DLL} DESTINATION ${destination_lib} COMPONENT Libraries) + string(APPEND DLL_MSG " ${DLL}") + endforeach() + message(STATUS "Other dlls: ${DLL_MSG}") + +endif(WIN32)