From kde-commits Wed Jul 11 21:09:15 2007 From: Nikolas Zimmermann Date: Wed, 11 Jul 2007 21:09:15 +0000 To: kde-commits Subject: KDE/kdeedu/marble Message-Id: <1184188155.195565.3162.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=118418816510678 SVN commit 686634 by wildfox: Make a QtOnly version work on OSX with cmake. Remove old qmake stuff. Work around a problem with cmake-2.4.6 and Qt 4.3.0. This has been requested by Torsten. Benoit Sigoure wrote the BuildOnOSX.sh changes - commiting for him. M +35 -6 BuildOnOSX.sh M +7 -0 CMakeLists.txt M +7 -3 src/CMakeLists.txt D src/marbleosx.pro M +3 -1 src/plugins/marblewidget/MarbleWidgetPlugin.h M +3 -1 src/plugins/navigator/MarbleNavigatorPlugin.h --- trunk/KDE/kdeedu/marble/BuildOnOSX.sh #686633:686634 @@ -1,6 +1,35 @@ -#!/usr/bin/env bash -cd src -qmake -config release -spec macx-xcode marbleosx.pro -xcodebuild -mkdir marbleosx.app/Contents/MacOS/Resources/ -cp -R ../data/ marbleosx.app/Contents/MacOS/Resources/data/ +#! /bin/sh +set -xe +# Prefix can be set with: env PREFIX=/opt/local ./BuildOnOSX.sh +prefix=${PREFIX-/usr/local} + +case "$prefix" in + [\\/]* | ?:[\\/]* ) # Absolute + ;; + *) + echo "'$prefix' is not an absolute path" >&2 + exit 1 + ;; +esac + +# Find or create the build directory +if test -f Makefile && test -f ../CMakeLists.txt; then + : # Nothing to do, we've been called from the build directory +else + test -d build || mkdir build + cd build +fi + +# Build +cmake -DCMAKE_INSTALL_PREFIX="$prefix" -DQTONLY=ON .. +make + +# Install +sudo make install + +# Fix the resource location +resdir="$prefix/bin/marble.app/Contents/MacOS/Resources" +sudo mkdir -m 0755 -p "$resdir" +sudo ln -s -f ../../../../../share/apps/marble/data "$resdir/data" +# Fix the rights +sudo chmod -R a+rX "$prefix/bin/marble.app" "$prefix/share/apps/marble" --- trunk/KDE/kdeedu/marble/CMakeLists.txt #686633:686634 @@ -23,6 +23,13 @@ if (QTONLY) # add a flag to be able to distinguish between qt and kde mode in the sources add_definitions(-DQTONLY) + + # Eventually workaround FindQt4.cmake bug not finding QtDesigner includes + if(APPLE) + if (NOT DEFINED ${QT_QTDESIGNER_INCLUDE_DIR}) + set ( QT_QTDESIGNER_INCLUDE_DIR ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers ) + endif(NOT DEFINED ${QT_QTDESIGNER_INCLUDE_DIR}) + endif(APPLE) else(QTONLY) # search packages used by KDE find_package(KDE4 REQUIRED) --- trunk/KDE/kdeedu/marble/src/CMakeLists.txt #686633:686634 @@ -111,10 +111,14 @@ kde4_add_ui_files(marble_SRCS ${marble_UI}) endif (QTONLY) -#kde4_add_library (marble SHARED ${marble_SRCS}) if (QTONLY) -# add_executable (marble WIN32 ${marble_SRCS} ${marble_HDRS}) - add_executable (marble MACOSX_BUNDLE ${marble_SRCS}) + if (APPLE) + add_executable (marble MACOSX_BUNDLE ${marble_SRCS}) + endif (APPLE) + + if (WIN32) + add_executable (marble WIN32 ${marble_SRCS} ${marble_HDRS}) + endif (WIN32) else (QTONLY) kde4_add_executable (marble ${marble_SRCS} ${marble_HDRS}) endif (QTONLY) --- trunk/KDE/kdeedu/marble/src/plugins/marblewidget/MarbleWidgetPlugin.h #686633:686634 @@ -16,7 +16,9 @@ #ifndef MARBLEWIDGETPLUGIN_H #define MARBLEWIDGETPLUGIN_H -#include +// Workaround: moc on osx is unable to find this file, when prefix with QtDesigner/ +// moc also doesn't respect Q_OS_* macros, otherwhise I could ifdef this. +#include class MarbleWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface { --- trunk/KDE/kdeedu/marble/src/plugins/navigator/MarbleNavigatorPlugin.h #686633:686634 @@ -16,7 +16,9 @@ #ifndef MARBLENAVIGATORPLUGIN_H #define MARBLENAVIGATORPLUGIN_H -#include +// Workaround: moc on osx is unable to find this file, when prefix with QtDesigner/ +// moc also doesn't respect Q_OS_* macros, otherwhise I could ifdef this. +#include class MarbleNavigatorPlugin : public QObject, public QDesignerCustomWidgetInterface {