From: Alexey Chernobaev Date: Fri, 30 Mar 2018 20:09:35 +0000 (+0300) Subject: more possible build options (use / don't use such libraries as QWT, KChart, ThreadWeaver) X-Git-Tag: submit/tizen/20180620.112952^2^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abf470b33673899801f786e976e20c08b8289acd;p=sdk%2Ftools%2Fheaptrack.git more possible build options (use / don't use such libraries as QWT, KChart, ThreadWeaver) --- diff --git a/src/analyze/gui/aboutdialog.cpp b/src/analyze/gui/aboutdialog.cpp index 769d851..fbadfdb 100644 --- a/src/analyze/gui/aboutdialog.cpp +++ b/src/analyze/gui/aboutdialog.cpp @@ -2,6 +2,7 @@ #include "ui_aboutdialog.h" #include "aboutdata.h" +#include "gui_config.h" #include #include @@ -33,13 +34,19 @@ AboutDialog::AboutDialog(QWidget *parent) : #endif QString( "

Uses Qt framework v.%1 libraries on terms of " \ - "LGPL.

" \ + "LGPL.

") + .arg(QT_VERSION_STR) +#ifdef THREAD_WEAVER + + QString( "

Uses ThreadWeaver library " \ - "on terms of LGPL.

" \ + "on terms of LGPL.

") +#endif +#ifdef QWT_FOUND + + QString( "

The application is based in part on the work of the " \ "Qwt project on terms of " \ "Qwt License.

") - .arg(QT_VERSION_STR) +#endif #ifdef WINDOWS + QString( "

