From d310801b1ca7028f36fad5ec98dd5dbe38bfc9f2 Mon Sep 17 00:00:00 2001 From: Razi Alavizadeh Date: Mon, 31 Dec 2018 13:17:49 +0330 Subject: [PATCH] Move similar preferences to common.pri --- lib/common.pri | 22 ++++++++++++++++++++++ lib/jkqtfastplotter.pri | 22 +++------------------- lib/jkqtmathtext.pri | 12 ++++-------- lib/jkqtplotter.pri | 20 +++----------------- 4 files changed, 32 insertions(+), 44 deletions(-) create mode 100644 lib/common.pri diff --git a/lib/common.pri b/lib/common.pri new file mode 100644 index 0000000000..0a5173a55e --- /dev/null +++ b/lib/common.pri @@ -0,0 +1,22 @@ + +!win32-msvc* { + QMAKE_CXXFLAGS += -fexceptions +} else { + QMAKE_CXXFLAGS += /EHsc + # To enable M_PI, M_E,... + DEFINES += _USE_MATH_DEFINES + # To fix error: C2338: va_start argument must not + # have reference type and must not be parenthesized + DEFINES += _CRT_NO_VA_START_VALIDATION +} + +HEADERS += $$PWD/jkqtplottertools/jkqtp_imexport.h \ + $$PWD/jkqtplottertools/jkqtptools.h + + +SOURCES += $$PWD/jkqtplottertools/jkqtptools.cpp + +INCLUDEPATH += $$PWD + +QT += core gui +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport diff --git a/lib/jkqtfastplotter.pri b/lib/jkqtfastplotter.pri index 98f3e6003b..6acf76b637 100644 --- a/lib/jkqtfastplotter.pri +++ b/lib/jkqtfastplotter.pri @@ -1,31 +1,15 @@ +include($$PWD/common.pri) -!win32-msvc* { - QMAKE_CXXFLAGS += -fexceptions -} else { - QMAKE_CXXFLAGS += /EHsc - # To enable M_PI, M_E,... - DEFINES += _USE_MATH_DEFINES - # To fix error: C2338: va_start argument must not - # have reference type and must not be parenthesized - DEFINES += _CRT_NO_VA_START_VALIDATION -} HEADERS += $$PWD/jkqtfastplotter/jkqtfastplotter.h \ - $$PWD/jkqtplottertools/jkqtptools.h \ - $$PWD/jkqtplottertools/jkqtphighrestimer.h \ - $$PWD/jkqtplottertools/jkqtp_imexport.h + $$PWD/jkqtplottertools/jkqtphighrestimer.h SOURCES += $$PWD/jkqtfastplotter/jkqtfastplotter.cpp \ - $$PWD/jkqtplottertools/jkqtptools.cpp \ $$PWD/jkqtplottertools/jkqtphighrestimer.cpp RESOURCES += $$PWD/jkqtplotterressources/jkqtpbaseplotter.qrc -INCLUDEPATH += $$PWD - -QT += core gui opengl -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport - +QT += opengl diff --git a/lib/jkqtmathtext.pri b/lib/jkqtmathtext.pri index 0219590b97..9e8cd8106b 100644 --- a/lib/jkqtmathtext.pri +++ b/lib/jkqtmathtext.pri @@ -1,17 +1,13 @@ -HEADERS += $$PWD/jkqtmathtext/jkqtmathtext.h \ - $$PWD/jkqtplottertools/jkqtptools.h \ - $$PWD/jkqtplottertools/jkqtp_imexport.h + +include($$PWD/common.pri) -SOURCES += $$PWD/jkqtmathtext/jkqtmathtext.cpp \ - $$PWD/jkqtplottertools/jkqtptools.cpp +HEADERS += $$PWD/jkqtmathtext/jkqtmathtext.h +SOURCES += $$PWD/jkqtmathtext/jkqtmathtext.cpp -INCLUDEPATH += $$PWD include($$PWD/jkqtplotterressources/math_fonts/xits.pri) DEFINES += AUTOLOAD_XITS_FONTS -QT += core gui #win32:LIBS += -lgdi32 -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport diff --git a/lib/jkqtplotter.pri b/lib/jkqtplotter.pri index ba14c39fba..3cc467bdc7 100644 --- a/lib/jkqtplotter.pri +++ b/lib/jkqtplotter.pri @@ -1,14 +1,6 @@ -!win32-msvc* { - QMAKE_CXXFLAGS += -fexceptions -} else { - QMAKE_CXXFLAGS += /EHsc - # To enable M_PI, M_E,... - DEFINES += _USE_MATH_DEFINES - # To fix error: C2338: va_start argument must not - # have reference type and must not be parenthesized - DEFINES += _CRT_NO_VA_START_VALIDATION -} +include($$PWD/common.pri) + HEADERS += \ $$PWD/jkqtfastplotter/jkqtfastplotter.h \ @@ -34,13 +26,11 @@ HEADERS += \ $$PWD/jkqtplottergui/jkqtpenhancedtableview.h \ $$PWD/jkqtplottergui/jkqtpgraphsmodel.h \ $$PWD/jkqtplottergui/jkvanishqtoolbar.h \ - $$PWD/jkqtplottertools/jkqtp_imexport.h \ $$PWD/jkqtplottertools/jkqtpdrawingtools.h \ $$PWD/jkqtplottertools/jkqtpenhancedpainter.h \ $$PWD/jkqtplottertools/jkqtphighrestimer.h \ $$PWD/jkqtplottertools/jkqtpimagetools.h \ $$PWD/jkqtplottertools/jkqtpmathparser.h \ - $$PWD/jkqtplottertools/jkqtptools.h \ $$PWD/jkqtplottertools/jkqttools.h @@ -73,16 +63,12 @@ SOURCES += \ $$PWD/jkqtplottertools/jkqtphighrestimer.cpp \ $$PWD/jkqtplottertools/jkqtpimagetools.cpp \ $$PWD/jkqtplottertools/jkqtpmathparser.cpp \ - $$PWD/jkqtplottertools/jkqtptools.cpp \ $$PWD/jkqtplottertools/jkqttools.cpp RESOURCES += $$PWD/jkqtplotterressources/jkqtpbaseplotter.qrc -INCLUDEPATH += $$PWD - -QT += core gui xml svg opengl -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport +QT += xml svg opengl include($$PWD/jkqtplotterressources/math_fonts/xits.pri) DEFINES += AUTOLOAD_XITS_FONTS