changeset 60:af8f1792d48d

Add App bundle installation
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 19 May 2015 16:14:04 +0200
parents 72e5a9c8e7e1
children de148cd023a1
files src/CMakeLists.txt
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Tue May 19 16:01:20 2015 +0200
+++ b/src/CMakeLists.txt	Tue May 19 16:14:04 2015 +0200
@@ -64,6 +64,11 @@
       -lqtharfbuzzng -lz -lcups)
    set(EXTRA_STATIC_LIBS Qt5::QCocoaIntegrationPlugin ${MAC_EXTRA_LIBS} )
 
+  SET(MACOSX_BUNDLE_ICON_FILE icon.icns)
+  SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
+  SET(APPLICATION_SRC ${APPLICATION_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns)
+  set (_add_executable_params MACOSX_BUNDLE)
+  SET(APPS "\${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app")
 elseif(WIN32)
    set (_add_executable_params WIN32)
 
@@ -123,4 +128,11 @@
    set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-municode")
 endif(WIN32)
 
-install(TARGETS ${PROJECT_NAME} DESTINATION bin)
+install(TARGETS ${PROJECT_NAME} DESTINATION bin BUNDLE DESTINATION .)
+INSTALL(CODE "
+    include(BundleUtilities)
+    fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
+    " COMPONENT Runtime)
+
+set(CPACK_BINARY_DRAGNDROP ON)
+include(CPack)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)