From c4f97bafedfde3a0c5cac96a2971ada69b21d62f Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Wed, 30 May 2012 17:05:35 +0300 Subject: [PATCH] Added Subdirs.pro. It allows us to build Sankore with it's plugins as one project. We can add Third-Party to it later. Changed cffAdaptor. Now generated library will be copyed to Sankore3.1 folder undwe windows and to Sankore3.1.app/Contents/MacOS folder under macx. Added postScript_mac.sh for copying libs under mac. Changed Sankore_3.1.pro - now all files placed in groups by it's place in project folders. --- Sankore_3.1.pro | 1 + Subdirs.pro | 34 ++++++++++++++++++++++++++++ plugins/cffadaptor/UBCFFAdaptor.pro | 13 ++++++++--- plugins/cffadaptor/postScript_mac.sh | 5 ++++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 Subdirs.pro create mode 100644 plugins/cffadaptor/postScript_mac.sh diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index 5620eb7b..2fa4818d 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -3,6 +3,7 @@ TEMPLATE = app THIRD_PARTY_PATH=../Sankore-ThirdParty +CONFIG -= flat CONFIG += debug_and_release \ no_include_pwd diff --git a/Subdirs.pro b/Subdirs.pro new file mode 100644 index 00000000..8be79c88 --- /dev/null +++ b/Subdirs.pro @@ -0,0 +1,34 @@ +TEMPLATE = subdirs +CONFIG += recursive +CONFIG += debug_and_release + +win32: SUB_DIR = win32 +macx: SUB_DIR = macx +linux-g++: SUB_DIR = linux +linux-g++-32: SUB_DIR = linux +linux-g++-64: SUB_DIR = linux + +BUILD_DIR = build/$$SUB_DIR + +CONFIG(debug, debug|release):BUILD_DIR = $$BUILD_DIR/debug +CONFIG(release, debug|release) { + BUILD_DIR = $$BUILD_DIR/release + CONFIG += warn_off +} + +SANKORE_DIR = $$PWD +SANKORE_PRO = $$SANKORE_DIR/Sankore_3.1.pro +THIRD_PARTY_DIR = $$PWD/Sankore-ThirdParty +SANKORE_PLUGINS_DIR = $$SANKORE_DIR/plugins +PLUGIN_CFF_ADAPTOR_DIR = $$SANKORE_PLUGINS_DIR/cffadaptor +PLUGIN_CFF_ADAPTOR_PRO = $$PLUGIN_CFF_ADAPTOR_DIR/UBCFFAdaptor.pro + +SUBDIRS += $$SANKORE_PRO + +if(exists($$PLUGIN_CFF_ADAPTOR_DIR)){ + SUBDIRS += $$PLUGIN_CFF_ADAPTOR_PRO + $$SANKORE_PRO.depends = $$PLUGIN_CFF_ADAPTOR_PRO +} + +recurse_target = $$SANKORE_PRO + diff --git a/plugins/cffadaptor/UBCFFAdaptor.pro b/plugins/cffadaptor/UBCFFAdaptor.pro index 079de115..f8214d5d 100644 --- a/plugins/cffadaptor/UBCFFAdaptor.pro +++ b/plugins/cffadaptor/UBCFFAdaptor.pro @@ -16,7 +16,7 @@ linux-g++-64: SUB_DIR = linux THIRD_PARTY_PATH = ../../../Sankore-ThirdParty QUAZIP_DIR = "$$PWD/../../../Sankore-ThirdParty/quazip/quazip-0.3" -BUILD_DIR = $$PWD/build/$$SUB_DIR +BUILD_DIR = build/$$SUB_DIR CONFIG(debug, debug|release):BUILD_DIR = $$BUILD_DIR/debug CONFIG(release, debug|release) { BUILD_DIR = $$BUILD_DIR/release @@ -31,12 +31,19 @@ OBJECTS_DIR = $$BUILD_DIR/objects MOC_DIR = $$BUILD_DIR/moc DESTDIR = $$BUILD_DIR/lib RCC_DIR = $$BUILD_DIR/rcc +SANKORE_DIR = ../.. +win32:{ + QMAKE_POST_LINK += copy $$replace(DESTDIR,/,\\)\\CFF_Adaptor.dll" $$replace(SANKORE_DIR,/,\\)\\CFF_Adaptor.dll /y" +} +macx:{ + QMAKE_POST_LINK += bash postScript_mac.sh "$$DESTDIR" "$$SANKORE_DIR/$$BUILD_DIR/product/Open-Sankore.app/Contents/MacOS" +} LIBS += "-L$$THIRD_PARTY_PATH/quazip/lib/$$SUB_DIR" "-lquazip" QT += xml xmlpatterns core QT += gui -QT += svg +QT += svg DEFINES += UBCFFADAPTOR_LIBRARY @@ -59,4 +66,4 @@ HEADERS +=\ src/UBCFFConstants.h RESOURCES += \ - resources/resources.qrc + resources/resources.qrc \ No newline at end of file diff --git a/plugins/cffadaptor/postScript_mac.sh b/plugins/cffadaptor/postScript_mac.sh new file mode 100644 index 00000000..dfe0fb63 --- /dev/null +++ b/plugins/cffadaptor/postScript_mac.sh @@ -0,0 +1,5 @@ +#!/bin/bash +SOURCE=$1 +DESTINATION=$2 +mkdir -p $DESTINATION +cp -R $SOURCE/ $DESTINATION \ No newline at end of file