Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Every subproject "mysubproject" of type app or lib now contains three qmake files: mysubproject.pro mysubproject.pri mysubproject_dependencies.pri Dependency between two projects is satisfied by calling include(../path/to/dependee/dependee.pri) inside dependent_dependencies.pri. mysubproject.pri always includes mysubproject_dependencies.pri - this way dependencies are gathered transitively. Every mysubproject.pro starts with defining TARGET and including one of the templates: ssuapplication.pri ssulibrary.pri Settings common to both app and lib type of projects comes from ssu_common.pri For tests, there are derived templates inside tests directory tests/testapplication.pri tests/testlibrary.pri Common settings similarly comes from tests/tests_common.pri Source code root is added to INCLUDEPATH and DEPENDPATH so it is possible to include any header file specifying ints path relatively to source code root. Since all the libs and apps are part of single source tree, I recommend to express this fact by #including ssu own headers with "" instead of <>. #include "libssu/ssu.h" Projects outside of ssu source tree will still use #include <ssu.h> For tests, the "tests" dir is also added to INCLUDEPATH and DEPENDPATH so the "tests/" path component can/should be omitted inside tests code: #include "testutils/process.h" Building: I have removed the hardcoded build paths (buildpath.pri). It is still possible to keep source tree clean of build artefacts -- with shadow build: mkdir build && cd build && qmake ../ssu.pro -r && make Note that the output directories for app and lib binaries is still hardcoded as build/{bin,lib}. When gcov is to be used, simply build without the shadow build and object files will be placed next to source files. Other notes: I found some CONFIG settings having no effect and removed these. Namely CONFIG += dll - shared libs are build by default CONFIG -= app_bundle - Mac OS X specific CONFIG += console - Windows specific CONFIG += qtestlib - QT+=testlib should be the prefered way -maybe I am wrong? The 'unix' conditional was not used consistently. Similar issue with $${PREFIX}. As it is not much useful at the moment, I rather removed it.
- Loading branch information
Showing
55 changed files
with
187 additions
and
253 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include(libssu_dependencies.pri) | ||
LIBS *= -lssu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
BUILD = ../build/libssu | ||
HEADERS = ssu.h \ | ||
TARGET = ssu | ||
include(../ssulibrary.pri) | ||
|
||
# TODO: which headers are public? i.e. to be installed | ||
public_headers = \ | ||
ssu.h \ | ||
|
||
HEADERS = \ | ||
$${public_headers} \ | ||
ssucoreconfig.h \ | ||
ssudeviceinfo.h \ | ||
ssulog.h \ | ||
ssuvariables.h \ | ||
ssusettings.h \ | ||
ssurepomanager.h \ | ||
../constants.h | ||
SOURCES = ssu.cpp \ | ||
|
||
SOURCES = \ | ||
ssu.cpp \ | ||
ssucoreconfig.cpp \ | ||
ssudeviceinfo.cpp \ | ||
ssulog.cpp \ | ||
ssuvariables.cpp \ | ||
ssurepomanager.cpp \ | ||
ssusettings.cpp | ||
TEMPLATE = lib | ||
TARGET = ssu | ||
CONFIG += dll mobility link_pkgconfig | ||
QT -= gui | ||
|
||
CONFIG += mobility link_pkgconfig | ||
QT += network xml | ||
MOBILITY += systeminfo | ||
PKGCONFIG += libsystemd-journal | ||
|
||
headers.files = ssu.h | ||
headers.path = /usr/include | ||
|
||
unix:target.path = $${PREFIX}/usr/lib | ||
INSTALLS += target headers | ||
install_headers.files = $${public_headers} | ||
|
||
ssuconfhack { | ||
DEFINES += SSUCONFHACK | ||
} | ||
|
||
!include( ../buildpath.pri ) { error("Unable to find build path specification") } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# no dependencies so far |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
* @date 2012 | ||
*/ | ||
|
||
#include <QtNetwork> | ||
#include <QtXml/QDomDocument> | ||
|
||
#include "ssu.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*/ | ||
|
||
#include <QDeclarativeContext> | ||
#include <QDir> | ||
#include <QGraphicsObject> | ||
#include <QApplication> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
TARGET = rndregisterui | ||
include(../ssuapplication.pri) | ||
include(rndregisterui_dependencies.pri) | ||
|
||
HEADERS = rndregisterui.h | ||
SOURCES = main.cpp \ | ||
rndregisterui.cpp | ||
RESOURCES = resources.qrc | ||
TEMPLATE = app | ||
TARGET = rndregisterui | ||
LIBS += -lssu | ||
|
||
CONFIG += qdeclarative-boostable | ||
CONFIG -= app_bundle | ||
QT += core gui declarative network | ||
QT += gui declarative | ||
|
||
OTHER_FILES += \ | ||
resources/qml/rndregisterui.qml \ | ||
resources/qml/RndSsuPage.qml | ||
unix:target.path = $${PREFIX}/usr/bin | ||
|
||
desktop.files = rndregisterui.desktop | ||
desktop.path = /usr/share/applications/ | ||
|
||
INSTALLS += target desktop | ||
|
||
!include( ../buildpath.pri ) { error("Unable to find build path specification") } | ||
INSTALLS += desktop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include(../libssu/libssu.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
TARGET = ssu | ||
include(../ssuapplication.pri) | ||
include(rndssucli_dependencies.pri) | ||
|
||
HEADERS = rndssucli.h | ||
SOURCES = main.cpp \ | ||
rndssucli.cpp | ||
#RESOURCES = rndregister.qrc | ||
TEMPLATE = app | ||
TARGET = ssu | ||
TARGETDIR = ssucli | ||
LIBS += -lssu | ||
CONFIG -= app_bundle | ||
CONFIG += console | ||
QT -= gui | ||
QT += network | ||
|
||
unix:target.path = $${PREFIX}/usr/bin | ||
INSTALLS += target | ||
|
||
!include( ../buildpath.pri ) { error("Unable to find build path specification") } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include(../libssu/libssu.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CONFIG -= gui | ||
|
||
INCLUDEPATH *= $$PWD | ||
DEPENDPATH *= $$PWD | ||
|
||
# TODO: determine build dir automatically | ||
SSU_BUILD_DIR = $$PWD/build | ||
|
||
DESTDIR_BIN = $$SSU_BUILD_DIR/bin | ||
DESTDIR_LIB = $$SSU_BUILD_DIR/lib | ||
|
||
LIBS += -L$$DESTDIR_LIB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
isEmpty(TARGET):error("TARGET must be set before this file is included") | ||
include(ssu_common.pri) | ||
|
||
TEMPLATE = app | ||
DESTDIR = $$DESTDIR_BIN | ||
|
||
target.path = /usr/bin | ||
INSTALLS += target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
TEMPLATE = app | ||
TARGET = ssuconfperm | ||
include(../ssuapplication.pri) | ||
|
||
SOURCES = ssuconfperm.c | ||
HEADERS = ../constants.h | ||
CONFIG -= qt | ||
|
||
!include(../buildpath.pri){ error("Unable to find build path configuration")} | ||
|
||
unix:target.path = $${PREFIX}/usr/bin | ||
INSTALLS += target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
TARGET = ssuks | ||
include(../ssuapplication.pri) | ||
include(ssuks_dependencies.pri) | ||
|
||
HEADERS = ssuks.h \ | ||
ssukickstarter.h | ||
SOURCES = ssuks.cpp \ | ||
ssukickstarter.cpp | ||
TEMPLATE = app | ||
TARGET = ssuks | ||
LIBS += -lssu | ||
CONFIG -= app_bundle | ||
CONFIG += console | ||
QT -= gui | ||
QT += network | ||
|
||
unix:target.path = $${PREFIX}/usr/bin | ||
INSTALLS += target | ||
|
||
!include( ../buildpath.pri ) { error("Unable to find build path specification") } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include(../libssu/libssu.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
isEmpty(TARGET):error("TARGET must be set before this file is included") | ||
include(ssu_common.pri) | ||
|
||
TEMPLATE = lib | ||
|
||
DESTDIR = $$DESTDIR_LIB | ||
|
||
target.path = /usr/lib | ||
INSTALLS += target | ||
|
||
install_headers.path = /usr/include | ||
INSTALLS += install_headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
TARGET = ssu | ||
include(../ssuapplication.pri) | ||
include(ssuurlresolver_dependencies.pri) | ||
|
||
# We do not build a typical application - override defaults from ../ssuapplication.pri | ||
DESTDIR = $$DESTDIR_LIB/zypp/plugins/urlresolver | ||
target.path = /usr/lib/zypp/plugins/urlresolver | ||
|
||
HEADERS = ssuurlresolver.h | ||
SOURCES = main.cpp \ | ||
ssuurlresolver.cpp | ||
TEMPLATE = app | ||
TARGET = ssu | ||
LIBS += -lssu | ||
CONFIG -= app_bundle | ||
CONFIG += console link_pkgconfig | ||
QT -= gui | ||
QT += network | ||
PKGCONFIG += libzypp libsystemd-journal | ||
|
||
unix:target.path = $${PREFIX}/usr/lib/zypp/plugins/urlresolver | ||
INSTALLS += target | ||
|
||
!include( ../buildpath.pri ) { error("Unable to find build path specification") } | ||
CONFIG += link_pkgconfig | ||
PKGCONFIG += libzypp libsystemd-journal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include(../libssu/libssu.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
include(../ssuapplication.pri) | ||
include(tests_common.pri) | ||
|
||
QT += testlib | ||
|
||
test_data_etc.path = $${TESTS_DATA_PATH}/configroot/etc/ssu | ||
test_data_usr_share.path = $${TESTS_DATA_PATH}/configroot/usr/share/ssu | ||
INSTALLS += test_data_etc test_data_usr_share |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include(../ssulibrary.pri) | ||
include(tests_common.pri) |
Oops, something went wrong.