From 0cf7a344a0183cc42ff50e4c12afccbf89599f62 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 25 Jun 2015 13:42:49 +0300 Subject: [PATCH] Fixed Windows build. --HG-- branch : develop --- src/app/app.pro | 80 ++++++++++++------------- src/app/main.cpp | 2 + src/libs/vmisc/vabstractapplication.cpp | 2 +- src/libs/vmisc/vabstractapplication.h | 10 ++-- src/libs/vpatterndb/vpatterndb.pro | 2 + 5 files changed, 51 insertions(+), 45 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index b9b809e4e..a8e1ac2a2 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -546,25 +546,37 @@ for(DIR, INSTALL_STANDARD_MEASHUREMENTS) { copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard)) -# QMuParser library -win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2 -else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2 -else:unix: LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser - -INCLUDEPATH += $${PWD}/../libs/qmuparser -DEPENDPATH += $${PWD}/../libs/qmuparser - -# VPropertyExplorer library -win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer -else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer -else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer - -INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer -DEPENDPATH += $${PWD}/../libs/vpropertyexplorer - # When the GNU linker sees a library, it discards all symbols that it doesn't need. # Add dependent library the first. +#VTools static library (depend on VWidgets, VMisc, VPatternDB) +unix|win32: LIBS += -L$$OUT_PWD/../libs/vtools/$${DESTDIR}/ -lvtools + +INCLUDEPATH += $$PWD/../libs/vtools +INCLUDEPATH += $$OUT_PWD/../libs/vtools/$${UI_DIR} # For UI files +DEPENDPATH += $$PWD/../libs/vtools + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vtools/$${DESTDIR}/vtools.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vtools/$${DESTDIR}/libvtools.a + +#VMisc static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vmisc/$${DESTDIR}/ -lvmisc + +INCLUDEPATH += $$PWD/../libs/vmisc +DEPENDPATH += $$PWD/../libs/vmisc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/vmisc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/libvmisc.a + +#VWidgets static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vwidgets/$${DESTDIR}/ -lvwidgets + +INCLUDEPATH += $$PWD/../libs/vwidgets +DEPENDPATH += $$PWD/../libs/vwidgets + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vwidgets/$${DESTDIR}/vwidgets.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vwidgets/$${DESTDIR}/libvwidgets.a + #VPatternDB static library (depend on vgeometry) unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR} -lvpatterndb @@ -610,33 +622,21 @@ DEPENDPATH += $$PWD/../libs/vlayout win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/vlayout.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/libvlayout.a -#VTools static library (depend on vwidgets and vmisc) -unix|win32: LIBS += -L$$OUT_PWD/../libs/vtools/$${DESTDIR}/ -lvtools +# QMuParser library +win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2 +else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2 +else:unix: LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser -INCLUDEPATH += $$PWD/../libs/vtools -INCLUDEPATH += $$OUT_PWD/../libs/vtools/$${UI_DIR} # For UI files -DEPENDPATH += $$PWD/../libs/vtools +INCLUDEPATH += $${PWD}/../libs/qmuparser +DEPENDPATH += $${PWD}/../libs/qmuparser -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vtools/$${DESTDIR}/vtools.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vtools/$${DESTDIR}/libvtools.a +# VPropertyExplorer library +win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer +else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer +else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer -#VMisc static library -unix|win32: LIBS += -L$$OUT_PWD/../libs/vmisc/$${DESTDIR}/ -lvmisc - -INCLUDEPATH += $$PWD/../libs/vmisc -DEPENDPATH += $$PWD/../libs/vmisc - -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/vmisc.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/libvmisc.a - -#VWidgets static library -unix|win32: LIBS += -L$$OUT_PWD/../libs/vwidgets/$${DESTDIR}/ -lvwidgets - -INCLUDEPATH += $$PWD/../libs/vwidgets -DEPENDPATH += $$PWD/../libs/vwidgets - -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vwidgets/$${DESTDIR}/vwidgets.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vwidgets/$${DESTDIR}/libvwidgets.a +INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer +DEPENDPATH += $${PWD}/../libs/vpropertyexplorer noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing diff --git a/src/app/main.cpp b/src/app/main.cpp index 51dd03a98..95ad92b7f 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -29,6 +29,8 @@ #include "mainwindow.h" #include "core/vapplication.h" +#include // For QT_REQUIRE_VERSION + #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) # include "../libs/vmisc/backport/qcommandlineparser.h" #else diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index dbda77219..b8abd6240 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -34,9 +34,9 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) :QApplication(argc, argv), undoStack(nullptr), mainWindow(nullptr), + settings(nullptr), _patternUnit(Unit::Cm), _patternType(MeasurementsType::Individual), - settings(nullptr), currentScene(nullptr), sceneView(nullptr), doc(nullptr), diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index 89f2a1ad2..44f20f4fe 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -95,15 +95,17 @@ protected: */ QWidget *mainWindow; -private: - Q_DISABLE_COPY(VAbstractApplication) - Unit _patternUnit; - MeasurementsType _patternType; /** * @brief settings pointer to settings. Help hide constructor creation settings. Make make code more readable. */ VSettings *settings; +private: + Q_DISABLE_COPY(VAbstractApplication) + Unit _patternUnit; + MeasurementsType _patternType; + + QGraphicsScene *currentScene; VMainGraphicsView *sceneView; diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro index 8ab08defb..dffd4f892 100644 --- a/src/libs/vpatterndb/vpatterndb.pro +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -7,6 +7,8 @@ # File with common stuff for whole project include(../../../Valentina.pri) +QT += widgets + # Name of the library TARGET = vpatterndb