Mercurial > retraceit
changeset 57:2cd76e6c0fcf
Add MacOS build support
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 19 May 2015 15:36:00 +0200 |
parents | 016cbcb1a233 |
children | 922306591f50 |
files | CMakeLists.txt INSTALL src/CMakeLists.txt |
diffstat | 3 files changed, 108 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Tue May 19 11:12:22 2015 +0200 +++ b/CMakeLists.txt Tue May 19 15:36:00 2015 +0200 @@ -40,10 +40,12 @@ ### Hardening flags -set(HARDENING_FLAGS " -Wall -s -fstack-protector-all -fno-exceptions") -set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector") -set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") -set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0") +if(NOT APPLE) + set(HARDENING_FLAGS " -Wall -s -fstack-protector-all -fno-exceptions") + set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector") + set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") + set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0") +endif(NOT APPLE) if(WIN32) add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista
--- a/INSTALL Tue May 19 11:12:22 2015 +0200 +++ b/INSTALL Tue May 19 15:36:00 2015 +0200 @@ -65,4 +65,75 @@ -DCMAKE_PREFIX_PATH="$MXETARGET/qt5;$MXETARGET;" \ -DCMAKE_TOOLCHAIN_FILE="$MXETARGET/share/cmake/mxe-conf.cmake" \ -DCMAKE_VERBOSE_MAKEFILE=True + +For MacOSX +========== +Install the usual development tools / xcode. + +Define some paths for the build environment: +export CUSTOM_PREFIX=~/retraceit + +export PATH=$CUSTOM_PREFIX/bin:$PATH +export DYLD_LIBRARY_PATH=$CUSTOM_PREFIX/lib:$DYLD_LIBRARY_PATH +export PKG_CONFIG_PATH=$CUSTOM_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH + + +Download qt: + + curl -O http://qt-mirror.dannhauer.de/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.xz + shasum qt-everywhere-opensource-src-5.3.2.tar.xz + +Should match: fb156a87a193c9a7a2fa51efc89660a3b619ace5 + +Build and extract: + + tar -xf qt-everywhere-opensource-src-5.3.2.tar.xz + cd qt-everywhere-opensource-src-5.3.2/qtbase + + ./configure \ + -release -nomake tests -nomake examples -confirm-license \ + -static -no-cups -no-nis -no-icu -no-fontconfig -qt-freetype \ + -no-directfb -no-kms -no-openssl -no-glib \ + -no-nis -no-libjpeg -qt-libpng \ + -qt-zlib -no-gif -no-xinput2 -opensource -confirm-license \ + -prefix $CUSTOM_PREFIX -no-framework + + make -j `sysctl hw.ncpu | cut -f 2 -d " "` + make install + +Download mercurial: + wget https://mercurial.selenic.com/mac/binaries/Mercurial-3.4-py2.7-macosx10.10.zip + shasum Mercurial-3.4-py2.7-macosx10.10.zip + +Should match: 1380790ae7f7d8060e937d386be3103c173e450d + + unzip Mercurial-3.4-py2.7-macosx10.10.zip + +Install the .mpkg + +Configure to be usable with wald certificate + echo "[web]" >> ~/.hgrc + echo "cacerts=~/wald-ca.pem" >> ~/.hgrc + curl https://ssl.intevation.de/Intevation-Root-CA-2010.crt > ~/wald-ca.pem + +Download cmake: + curl -O http://www.cmake.org/files/v3.2/cmake-3.2.2-Darwin-x86_64.dmg + shasum cmake-3.2.2-Darwin-x86_64.dmg + +Should match: d0f4172a3c72764f06146e4f949367c8029e71ed + +Install the .dmg and add cmake to the path. + + export PATH=/Volumes/Macintosh\ HD/Applications/CMake.app/Contents/bin/:$PATH + +Now for retraceit: + + hg clone https://wald.intevation.org/hg/retraceit/ + cd retraceit + mkdir build && cd buld + cmake .. \ + -DCMAKE_PREFIX_PATH=$CUSTOM_PREFIX \ + -DCMAKE_INSTALL_PREFIX=$CUSTOM_PREFIX \ + -DCMAKE_VERBOSE_MAKEFILE=True + */
--- 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)