]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
msys2/bundle: gtk2 loaders and theme, installation
authorThomas Debesse <dev@illwieckz.net>
Fri, 31 May 2019 21:24:03 +0000 (23:24 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 1 Jun 2019 20:52:54 +0000 (22:52 +0200)
- pixbuf loaders
- pixmap and wimp engines
- windows theme
- install those plus the libs discovered with ldd
- only bundle windows stuff on windows

CMakeLists.txt
radiant/CMakeLists.txt

index ad592edfadc8e76234bb2cf2591962e5d0230aac..098de3dcf92d61dee5da02ade978cd4cf5b24083 100644 (file)
@@ -217,14 +217,37 @@ if (BUILD_BINARIES)
     option(BUNDLE_LIBRARIES "Bundle libraries" ${BUNDLE_LIBRARIES_DEFAULT})
 
     macro(copy_dlls target)
-        if (BUNDLE_LIBRARIES)
+        if (BUNDLE_LIBRARIES AND WIN32)
             add_custom_command(TARGET ${target} POST_BUILD
                     COMMAND bash
                     ARGS -c "ldd '$<TARGET_FILE:${target}>' | egrep -i '\\.dll ' | grep -iv '/c/Windows' | awk '{ print $1 }' | while read dll; do cp --preserve=timestamps \"$(which $dll)\" '${PROJECT_BINARY_DIR}'; done"
                     VERBATIM
-                    )
+            )
+
+            file(GLOB DLL_FILES ${PROJECT_BINARY_DIR}/*.dll)
+
+            install(FILES
+                ${DLL_FILES}
+                DESTINATION ${CMAKE_INSTALL_PREFIX}
+            )
         endif ()
     endmacro()
+
+    macro(bundle_gtkdeps target)
+        if (BUNDLE_LIBRARIES AND WIN32)
+                add_custom_command(TARGET ${target} POST_BUILD
+                        COMMAND bash
+                        ARGS -c "mkdir -p '${PROJECT_BINARY_DIR}/share/themes'; mkdir -p '${PROJECT_BINARY_DIR}/lib'; mingw=\"$(echo '${CMAKE_C_COMPILER}' | sed -e 's|/bin/.*||')\"; cp -r --preserve=timestamps \"$mingw/share/themes/MS-Windows\" '${PROJECT_BINARY_DIR}/share/themes/'; cp -r --preserve=timestamps \"$mingw/lib/gdk-pixbuf-2.0\" '${PROJECT_BINARY_DIR}/lib/'; cp -r --preserve=timestamps \"$mingw/lib/gtk-2.0\" '${PROJECT_BINARY_DIR}/lib/'"
+                        VERBATIM
+                        )
+
+                install(DIRECTORY
+                        ${PROJECT_BINARY_DIR}/lib
+                        ${PROJECT_BINARY_DIR}/share
+                        DESTINATION ${CMAKE_INSTALL_PREFIX}
+                )
+        endif ()
+    endmacro ()
 endif ()
 
 #-----------------------------------------------------------------------
@@ -268,7 +291,7 @@ if (BUILD_BINARIES)
         add_executable(${name} ${ARGN})
         install(
                 TARGETS ${name}
-                RUNTIME DESTINATION ${RADIANT_BIN_SUBDIR}/.
+                RUNTIME DESTINATION ${RADIANT_BIN_SUBDIR}
         )
     endmacro()
 
@@ -316,9 +339,9 @@ endif()
 
 if (BUILD_BINARIES)
     install(DIRECTORY
-            setup/data/tools/
+            setup/data/tools
             docs
-            DESTINATION ${RADIANT_DATA_SUBDIR}/.
+            DESTINATION ${RADIANT_DATA_SUBDIR}
     )
 endif ()
 
index 6fcb36809d27fa167e98fa8a4661672d42f47e66..4535a84dc182681bc3133258d4965f9601e2089f 100644 (file)
@@ -131,3 +131,4 @@ if (X11_LIBRARIES)
 endif ()
 
 copy_dlls(${RADIANT_BASENAME})
+bundle_gtkdeps(${RADIANT_BASENAME})