From 0d4078f00522f2a3f369b230027110a0f0fc2ff0 Mon Sep 17 00:00:00 2001 From: nowrep Date: Fri, 6 Jul 2012 13:28:45 +0200 Subject: [PATCH] Build system now allow building plugins out of src/plugins directory --- .gitignore | 1 + QupZilla.pro | 3 ++- src/plugins/plugins.pro | 21 +++++++++++++++++++-- src/src.pro | 3 --- 4 files changed, 22 insertions(+), 6 deletions(-) delete mode 100644 src/src.pro diff --git a/.gitignore b/.gitignore index 0b064d319..5330fe041 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ DEBIAN *.a *.orig *.qm +*.o !qt_*.qm headers*.tar.gz license_template diff --git a/QupZilla.pro b/QupZilla.pro index fb4b1f07e..775422fc6 100644 --- a/QupZilla.pro +++ b/QupZilla.pro @@ -14,4 +14,5 @@ lessThan(QT_VERSION, 4.7) { mac|unix: system(test -d bin/plugins || mkdir bin/plugins) TEMPLATE = subdirs -SUBDIRS = src +SUBDIRS = src/lib src/main src/plugins +CONFIG += ordered diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index a8e138305..c08a0ad9d 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -1,5 +1,22 @@ TEMPLATE = subdirs -SUBDIRS = MouseGestures AccessKeysNavigation + +defineTest(addSubdir) { + for(subdir, 1) { + entries = $$files($$subdir/*) + for(entry, entries) { + fullPath = $$replace(entry, ;,"") + name = $$replace(fullPath, $$re_escape("$$subdir/"), "") + exists($$fullPath/*.pro): SUBDIRS += $$fullPath + } + } + + export (SUBDIRS) +} + +addSubdir($$PWD) + +outOfDirPlugins = $$(QUPZILLA_PLUGINS_SRCDIR) +!equals(outOfDirPlugins, "") : addSubdir($$(QUPZILLA_PLUGINS_SRCDIR)) # TestPlugin only in debug build -CONFIG(debug, debug|release): SUBDIRS += TestPlugin +!CONFIG(debug, debug|release): SUBDIRS -= $$PWD/TestPlugin diff --git a/src/src.pro b/src/src.pro deleted file mode 100644 index 157ad45f8..000000000 --- a/src/src.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = lib main plugins -CONFIG += ordered