diff src/CMakeLists.txt @ 57:2cd76e6c0fcf

Add MacOS build support
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 19 May 2015 15:36:00 +0200
parents 07744e276579
children af8f1792d48d
line wrap: on
line diff
--- a/src/CMakeLists.txt	Tue May 19 11:12:22 2015 +0200
+++ b/src/CMakeLists.txt	Tue May 19 15:36:00 2015 +0200
@@ -27,20 +27,42 @@
 )
 
 find_package(Qt5LinguistTools)
+  
+# 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)
 
-if(UNIX)
-   # See: https://bugreports.qt-project.org/browse/QTBUG-35918
-   # XCB_EXTRA_LIBS should be gotten automatically.
-   # The following list is taken from the .pri file
    get_target_property(_loc Qt5::Widgets LOCATION)
    get_filename_component(_qtpath ${_loc} PATH)
 
-   set(XCB_EXTRA_LIBS
+   set(MAC_EXTRA_LIBS
       -L${_qtpath}
-      -lQt5DBus -lQt5Gui -lQt5Core -lQt5PlatformSupport
-      -lX11 -lX11-xcb -lxcb
-      -lXrender -lSM -lICE -ldbus-1
-      -lm -ldl -lrt -lpthread )
+      -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} )
 
 elseif(WIN32)
    set (_add_executable_params WIN32)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)