[gegl-qt] Build: Fix out-of-tree build.



commit 59c7dbacc2ffb6eb106c672a3f2ab0965b8fb8ab
Author: Jon Nordby <jononor gmail com>
Date:   Tue Aug 23 00:04:37 2011 +0200

    Build: Fix out-of-tree build.
    
    Don't use nested includes, it becomes hairy very quickly. Instead
    have checks in commonly included .pri files to make sure the consumer
    including the file has also included the config.pri file.
    
    This makes building in subdirectories or directories on
    the same level as the source directory work again.
    Example:
    mkdir subdir && cd subdir && qmake .. && make

 README.txt                                         |    2 --
 config.pri                                         |    1 +
 examples/examples-common.pri                       |    3 ++-
 examples/qgv-basic/qgv-basic.pro                   |    1 +
 examples/qml-basic/qml-basic.pro                   |    1 +
 examples/qml-paint/qml-paint.pro                   |    1 +
 .../qwidget-autotransform.pro                      |    1 +
 examples/qwidget-basic/qwidget-basic.pro           |    1 +
 .../qwidget-transformations.pro                    |    1 +
 gegl-qt.pro                                        |    4 ++--
 .../test-nodeviewimplementation.pro                |    1 +
 tests/tests-common.pri                             |    3 ++-
 12 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/README.txt b/README.txt
index 381f39e..d91a974 100644
--- a/README.txt
+++ b/README.txt
@@ -64,9 +64,7 @@ First release. Goal: minimally useful, solid interfaces.
 Should at happen before or together with the next Gegl release.
 Need to build and work with whatever is the latest Gegl release.
 
-- Fix out-of-tree build
 - Do API review
-- Create 'make dist' and 'make distcheck' targets
 - Have a basic set of tests, and good test infrastructure
 - Distribute a basic examples for the provided features
 - Add information about gegl-qt to gegl.org website
diff --git a/config.pri b/config.pri
index b7e97af..72b7306 100644
--- a/config.pri
+++ b/config.pri
@@ -1,4 +1,5 @@
 
+GEGLQT_CONFIG = TRUE # Must always be set in this file. Used to detect if the file was found or not
 GEGLQT_PROJECTNAME = gegl-qt
 GEGLQT_API_VERSION = 0.1
 GEGLQT_VERSION = 0.0.1
diff --git a/examples/examples-common.pri b/examples/examples-common.pri
index 0438628..3e40fb2 100644
--- a/examples/examples-common.pri
+++ b/examples/examples-common.pri
@@ -1,4 +1,5 @@
-include(../../config.pri)
+isEmpty(GEGLQT_CONFIG):error("config.pri not found")
+# This file uses variables from config.pri, so users must include config.pri before including this file
 
 QT += core gui declarative
 
diff --git a/examples/qgv-basic/qgv-basic.pro b/examples/qgv-basic/qgv-basic.pro
index 2fbeb08..19fd7e6 100644
--- a/examples/qgv-basic/qgv-basic.pro
+++ b/examples/qgv-basic/qgv-basic.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../examples-common.pri)
 
 SOURCES += qgv-basic.cpp
diff --git a/examples/qml-basic/qml-basic.pro b/examples/qml-basic/qml-basic.pro
index d97fde7..2cb6db2 100644
--- a/examples/qml-basic/qml-basic.pro
+++ b/examples/qml-basic/qml-basic.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../examples-common.pri)
 
 SOURCES += qml-basic.cpp
diff --git a/examples/qml-paint/qml-paint.pro b/examples/qml-paint/qml-paint.pro
index 2b4ace3..c282761 100644
--- a/examples/qml-paint/qml-paint.pro
+++ b/examples/qml-paint/qml-paint.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../examples-common.pri)
 
 SOURCES += qml-paint.cpp qml-paint-engine.cpp
diff --git a/examples/qwidget-autotransform/qwidget-autotransform.pro b/examples/qwidget-autotransform/qwidget-autotransform.pro
index 1c328bf..ba51bba 100644
--- a/examples/qwidget-autotransform/qwidget-autotransform.pro
+++ b/examples/qwidget-autotransform/qwidget-autotransform.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../examples-common.pri)
 
 SOURCES += \
diff --git a/examples/qwidget-basic/qwidget-basic.pro b/examples/qwidget-basic/qwidget-basic.pro
index 8d9ce7c..fd4e0db 100644
--- a/examples/qwidget-basic/qwidget-basic.pro
+++ b/examples/qwidget-basic/qwidget-basic.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../examples-common.pri)
 
 SOURCES += qwidget-basic.cpp
diff --git a/examples/qwidget-transformations/qwidget-transformations.pro b/examples/qwidget-transformations/qwidget-transformations.pro
index 371e05e..0fbc90e 100644
--- a/examples/qwidget-transformations/qwidget-transformations.pro
+++ b/examples/qwidget-transformations/qwidget-transformations.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../examples-common.pri)
 
 SOURCES += \
diff --git a/gegl-qt.pro b/gegl-qt.pro
index c14eab7..45a5ed6 100644
--- a/gegl-qt.pro
+++ b/gegl-qt.pro
@@ -1,11 +1,11 @@
 include(config.pri)
+isEmpty(GEGLQT_CONFIG):error("config.pri not found")
 
 TEMPLATE = subdirs
 CONFIG += ordered
 SUBDIRS = gegl-qt operations examples tests
 
-!system(pkg-config --exists gegl):error("Could not find gegl")
-
+!system(pkg-config --exists gegl):error("Could not find required dependency: GEGL")
 
 DIST_NAME = $$GEGLQT_PROJECTNAME-$$GEGLQT_VERSION
 DIST_PATH = $$OUT_PWD/$$DIST_NAME
diff --git a/tests/test-nodeviewimplementation/test-nodeviewimplementation.pro b/tests/test-nodeviewimplementation/test-nodeviewimplementation.pro
index cea557e..f19431f 100644
--- a/tests/test-nodeviewimplementation/test-nodeviewimplementation.pro
+++ b/tests/test-nodeviewimplementation/test-nodeviewimplementation.pro
@@ -1,3 +1,4 @@
+include(../../config.pri)
 include(../tests-common.pri)
 
 SOURCES += test-nodeviewimplementation.cpp
diff --git a/tests/tests-common.pri b/tests/tests-common.pri
index 2856563..dafe569 100644
--- a/tests/tests-common.pri
+++ b/tests/tests-common.pri
@@ -1,4 +1,5 @@
-include(../config.pri)
+isEmpty(GEGLQT_CONFIG):error("config.pri not included")
+# This file uses variables from config.pri, so users must include config.pri before including this file
 
 QT += testlib
 CONFIG += debug



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]