diff --git a/accommodation/accommodation.pro b/accommodation/accommodation.pro index 5d311ef..938552f 100644 --- a/accommodation/accommodation.pro +++ b/accommodation/accommodation.pro @@ -9,8 +9,7 @@ QT += widgets sql TARGET = accommodation TEMPLATE = lib -DEFINES += ACCOMMODATION_LIBRARY\ - _GLIBCXX_USE_CXX11_ABI=1 +DEFINES += ACCOMMODATION_LIBRARY SOURCES += accommodation.cpp \ data/person.cpp \ @@ -30,25 +29,7 @@ HEADERS += accommodation.h\ data/address.h \ data/accommodation-data.h -unix { - target.path = /usr/lib - INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 - QMAKE_CXXFLAGS += -Wno-unknown-pragmas -} - -win32 { - QMAKE_CXXFLAGS += -wd4995 -wd4068 -} - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore -else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore - -INCLUDEPATH += $$PWD/../core -DEPENDPATH += $$PWD/../core - -DESTDIR = ../plugins +include(../config_plugin.pri) OTHER_FILES += \ accommodation.json @@ -60,13 +41,6 @@ ODB_FILES = accommodation/data/accommodation-data.h H_DIR = $$PWD/data/*.h include(../odb.pri) -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:unix: LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber - -INCLUDEPATH += $$PWD/../qdecimal/src -INCLUDEPATH += $$PWD/../qdecimal/decnumber - RESOURCES += \ accrc.qrc diff --git a/addressbook/addressbook.pro b/addressbook/addressbook.pro index 869a60b..91a39b1 100644 --- a/addressbook/addressbook.pro +++ b/addressbook/addressbook.pro @@ -28,34 +28,7 @@ HEADERS += addressbook.h\ addressbooktablemodel.h \ addressbookservice.h -unix { - target.path = /usr/lib - INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 - QMAKE_CXXFLAGS += -Wno-unknown-pragmas -} - -win32 { - QMAKE_CXXFLAGS += -wd4995 -wd4068 -} - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore -else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore - -INCLUDEPATH += $$PWD/../core -DEPENDPATH += $$PWD/../core - -DESTDIR = ../plugins - - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:unix: LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber - -INCLUDEPATH += $$PWD/../qdecimal/src -INCLUDEPATH += $$PWD/../qdecimal/decnumber -DEPENDPATH += $$PWD/../qdecimal/src +include(../config_plugin.pri) ODB_FILES = addressbook/data/addressbookdata.h H_DIR = $$PWD/data/*.h diff --git a/application/application.pro b/application/application.pro index eeb2f76..e87e91f 100644 --- a/application/application.pro +++ b/application/application.pro @@ -13,11 +13,15 @@ TEMPLATE = app DEFINES += _GLIBCXX_USE_CXX11_ABI=1 +CONFIG += c++11 + +include(../config_odb.pri) + win32 { - INCLUDEPATH += d:/prac/odb/libodb-2.4.0 - INCLUDEPATH += d:/prac/odb/libodb-qt-2.4.0 - INCLUDEPATH += d:/prac/odb/libodb-sqlite-2.4.0 - INCLUDEPATH += d:/prac/odb/sqlite + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/libodb-2.4.0 + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/libodb-qt-2.4.0 + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/libodb-sqlite-2.4.0 + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/sqlite } SOURCES += main.cpp\ @@ -32,7 +36,6 @@ FORMS += mainwindow.ui \ unix { - QMAKE_CXXFLAGS += -std=c++11 QMAKE_CXXFLAGS += -Wno-unknown-pragmas } @@ -58,5 +61,3 @@ RESOURCES += \ appRc.qrc TRANSLATIONS = translations/prodejna_cz.ts - -DISTFILES += diff --git a/commodity/commodity.pro b/commodity/commodity.pro index 5fc1b92..f7d2267 100644 --- a/commodity/commodity.pro +++ b/commodity/commodity.pro @@ -11,8 +11,7 @@ QT -= gui TARGET = commodity TEMPLATE = lib -DEFINES += COMMODITY_LIBRARY\ - _GLIBCXX_USE_CXX11_ABI=1 +DEFINES += COMMODITY_LIBRARY SOURCES += commodity.cpp \ data/commoditydata.cpp \ @@ -34,38 +33,13 @@ HEADERS += commodity.h\ commoditysettingsform.h \ commodityservice.h -unix { - target.path = /usr/lib - INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 - QMAKE_CXXFLAGS += -Wno-unknown-pragmas -} - -win32 { - QMAKE_CXXFLAGS += -wd4995 -wd4068 -} -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore -else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore - -INCLUDEPATH += $$PWD/../core -DEPENDPATH += $$PWD/../core - -DESTDIR = ../plugins +include(../config_plugin.pri) ODB_FILES = commodity/data/commodity-data.h H_DIR = $$PWD/data/*.h ODB_OTHER_INCLUDES = -I $$PWD/../shop include(../odb.pri) -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:unix: LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber - -INCLUDEPATH += $$PWD/../qdecimal/src -INCLUDEPATH += $$PWD/../qdecimal/decnumber -DEPENDPATH += $$PWD/../qdecimal/src - OTHER_FILES += \ commodity.json diff --git a/config_odb.pri b/config_odb.pri new file mode 100644 index 0000000..a1734af --- /dev/null +++ b/config_odb.pri @@ -0,0 +1,4 @@ +win32 { + LIB_PATH = d:/prac/qt/lib + ODB_INCLUDE_PREFIX = d:/prac/odb +} diff --git a/config_plugin.pri b/config_plugin.pri new file mode 100644 index 0000000..2552b0c --- /dev/null +++ b/config_plugin.pri @@ -0,0 +1,30 @@ +DEFINES += _GLIBCXX_USE_CXX11_ABI=1 +CONFIG += c++11 + + +unix { + target.path = /usr/lib + INSTALLS += target + QMAKE_CXXFLAGS += -Wno-unknown-pragmas +} + +win32 { + QMAKE_CXXFLAGS += -wd4995 -wd4068 +} + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore +else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore + +INCLUDEPATH += $$PWD/core +DEPENDPATH += $$PWD/core + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber +else:unix: LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber + +INCLUDEPATH += $$PWD/qdecimal/src +INCLUDEPATH += $$PWD/qdecimal/decnumber +DEPENDPATH += $$PWD/qdecimal/src + +DESTDIR = ../plugins diff --git a/core/core.pro b/core/core.pro index 8b9a091..ffaaed2 100644 --- a/core/core.pro +++ b/core/core.pro @@ -14,6 +14,8 @@ TEMPLATE = lib DEFINES += CORE_LIBRARY \ _GLIBCXX_USE_CXX11_ABI=1 +CONFIG += c++11 + SOURCES += \ data/user.cpp \ context.cpp \ @@ -119,7 +121,6 @@ HEADERS += core.h\ unix { target.path = /usr/lib INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 QMAKE_CXXFLAGS += -Wno-unknown-pragmas } @@ -128,7 +129,6 @@ win32 { } ODB_FILES = core/data/core-data.h - H_DIR = $$PWD/data/*.h include(../odb.pri) diff --git a/odb.pri b/odb.pri index ab3dc7b..16b8675 100644 --- a/odb.pri +++ b/odb.pri @@ -1,9 +1,11 @@ +include(config_odb.pri) + win32 { - LIBS += -L"d:/prac/qt/lib" - INCLUDEPATH += d:/prac/odb/libodb-2.4.0 - INCLUDEPATH += d:/prac/odb/libodb-qt-2.4.0 - INCLUDEPATH += d:/prac/odb/libodb-sqlite-2.4.0 - INCLUDEPATH += d:/prac/odb/sqlite + LIBS += -L$$LIB_PATH + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/libodb-2.4.0 + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/libodb-qt-2.4.0 + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/libodb-sqlite-2.4.0 + INCLUDEPATH += $$ODB_INCLUDE_PREFIX/sqlite } win32 { @@ -21,7 +23,7 @@ unix { ODB_FLAGS += --database sqlite --profile qt --generate-schema --generate-query --generate-session --at-once --input-name $$TARGET --schema-format sql win32 { - ODB_PATH = d:\prac\odb\odb-2.4.0-i686-windows\bin\odb + ODB_PATH = $$ODB_INCLUDE_PREFIX\odb-2.4.0-i686-windows\bin\odb } unix { ODB_PATH = odb @@ -46,10 +48,10 @@ ODB_FLAGS += -I $$PWD/core ODB_FLAGS += -I $$PWD/qdecimal/src ODB_FLAGS += -I $$PWD/qdecimal/decnumber ODB_FLAGS += $$ODB_OTHER_INCLUDES -ODB_FLAGS += -x -std=c++11 -x -fPIC +ODB_FLAGS += -x -std=c++11 win32 { - ODB_FLAGS += -I d:/prac/odb/libodb-2.4.0 + ODB_FLAGS += -I $$ODB_INCLUDE_PREFIX/libodb-2.4.0 } # Newer versions of QtCreator do builds in a separate directory. As a @@ -72,9 +74,17 @@ odb.commands = $$ODB_PATH $$ODB_FLAGS ${QMAKE_FILE_IN} odb.depends = $$ODB_PWD_FILES odb.variable_out = SOURCES odb.CONFIG = target_predeps -odb.clean = $$TARGET-odb.cxx $$TARGET-odb.hxx $$TARGET-odb.ixx $$TARGET.sql +odb.clean = $$TARGET-odb.cxx $$TARGET-odb.hxx $$TARGET-odb.ixx $$TARGET.sql *.h *.sql QMAKE_EXTRA_COMPILERS += odb +odbh.name = odb ${QMAKE_FILE_IN} +odbh.input = ODB_PWD_FILES +odbh.output = $$TARGET-odb.hxx +odbh.commands = @true +odbh.depends = $$TARGET-odb.cxx +odbh.CONFIG = no_link +QMAKE_EXTRA_COMPILERS += odbh + odbhc.target = odbhc unix { odbhc.commands = $(COPY) -p $$H_DIR . diff --git a/prodejna.pro b/prodejna.pro index 34039c1..f5e7574 100644 --- a/prodejna.pro +++ b/prodejna.pro @@ -7,7 +7,7 @@ SUBDIRS += \ application \ accommodation \ services \ - commodity \ addressbook \ - shop + shop \ + commodity diff --git a/services/services.pro b/services/services.pro index f43f633..6a93eec 100644 --- a/services/services.pro +++ b/services/services.pro @@ -26,30 +26,10 @@ HEADERS += services.h\ accservicestablemodel.h \ accservicegrid.h -unix { - target.path = /usr/lib - INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 - QMAKE_CXXFLAGS += -Wno-unknown-pragmas -} - -win32 { - QMAKE_CXXFLAGS += -wd4995 -wd4068 -} - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore -else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore - -INCLUDEPATH += $$PWD/../core -DEPENDPATH += $$PWD/../core - -DESTDIR = ../plugins +include(../config_plugin.pri) OTHER_FILES += service.json - - ODB_FILES = services/data/accservice.h H_DIR = $$PWD/data/*.h include(../odb.pri) @@ -57,19 +37,6 @@ include(../odb.pri) FORMS += \ accserviceform.ui -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:unix: LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber - -INCLUDEPATH += $$PWD/../qdecimal/src -INCLUDEPATH += $$PWD/../qdecimal/decnumber -DEPENDPATH += $$PWD/../qdecimal/src - -#win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../qdecimal/src/release/libqdecimal.a -#else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../qdecimal/src/debug/libqdecimal.a -#else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../qdecimal/src/release/qdecimal.lib -#else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../qdecimal/src/debug/qdecimal.lib -#else:unix: PRE_TARGETDEPS += $$OUT_PWD/../qdecimal/src/libqdecimal.a RESOURCES += \ servicesrc.qrc diff --git a/shop/shop.pro b/shop/shop.pro index 665cec6..8f16e30 100644 --- a/shop/shop.pro +++ b/shop/shop.pro @@ -10,7 +10,6 @@ TARGET = shop TEMPLATE = lib DEFINES += SHOP_LIBRARY\ - _GLIBCXX_USE_CXX11_ABI=1 SOURCES += shop.cpp \ data/voucher.cpp \ @@ -55,34 +54,7 @@ HEADERS += shop.h\ data/favorititem.h \ settings/favoriteservice.h -unix { - target.path = /usr/lib - INSTALLS += target - QMAKE_CXXFLAGS += -std=c++11 - QMAKE_CXXFLAGS += -Wno-unknown-pragmas -} - -win32 { - QMAKE_CXXFLAGS += -wd4995 -wd4068 -} - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore -else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore - -INCLUDEPATH += $$PWD/../core -DEPENDPATH += $$PWD/../core - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../plugins/ -laddressbook -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../plugins/ -laddressbook -else:unix: LIBS += -L$$OUT_PWD/../plugins/ -laddressbook - -INCLUDEPATH += $$PWD/../addressbook/data -INCLUDEPATH += $$PWD/../addressbook -INCLUDEPATH += $$PWD/ -DEPENDPATH += $$PWD/../addressbook - -DESTDIR = ../plugins +include(../config_plugin.pri) OTHER_FILES += shop.json @@ -91,14 +63,6 @@ H_DIR = $$PWD/data/*.h ODB_OTHER_INCLUDES = -I $$PWD/../addressbook/data -I $$PWD/ include(../odb.pri) -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber -else:unix: LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber - -INCLUDEPATH += $$PWD/../qdecimal/src -INCLUDEPATH += $$PWD/../qdecimal/decnumber -DEPENDPATH += $$PWD/../qdecimal/src - RESOURCES += \ shoprc.qrc @@ -112,4 +76,13 @@ FORMS += \ paydialog.ui \ paydvouchersdialog.ui +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../plugins/ -laddressbook +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../plugins/ -laddressbook +else:unix: LIBS += -L$$OUT_PWD/../plugins/ -laddressbook + +INCLUDEPATH += $$PWD/../addressbook/data +INCLUDEPATH += $$PWD/../addressbook +INCLUDEPATH += $$PWD/ +DEPENDPATH += $$PWD/../addressbook + TRANSLATIONS = translations/shop_cs_CZ.ts