From fd5e177df76732ba608e3be6dcaed5fcaeb52eff Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Fri, 24 Jul 2015 11:09:44 +0100 Subject: [PATCH] Fix output directory in qt projects to be relative to the repository Conflicts: Builds/QtCreator/build_all.sh --- .gitignore | 2 ++ Builds/QtCreator/EmberAnimate/EmberAnimate.pro | 4 ++-- Builds/QtCreator/EmberCL/EmberCL.pro | 2 +- Builds/QtCreator/EmberGenome/EmberGenome.pro | 4 ++-- Builds/QtCreator/EmberRender/EmberRender.pro | 4 ++-- Builds/QtCreator/Fractorium/Fractorium.pro | 6 ++++-- Builds/QtCreator/build_all.sh | 11 +++++++++-- Builds/QtCreator/shared_settings.pri | 8 ++++++-- 8 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index a63a0c8..03c1080 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,5 @@ Builds/QtCreator/build* Makefile .qmake.stash *.gch +debug/ +release/ diff --git a/Builds/QtCreator/EmberAnimate/EmberAnimate.pro b/Builds/QtCreator/EmberAnimate/EmberAnimate.pro index bb5346c..1e87165 100644 --- a/Builds/QtCreator/EmberAnimate/EmberAnimate.pro +++ b/Builds/QtCreator/EmberAnimate/EmberAnimate.pro @@ -5,8 +5,8 @@ CONFIG -= qt include(../shared_settings.pri) -LIBS += -L$$DESTDIR -lEmber -LIBS += -L$$DESTDIR -lEmberCL +LIBS += -L$$absolute_path($$DESTDIR) -lEmber +LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL !macx:PRECOMPILED_HEADER = ../../../Source/EmberCommon/EmberCommonPch.h diff --git a/Builds/QtCreator/EmberCL/EmberCL.pro b/Builds/QtCreator/EmberCL/EmberCL.pro index 0bd6d46..d0dbb39 100644 --- a/Builds/QtCreator/EmberCL/EmberCL.pro +++ b/Builds/QtCreator/EmberCL/EmberCL.pro @@ -5,7 +5,7 @@ CONFIG -= qt include(../shared_settings.pri) -LIBS += -L$$DESTDIR -lEmber +LIBS += -L$$absolute_path($$DESTDIR) -lEmber !macx:PRECOMPILED_HEADER = ../../../Source/EmberCL/EmberCLPch.h diff --git a/Builds/QtCreator/EmberGenome/EmberGenome.pro b/Builds/QtCreator/EmberGenome/EmberGenome.pro index 3532459..2433760 100644 --- a/Builds/QtCreator/EmberGenome/EmberGenome.pro +++ b/Builds/QtCreator/EmberGenome/EmberGenome.pro @@ -5,8 +5,8 @@ CONFIG -= qt include(../shared_settings.pri) -LIBS += -L$$DESTDIR -lEmber -LIBS += -L$$DESTDIR -lEmberCL +LIBS += -L$$absolute_path($$DESTDIR) -lEmber +LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL !macx:PRECOMPILED_HEADER = ../../../Source/EmberCommon/EmberCommonPch.h diff --git a/Builds/QtCreator/EmberRender/EmberRender.pro b/Builds/QtCreator/EmberRender/EmberRender.pro index 39e1c32..f10a2fa 100644 --- a/Builds/QtCreator/EmberRender/EmberRender.pro +++ b/Builds/QtCreator/EmberRender/EmberRender.pro @@ -5,8 +5,8 @@ CONFIG -= qt include(../shared_settings.pri) -LIBS += -L$$DESTDIR -lEmber -LIBS += -L$$DESTDIR -lEmberCL +LIBS += -L$$absolute_path($$DESTDIR) -lEmber +LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL !macx:PRECOMPILED_HEADER = ../../../Source/EmberCommon/EmberCommonPch.h diff --git a/Builds/QtCreator/Fractorium/Fractorium.pro b/Builds/QtCreator/Fractorium/Fractorium.pro index 4d30cee..54737fd 100644 --- a/Builds/QtCreator/Fractorium/Fractorium.pro +++ b/Builds/QtCreator/Fractorium/Fractorium.pro @@ -13,8 +13,10 @@ TEMPLATE = app include(../shared_settings.pri) -LIBS += -L$$DESTDIR -lEmber -LIBS += -L$$DESTDIR -lEmberCL +macx:ICON = ../../package/osx/Fractorium.icns + +LIBS += -L$$absolute_path($$DESTDIR) -lEmber +LIBS += -L$$absolute_path($$DESTDIR) -lEmberCL INCLUDEPATH += ../../../Source/Fractorium diff --git a/Builds/QtCreator/build_all.sh b/Builds/QtCreator/build_all.sh index 600a1e8..a71eb9e 100755 --- a/Builds/QtCreator/build_all.sh +++ b/Builds/QtCreator/build_all.sh @@ -3,6 +3,9 @@ REBUILD='' NVIDIA='' NATIVE='' +CONCURRENCY='-j9' +QMAKE=${QMAKE:-qmake} +RELEASE='CONFIG+=release CONFIG-=debug' while test $# -gt 0 do @@ -13,6 +16,10 @@ do ;; --native) NATIVE="CONFIG += native" ;; + --travis) CONCURRENCY="-j1" + ;; + --debug) RELEASE="CONFIG+=debug CONFIG-=release" + ;; --*) echo "bad option $1"; exit 1 ;; *) echo "unrecognised argument $1"; exit 1 @@ -29,8 +36,8 @@ do if [ "x1" = "x$REBUILD" ]; then make clean fi - qmake "$NVIDIA" "$NATIVE" - make -j9 + $QMAKE "$NVIDIA" "$NATIVE" $RELEASE + make $CONCURRENCY if [ "x$?" != "x0" ]; then echo "Build failed! Check output for errors." exit 1 diff --git a/Builds/QtCreator/shared_settings.pri b/Builds/QtCreator/shared_settings.pri index 742e5a6..b5dc4ce 100644 --- a/Builds/QtCreator/shared_settings.pri +++ b/Builds/QtCreator/shared_settings.pri @@ -33,9 +33,13 @@ native { QMAKE_CXXFLAGS += -march=k8 } +release:DESTDIR = ../../../release +debug:DESTDIR = ../../../debug -DESTDIR = $$(HOME)/Dev/fractorium/Bin -debug:DESTDIR = $$(HOME)/Dev/fractorium/Dbg +OBJECTS_DIR = $$DESTDIR/.obj +MOC_DIR = $$DESTDIR/.moc +RCC_DIR = $$DESTDIR/.qrc +UI_DIR = $$DESTDIR/.ui LIBS += -L/usr/lib -ljpeg LIBS += -L/usr/lib -lpng