Application icon (free for commercial use): Jack Cai " \ diff --git a/src/analyze/gui/chartwidgetqwtplot.cpp b/src/analyze/gui/chartwidgetqwtplot.cpp index 5d4dfde..e9bc8b3 100644 --- a/src/analyze/gui/chartwidgetqwtplot.cpp +++ b/src/analyze/gui/chartwidgetqwtplot.cpp @@ -116,7 +116,7 @@ ChartOptions::Options ChartOptions::toggleOption(Options option) } ChartWidgetQwtPlot::ChartWidgetQwtPlot(QWidget *parent, Options options) - : QwtPlot(parent), m_model(nullptr), m_isSizeModel(false), ChartOptions(options), + : QwtPlot(parent), ChartOptions(options), m_model(nullptr), m_isSizeModel(false), m_zoomer(new Zoomer(this)) { setCanvasBackground(Qt::white); diff --git a/src/analyze/gui/histogramwidgetqwtplot.cpp b/src/analyze/gui/histogramwidgetqwtplot.cpp index d037725..5870eb2 100644 --- a/src/analyze/gui/histogramwidgetqwtplot.cpp +++ b/src/analyze/gui/histogramwidgetqwtplot.cpp @@ -1,7 +1,9 @@ #include "histogramwidgetqwtplot.h" #include "histogrammodel.h" -#include "noklib.h" #include "util.h" +#ifdef NO_K_LIB +#include "noklib.h" +#endif #include diff --git a/src/analyze/gui/mainwindow.cpp b/src/analyze/gui/mainwindow.cpp index 0b99bd7..5affcde 100644 --- a/src/analyze/gui/mainwindow.cpp +++ b/src/analyze/gui/mainwindow.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #else #include #include @@ -64,9 +65,6 @@ #include "chartwidget.h" #include "histogrammodel.h" #include "histogramwidget.h" -#if QWT_FOUND -#include -#endif #endif using namespace std; diff --git a/src/heaptrack_gui.pro b/src/heaptrack_gui.pro index abc6699..f57db3b 100644 --- a/src/heaptrack_gui.pro +++ b/src/heaptrack_gui.pro @@ -17,20 +17,27 @@ SAMSUNG_TIZEN_BRANCH { TARGET = TizenMemoryProfiler } -win32 { - # Third-party libraries used: - # QWT: http://qwt.sourceforge.net (SVN: https://svn.code.sf.net/p/qwt/code/trunk) - # ThreadWeaver: https://cgit.kde.org/threadweaver.git (git://anongit.kde.org/threadweaver.git) +# uncomment the next line to disable using KDE libraries unconditionally (i.e. on Linux too) +CONFIG *= NO_K_LIB NO_K_CHART + +# Third-party libraries which may be used: + +# QWT: http://qwt.sourceforge.net (SVN: https://svn.code.sf.net/p/qwt/code/trunk). +# Used on Windows but not on Linux by default. + +# ThreadWeaver: https://cgit.kde.org/threadweaver.git (git://anongit.kde.org/threadweaver.git). +# Used on both Windows and Linux by default. +# comment the next line to not use ThreadWeaver library (used to parse data files faster) +!NO_K_LIB:CONFIG += THREAD_WEAVER + +win32 { # comment the next line to not use QWT library (charts will not be displayed in this case) CONFIG += QWT_CHART - # comment the next line to not use ThreadWeaver library (used to parse data files faster) - CONFIG += THREAD_WEAVER - - CONFIG += NO_K_LIB NO_K_CHART + CONFIG *= NO_K_LIB NO_K_CHART - DEFINES += NO_K_LIB NO_K_CHART WINDOWS + DEFINES *= WINDOWS INCLUDEPATH += $$(BOOST_LIB) LIBS += -L$$(BOOST_LIB)/stage/lib @@ -45,40 +52,20 @@ win32 { } } -THREAD_WEAVER { - DEFINES += THREAD_WEAVER - win32 { - # ThreadWeaver shall be built beforehand (load ThreadWeaver.pro, edit it if necessary, and build) - - # change the variable if ThreadWeaver headers are located in another directory - THREAD_WEAVE_HEADER_PATH = ../../kf5/threadweaver/src/ - - INCLUDEPATH += $$THREAD_WEAVE_HEADER_PATH ThreadWeaver - CONFIG(debug, debug|release) { - win32-msvc:LIBS += $${DESTDIR}/threadweaverd.lib - } - else { - win32-msvc:LIBS += $${DESTDIR}/threadweaver.lib - } - } - unix { - QT += ThreadWeaver - } -} - unix { - CONFIG *= USE_CHART - DEFINES *= USE_CHART - - # uncomment the next line to use QWT instead of KChart + # uncomment the next line to use QWT instead of KChart on Linux # CONFIG += QWT_CHART QWT_CHART { - CONFIG *= NO_K_LIB NO_K_CHART QWT_CHART - DEFINES *= NO_K_LIB NO_K_CHART + CONFIG *= NO_K_CHART USE_CHART QWT_CHART INCLUDEPATH += /usr/include/qwt LIBS += -lqwt-qt5 # correct the library name if needed (e.g. to 'qwt') } + else { + !NO_K_LIB { + CONFIG *= USE_CHART + } + } LIBS += -lboost_program_options -lboost_iostreams -lpthread } @@ -89,12 +76,34 @@ QWT_CHART { # Windows: file qwt.dll must exist in $${DESTDIR}\release and qwtd.dll in $${DESTDIR}\debug # to be able to run the application. CONFIG *= USE_CHART QWT - DEFINES *= USE_CHART QWT } -#Test only! -#CONFIG *= NO_K_LIB NO_K_CHART -#DEFINES *= NO_K_LIB NO_K_CHART +# add defines if have the following values in CONFIG +NO_K_LIB: DEFINES *= NO_K_LIB +NO_K_CHART: DEFINES *= NO_K_CHART +USE_CHART: DEFINES *= USE_CHART +QWT: DEFINES *= QWT + +THREAD_WEAVER { + DEFINES += THREAD_WEAVER + win32 { + # ThreadWeaver shall be built beforehand - use ThreadWeaver.pro file (edit it if necessary) + + # change the variable if ThreadWeaver headers are located in another directory + THREAD_WEAVE_HEADER_PATH = ../../kf5/threadweaver/src/ + + INCLUDEPATH += $$THREAD_WEAVE_HEADER_PATH ThreadWeaver + CONFIG(debug, debug|release) { + win32-msvc:LIBS += $${DESTDIR}/threadweaverd.lib + } + else { + win32-msvc:LIBS += $${DESTDIR}/threadweaver.lib + } + } + unix { + QT += ThreadWeaver + } +} SOURCES += \ analyze/accumulatedtracedata.cpp \ @@ -194,8 +203,10 @@ NO_K_LIB { FORMS += \ analyze/gui/mainwindow_noklib.ui \ - analyze/gui/aboutdialog.ui RESOURCES += \ analyze/gui/gui.qrc } + +FORMS += \ + analyze/gui/aboutdialog.ui