diff src/CMakeLists.txt @ 46:11618dd45312

Add MacOS build support
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 30 May 2016 14:02:04 +0200
parents 50dae38a5641
children 36ee5dd46fd3
line wrap: on
line diff
--- a/src/CMakeLists.txt	Mon May 30 13:48:44 2016 +0200
+++ b/src/CMakeLists.txt	Mon May 30 14:02:04 2016 +0200
@@ -43,6 +43,53 @@
     ${TRANSLATION_SRC}
 )
 
+# See: https://bugreports.qt-project.org/browse/QTBUG-35918
+# extra static libs should be automatically managed but they
+# are not so we make this here explicitly neccessary.
+# The list is taken from the libs/*.prl file
+if(APPLE)
+   set(GUI_TYPE MACOSX_BUNDLE)
+   include_directories ( /Developer/Headers/FlatCarbon )
+   find_library(COCOA_LIBRARAY Cocoa)
+   find_library(CARBON_LIBRARY Carbon)
+   find_library(APP_SERVICES_LIBRARY ApplicationServices)
+   find_library(FOUNDATION_LIBRARAY Foundation)
+   find_library(CORE_SERVICES_LIBRARAY CoreServices)
+   find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
+   find_library(OPENGL_LIBRARAY OpenGL)
+   find_library(AGL_LIBRARY AGL)
+   find_library(IOKIT_LIBRARY IOKit)
+
+   get_target_property(_loc Qt5::Widgets LOCATION)
+   get_filename_component(_qtpath ${_loc} PATH)
+
+   set(MAC_EXTRA_LIBS
+      -L${_qtpath}
+      -lQt5Gui -lQt5Core -lQt5PlatformSupport
+      -lQt5PrintSupport
+      -lz -lm ${APP_SERVICES_LIBRARY}
+      ${FOUNDATION_LIBRARAY}
+      ${CORE_FOUNDATION_LIBRARY}
+      ${COCOA_LIBRARAY}
+      ${CORE_SERVICES_LIBRARAY}
+      ${OPENGL_LIBRARAY}
+      ${AGL_LIBRARY}
+      ${CARBON_LIBRARY}
+      ${IOKIT_LIBRARY}
+      -lqtharfbuzzng -lz -lcups)
+   set(EXTRA_STATIC_LIBS Qt5::QCocoaIntegrationPlugin ${MAC_EXTRA_LIBS} )
+   set (_add_executable_params MACOSX_BUNDLE)
+   SET(APPS "\${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app")
+   SET(MACOS_INFO_STRING "Tool to convert EduApp questionaires.")
+   SET(MACOSX_BUNDLE_NAME "EduExportConvert")
+   SET(MACOSX_BUNDLE_GUI_IDENTIFIER "EduExportConvert")
+   SET(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
+   SET(MACOSX_BUNDLE_BUNDLE_VERSION_STRING "${PROJECT_VERSION}")
+   SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}")
+   SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}")
+   set(MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2016 by ETH Zürich\nSoftware engineering by Intevation GmbH")
+endif()
+
 if (WIN32)
    get_target_property(_loc Qt5::Widgets LOCATION)
    get_filename_component(_qtpath ${_loc} PATH)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)