From: RĂ©mi Verschelde Date: Sat, 19 Nov 2016 16:09:43 +0000 (+0100) Subject: CMake: Install required DLLs when building with mingw X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=8c2b8ba8e55872e0a0c8004f5fae44d3b24d3fea;p=lugaru.git CMake: Install required DLLs when building with mingw --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 07903f9..bdf247f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,25 @@ endif(APPLE) if(WIN32) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX}) + if(MINGW) + set(LIBGCC_S libgcc_s_sjlj-1.dll) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") # MinGW64 + set(LIBGCC_S libgcc_s_seh-1.dll) + endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + # FIXME: Filter out unneeded DLLs when building against some internal deps + set(DLL_ROOT ${CMAKE_FIND_ROOT_PATH}/bin) + install(FILES ${DLL_ROOT}/${LIBGCC_S} + ${DLL_ROOT}/libjpeg-62.dll + ${DLL_ROOT}/libogg-0.dll + ${DLL_ROOT}/libpng16-16.dll + ${DLL_ROOT}/libstdc++-6.dll + ${DLL_ROOT}/libvorbis-0.dll + ${DLL_ROOT}/libvorbisfile-3.dll + ${DLL_ROOT}/libwinpthread-1.dll + ${DLL_ROOT}/SDL2.dll + ${DLL_ROOT}/zlib1.dll + DESTINATION ${CMAKE_INSTALL_PREFIX}) + endif(MINGW) else(WIN32) if(APPLE) set(CMAKE_INSTALL_PREFIX "${APPS_BIN}")