Set preprocessor define for deployment builds. Don't include sparkle in development builds. Note: Development snapshots are considered deployment builds

felipesanches-svg
Marius Kintel 2013-03-09 13:04:36 -05:00
parent e868b4a5a1
commit 8711bd2500
4 changed files with 26 additions and 19 deletions

View File

@ -55,20 +55,26 @@ else {
}
}
macx {
# add CONFIG+=deploy to the qmake command-line to make a deployment build
deploy {
message("Building deployment version")
# add CONFIG+=deploy to the qmake command-line to make a deployment build
deploy {
message("Building deployment version")
DEFINES += OPENSCAD_DEPLOY
macx {
CONFIG += x86 x86_64
LIBS += -framework Sparkle
HEADERS += src/SparkleAutoUpdater.h
OBJECTIVE_SOURCES += src/SparkleAutoUpdater.mm
}
}
macx {
TARGET = OpenSCAD
ICON = icons/OpenSCAD.icns
QMAKE_INFO_PLIST = Info.plist
APP_RESOURCES.path = Contents/Resources
APP_RESOURCES.files = OpenSCAD.sdef dsa_pub.pem icons/SCAD.icns
QMAKE_BUNDLE_DATA += APP_RESOURCES
LIBS += -framework Cocoa -framework Sparkle
LIBS += -framework Cocoa
}
else {
TARGET = openscad
@ -357,11 +363,9 @@ SOURCES += src/cgalutils.cc \
macx {
HEADERS += src/AppleEvents.h \
src/EventFilter.h \
src/SparkleAutoUpdater.h \
src/CocoaUtils.h
SOURCES += src/AppleEvents.cc
OBJECTIVE_SOURCES += src/SparkleAutoUpdater.mm \
src/CocoaUtils.mm
OBJECTIVE_SOURCES += src/CocoaUtils.mm
}
isEmpty(PREFIX):PREFIX = /usr/local

View File

@ -6,10 +6,11 @@
#
# This script must be run from the OpenSCAD source root directory
#
# Usage: macosx-build-dependencies.sh [-6l]
# Usage: macosx-build-dependencies.sh [-6lcd]
# -6 Build only 64-bit binaries
# -l Force use of LLVM compiler
# -c Force use of clang compiler
# -d Build for deployment (if not specified, e.g. Sparkle won't be built)
#
# Prerequisites:
# - MacPorts: curl, cmake
@ -32,11 +33,12 @@ export QMAKESPEC=macx-g++
printUsage()
{
echo "Usage: $0 [-6lc]"
echo "Usage: $0 [-6lcd]"
echo
echo " -6 Build only 64-bit binaries"
echo " -l Force use of LLVM compiler"
echo " -c Force use of clang compiler"
echo " -d Build for deployment"
}
# FIXME: Support gcc/llvm/clang flags. Use -platform <whatever> to make this work? kintel 20130117
@ -354,12 +356,13 @@ if [ ! -f $OPENSCADDIR/openscad.pro ]; then
exit 0
fi
while getopts '6lc' c
while getopts '6lcd' c
do
case $c in
6) OPTION_32BIT=false;;
l) OPTION_LLVM=true;;
c) OPTION_CLANG=true;;
d) OPTION_DEPLOY=true;;
esac
done
@ -415,4 +418,6 @@ build_boost 1.53.0
build_cgal 4.1
build_glew 1.9.0
build_opencsg 1.3.2
build_sparkle 0ed83cf9f2eeb425d4fdd141c01a29d843970c20
if $OPTION_DEPLOY; then
build_sparkle 0ed83cf9f2eeb425d4fdd141c01a29d843970c20
fi

View File

@ -110,13 +110,12 @@ fi
echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIGURATION..."
CONFIG=deploy
case $OS in
LINUX|MACOSX)
CONFIG=deploy
TARGET=
;;
WIN)
unset CONFIG
export QTDIR=/c/devmingw/qt2009.03
export QTMAKESPEC=win32-g++
export PATH=$PATH:/c/devmingw/qt2009.03/bin:/c/devmingw/qt2009.03/qt/bin
@ -125,7 +124,6 @@ case $OS in
TARGET=release
;;
LINXWIN)
unset CONFIG
. ./scripts/setenv-mingw-xbuild.sh
TARGET=release
ZIP="zip"

View File

@ -55,7 +55,9 @@
#ifdef Q_WS_MAC
#include "EventFilter.h"
#include "AppleEvents.h"
#include "SparkleAutoUpdater.h"
#ifdef OPENSCAD_DEPLOY
#include "SparkleAutoUpdater.h"
#endif
#endif
#include "Camera.h"
@ -483,12 +485,10 @@ int main(int argc, char **argv)
installAppleEventHandlers();
#endif
#ifndef DEBUG
#ifdef Q_WS_MAC
#if defined(OPENSCAD_DEPLOY) && defined(Q_WS_MAC)
AutoUpdater *updater = new SparkleAutoUpdater;
AutoUpdater::setUpdater(updater);
if (updater->automaticallyChecksForUpdates()) updater->checkForUpdates();
#endif
#endif
QString qfilename;