diff --git a/integrated.pri b/build.pri similarity index 98% rename from integrated.pri rename to build.pri index fd08e5f..7cccbe1 100644 --- a/integrated.pri +++ b/build.pri @@ -1,4 +1,4 @@ -integrated_build:{ +local_build:{ INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR !win32: { diff --git a/charts.pro b/charts.pro index b4c4b7f..1d7886c 100644 --- a/charts.pro +++ b/charts.pro @@ -1,15 +1,20 @@ -!include(common.pri) { - error('missing common.pri') +!include(config.pri) { + error('Missing config.pri') } TEMPLATE = subdirs -SUBDIRS += src qmlplugin examples demos test +SUBDIRS = src qmlplugin examples demos test -integrated_build:{ - message('Configured for integrated build against local libs...') +local_build:{ + message('Configured for local build against local libs...') + message('You can run "make" to build qchart library, examples and demos...') } else { message('Running build aginst system libs...') - message('Please build example test and qmlplugin after installing library.') + message('Bulding only charts library...') + message('You can run "make install" to build and install charts.') + message('Afterwards you can run "cd examples; qmake ; make " to build examples.') + message('Run qmake CONFIG+=local_build' to build everything at once.) + SUBDIRS = src } CONFIG += ordered diff --git a/common.pri b/config.pri similarity index 93% rename from common.pri rename to config.pri index a222bd0..3a68838 100644 --- a/common.pri +++ b/config.pri @@ -1,7 +1,7 @@ -CONFIG+=integrated_build #remove if you want to build against installed libs +#check if shadow build !contains($${PWD}, $${OUT_PWD}){ - search = "$$PWD:::" + search = "$$PWD:::" temp = $$split(search,"/") temp = $$last(temp) path = $$replace(search,$$temp,'') @@ -9,7 +9,8 @@ CONFIG+=integrated_build #remove if you want to build against installed libs temp = $$split(temp,'/') temp = $$first(temp) path = "$${path}$${temp}" - SHADOW=$$path + SHADOW=$$path + CONFIG-=developer_build }else{ SHADOW=$$PWD } @@ -42,3 +43,5 @@ mac: { QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5 QMAKE_LFLAGS *= -mmacosx-version-min=10.5 } + +developer_build: DEFINES+=DEVELOPER_BUILD \ No newline at end of file diff --git a/demos/demos.pri b/demos/demos.pri index 53fbe14..7feabdc 100644 --- a/demos/demos.pri +++ b/demos/demos.pri @@ -1,9 +1,9 @@ -!include( ../common.pri ) { - error( "Couldn't find the common.pri file!" ) +!include( ../config.pri ) { + error( "Couldn't find the config.pri file!" ) } -!include( ../integrated.pri ) { - error( "Couldn't find the integrated.pri file !") +!include( ../build.pri ) { + error( "Couldn't find the build.pri file !") } DESTDIR = $$CHART_BUILD_BIN_DIR diff --git a/examples/examples.pri b/examples/examples.pri index 53fbe14..7feabdc 100644 --- a/examples/examples.pri +++ b/examples/examples.pri @@ -1,9 +1,9 @@ -!include( ../common.pri ) { - error( "Couldn't find the common.pri file!" ) +!include( ../config.pri ) { + error( "Couldn't find the config.pri file!" ) } -!include( ../integrated.pri ) { - error( "Couldn't find the integrated.pri file !") +!include( ../build.pri ) { + error( "Couldn't find the build.pri file !") } DESTDIR = $$CHART_BUILD_BIN_DIR diff --git a/qmlplugin/declarativexypoint.h b/qmlplugin/declarativexypoint.h index ad25d51..b316f30 100644 --- a/qmlplugin/declarativexypoint.h +++ b/qmlplugin/declarativexypoint.h @@ -24,6 +24,7 @@ #include "qchartglobal.h" #include #include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/qmlplugin/qmlplugin.pro b/qmlplugin/qmlplugin.pro index 938f8a1..803a0b9 100644 --- a/qmlplugin/qmlplugin.pro +++ b/qmlplugin/qmlplugin.pro @@ -3,11 +3,11 @@ TARGET = qtcommercialchartqml CONFIG += qt plugin QT += declarative -!include( ../common.pri ) { +!include( ../config.pri ) { error( "Couldn't find the common.pri file!" ) } -!include( ../integrated.pri ) { - error( "Couldn't find the integrated.pri file !") +!include( ../build.pri ) { + error( "Couldn't find the build.pri file !") } DESTDIR = $$CHART_BUILD_PLUGIN_DIR diff --git a/src/animations/splineanimation.cpp b/src/animations/splineanimation.cpp index 9447064..77e2e67 100644 --- a/src/animations/splineanimation.cpp +++ b/src/animations/splineanimation.cpp @@ -20,6 +20,7 @@ #include "splineanimation_p.h" #include "splinechartitem_p.h" +#include Q_DECLARE_METATYPE(QVector) Q_DECLARE_METATYPE(SplineVector) diff --git a/src/animations/xyanimation.cpp b/src/animations/xyanimation.cpp index 6b57398..d6ed03c 100644 --- a/src/animations/xyanimation.cpp +++ b/src/animations/xyanimation.cpp @@ -20,6 +20,7 @@ #include "xyanimation_p.h" #include "xychartitem_p.h" +#include Q_DECLARE_METATYPE(QVector) diff --git a/src/axis/axis.cpp b/src/axis/axis.cpp index 06e2e1f..9feed2b 100644 --- a/src/axis/axis.cpp +++ b/src/axis/axis.cpp @@ -25,6 +25,7 @@ #include "chartpresenter_p.h" #include "chartanimator_p.h" #include +#include #include static int label_padding = 5; @@ -365,7 +366,7 @@ void Axis::setLayout(QVector &layout) } break; default: - qDebug()<<"Unknown axis type"; + qWarning()<<"Unknown axis type"; break; } diff --git a/src/axis/qchartaxiscategories_p.h b/src/axis/qchartaxiscategories_p.h index c3b05e6..d718dd3 100644 --- a/src/axis/qchartaxiscategories_p.h +++ b/src/axis/qchartaxiscategories_p.h @@ -31,6 +31,7 @@ #define QCHARTAXISCATEGORIES_P_H #include "qchartaxiscategories.h" +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/barchart/qbarset_p.h b/src/barchart/qbarset_p.h index 36999ac..cc1a745 100644 --- a/src/barchart/qbarset_p.h +++ b/src/barchart/qbarset_p.h @@ -2,6 +2,7 @@ #define QBARSET_P_H #include "qbarset.h" +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/chart.cpp b/src/chart.cpp index ead4e39..405be2c 100644 --- a/src/chart.cpp +++ b/src/chart.cpp @@ -20,6 +20,7 @@ #include "chart_p.h" #include "chartpresenter_p.h" +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/chart_p.h b/src/chart_p.h index 32ac524..584299b 100644 --- a/src/chart_p.h +++ b/src/chart_p.h @@ -22,6 +22,7 @@ #define CHART_H #include "qchartglobal.h" +#include #include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/chartconfig_p.h b/src/chartconfig_p.h index 25e9ae3..5545864 100644 --- a/src/chartconfig_p.h +++ b/src/chartconfig_p.h @@ -22,24 +22,28 @@ #define CHARTCONFIG_H #include "qchartglobal.h" + #ifdef Q_CC_MSVC // There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. // This is the case at least with shadow builds. // http://qt-project.org/wiki/jom -const char *buildTime = __DATE__; +#undef DEVELOPER_BUILD +#endif + +#ifndef DEVELOPER_BUILD +const char *buildTime = __TIME__" "__DATE__; const char *gitHead = "unknown"; #else #include "qchartversion_p.h" #endif - QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartConfig { private: ChartConfig(){ - #ifndef QT_NO_DEBUG + #if defined(DEVELOPMENT_BUILD) && !defined(QT_NO_DEBUG) qDebug()<<"buildTime" << buildTime; qDebug()<<"gitHead" << gitHead; #endif diff --git a/src/domain_p.h b/src/domain_p.h index 96ba825..d3e17b3 100644 --- a/src/domain_p.h +++ b/src/domain_p.h @@ -23,6 +23,7 @@ #include "qchartglobal.h" #include #include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/piechart/piechartitem.cpp b/src/piechart/piechartitem.cpp index 15403ca..28e10c9 100644 --- a/src/piechart/piechartitem.cpp +++ b/src/piechart/piechartitem.cpp @@ -25,7 +25,6 @@ #include "chartpresenter_p.h" #include "chartdataset_p.h" #include "chartanimator_p.h" -#include #include #include diff --git a/src/piechart/pieslicedata_p.h b/src/piechart/pieslicedata_p.h index e596ce1..bbf1d7d 100644 --- a/src/piechart/pieslicedata_p.h +++ b/src/piechart/pieslicedata_p.h @@ -25,7 +25,6 @@ #include "qpieslice.h" #include #include -#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp index d88472d..684f5a4 100644 --- a/src/piechart/piesliceitem.cpp +++ b/src/piechart/piesliceitem.cpp @@ -24,7 +24,6 @@ #include "qpieslice.h" #include "chartpresenter_p.h" #include -#include #include #include #include diff --git a/src/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 5dcd08c..495c739 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -27,7 +27,6 @@ #include "chartanimator_p.h" #include "legendmarker_p.h" #include -#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/qchartglobal.h b/src/qchartglobal.h index beb93dd..ad6fb3a 100644 --- a/src/qchartglobal.h +++ b/src/qchartglobal.h @@ -42,13 +42,14 @@ # define QTCOMMERCIALCHART_USE_NAMESPACE #endif -#define CHART_DEBUG chartDebug(3,__LINE__,__FILE__,__FUNCTION__); +#if defined(DEVELOPER_BUILD) && !defined(QT_NO_DEBUG) +#define CHART_DEBUG chartDebug(3,__LINE__,__FILE__,__FUNCTION__) + #include #include -/* -static QDebug chartDebug(int numargs,...) +static inline QDebug chartDebug(int numargs,...) { va_list valist; va_start(valist,numargs); @@ -59,5 +60,5 @@ static QDebug chartDebug(int numargs,...) va_end(valist); return qDebug()< #include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/scroller.cpp b/src/scroller.cpp index f1e7c27..8bf3f6c 100644 --- a/src/scroller.cpp +++ b/src/scroller.cpp @@ -21,6 +21,7 @@ #include "scroller_p.h" #include "qlegend.h" #include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/src.pro b/src/src.pro index d7dab0d..f75963c 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,4 +1,4 @@ -!include( ../common.pri ):error( Couldn't find the common.pri file! ) +!include( ../config.pri ):error( Couldn't find the config.pri file! ) TARGET = QtCommercialChart DESTDIR = $$CHART_BUILD_LIB_DIR TEMPLATE = lib @@ -70,6 +70,7 @@ DEFINES += QTCOMMERCIALCHART_LIBRARY }else{ command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" } + PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal system($$command) } @@ -121,19 +122,20 @@ install_build_private_headers.CONFIG += target_predeps \ QMAKE_EXTRA_COMPILERS += install_build_public_headers \ install_build_private_headers \ +# There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. +# This is the case at least with shadow builds. +# http://qt-project.org/wiki/jom -!win32-msvc*: { - - # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. - # This is the case at least with shadow builds. - # http://qt-project.org/wiki/jom - +developer_build:!win32-msvc*:{ chartversion.target = $$PWD/qchartversion_p.h unix:{ chartversion.commands = @echo \ - "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \ - const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \ + \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\ + $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\ + const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\ + const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \ + $${LITERAL_HASH}endif \" \ > \ $$chartversion.target; }else{ @@ -147,7 +149,7 @@ QMAKE_EXTRA_COMPILERS += install_build_public_headers \ chartversion.depends = $$HEADERS \ $$SOURCES - PRE_TARGETDEPS += $$PWD/qchartversion_p.h + PRE_TARGETDEPS += $$chartversion.target QMAKE_CLEAN += $$PWD/qchartversion_p.h QMAKE_EXTRA_TARGETS += chartversion } diff --git a/test/auto/auto.pri b/test/auto/auto.pri index 2347915..a1a846f 100644 --- a/test/auto/auto.pri +++ b/test/auto/auto.pri @@ -1,17 +1,6 @@ -!include( ../../common.pri ) { - error( "Couldn't find the common.pri file!" ) -} -!include( ../../integrated.pri ) { - error( "Couldn't find the integrated.pri file !") +!include( ../test.pri ) { + error( "Couldn't find the test.pri file!" ) } -TEMPLATE = app CONFIG += qtestlib - -DESTDIR = $$CHART_BUILD_BIN_DIR/test -OBJECTS_DIR = $$CHART_BUILD_DIR/test/$$TARGET -MOC_DIR = $$CHART_BUILD_DIR/test/$$TARGET -UI_DIR = $$CHART_BUILD_DIR/test/$$TARGET -RCC_DIR = $$CHART_BUILD_DIR/test/$$TARGET - !contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_") diff --git a/test/gdpbarchart/widget.cpp b/test/gdpbarchart/widget.cpp index daf3abe..c219685 100644 --- a/test/gdpbarchart/widget.cpp +++ b/test/gdpbarchart/widget.cpp @@ -36,6 +36,7 @@ #include #include #include +#include QTCOMMERCIALCHART_USE_NAMESPACE diff --git a/test/test.pri b/test/test.pri index 3775b22..1467d8a 100644 --- a/test/test.pri +++ b/test/test.pri @@ -1,8 +1,8 @@ -!include( ../common.pri ) { - error( "Couldn't find the common.pri file!" ) +!include( ../config.pri ) { + error( "Couldn't find the config.pri file!" ) } -!include( ../integrated.pri ) { - error( "Couldn't find the integrated.pri file !") +!include( ../build.pri ) { + error( "Couldn't find the build.pri file !") } TEMPLATE = app