src.pro
251 lines
| 8.6 KiB
| text/idl
|
PrologLexer
/ src / src.pro
|
r1183 | !include( ../config.pri ):error( "Couldn't find the config.pri file!" ) | ||
|
r1021 | |||
|
r1041 | ############################# BUILD CONFIG ###################################### | ||
|
r1021 | TARGET = $$LIBRARY_NAME | ||
|
r39 | DESTDIR = $$CHART_BUILD_LIB_DIR | ||
|
r36 | TEMPLATE = lib | ||
|
r1021 | QT = core gui | ||
|
r1041 | DEFINES += QTCOMMERCIALCHART_LIBRARY | ||
|
r1043 | win32:CONFIG += create_prl | ||
|
r1041 | # treat warnings as errors | ||
win32-msvc*: { | ||||
QMAKE_CXXFLAGS += /WX | ||||
} else { | ||||
|
r1051 | QMAKE_CXXFLAGS += -Werror | ||
} | ||||
unix:{ | ||||
QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden | ||||
|
r1041 | } | ||
############################# DEPEDENCES ######################################## | ||||
|
r1021 | |||
|
r606 | win32-msvc*: LIBS += User32.lib | ||
|
r1021 | LIBS -= -l$$LIBRARY_NAME | ||
|
r1041 | INCLUDEPATH += ../include . | ||
############################# SOURCES ########################################## | ||||
|
r1021 | |||
|
r478 | SOURCES += \ | ||
|
r708 | $$PWD/chartdataset.cpp \ | ||
$$PWD/chartpresenter.cpp \ | ||||
$$PWD/charttheme.cpp \ | ||||
$$PWD/domain.cpp \ | ||||
$$PWD/qchart.cpp \ | ||||
$$PWD/qchartview.cpp \ | ||||
|
r988 | $$PWD/qabstractseries.cpp \ | ||
|
r708 | $$PWD/chartbackground.cpp \ | ||
|
r1736 | $$PWD/chartelement.cpp \ | ||
|
r1534 | $$PWD/scroller.cpp \ | ||
$$PWD/chartlayout.cpp | ||||
|
r478 | PRIVATE_HEADERS += \ | ||
|
r708 | $$PWD/chartdataset_p.h \ | ||
$$PWD/chartitem_p.h \ | ||||
$$PWD/chartpresenter_p.h \ | ||||
$$PWD/charttheme_p.h \ | ||||
$$PWD/domain_p.h \ | ||||
$$PWD/chartbackground_p.h \ | ||||
|
r1736 | $$PWD/chartelement_p.h \ | ||
|
r740 | $$PWD/chartconfig_p.h \ | ||
|
r746 | $$PWD/qchart_p.h \ | ||
|
r855 | $$PWD/qchartview_p.h \ | ||
|
r938 | $$PWD/scroller_p.h \ | ||
|
r1534 | $$PWD/qabstractseries_p.h \ | ||
$$PWD/chartlayout_p.h | ||||
|
r547 | PUBLIC_HEADERS += \ | ||
|
r708 | $$PWD/qchart.h \ | ||
$$PWD/qchartglobal.h \ | ||||
|
r988 | $$PWD/qabstractseries.h \ | ||
|
r957 | $$PWD/qchartview.h | ||
|
r530 | |||
|
r957 | include(animations/animations.pri) | ||
include(areachart/areachart.pri) | ||||
|
r478 | include(axis/axis.pri) | ||
|
r360 | include(barchart/barchart.pri) | ||
|
r957 | include(legend/legend.pri) | ||
include(linechart/linechart.pri) | ||||
|
r146 | include(piechart/piechart.pri) | ||
|
r1084 | include(scatterchart/scatter.pri) | ||
|
r295 | include(splinechart/splinechart.pri) | ||
|
r708 | include(themes/themes.pri) | ||
|
r957 | include(xychart/xychart.pri) | ||
|
r584 | |||
|
r194 | HEADERS += $$PUBLIC_HEADERS | ||
|
r36 | HEADERS += $$PRIVATE_HEADERS | ||
|
r143 | HEADERS += $$THEMES | ||
|
r1041 | |||
############################# BUILD PATH ########################################## | ||||
|
r740 | |||
|
r39 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib | ||
MOC_DIR = $$CHART_BUILD_DIR/lib | ||||
UI_DIR = $$CHART_BUILD_DIR/lib | ||||
RCC_DIR = $$CHART_BUILD_DIR/lib | ||||
|
r588 | |||
|
r1041 | ############################# PUBLIC HEADERS GENERTOR ########################################## | ||
|
r603 | #this is very primitive and lame parser , TODO: make perl script insted | ||
|
r711 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) | ||
|
r591 | { | ||
|
r603 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) | ||
|
r711 | win32:{ | ||
command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" | ||||
}else{ | ||||
command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" | ||||
} | ||||
|
r996 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal | ||
|
r711 | system($$command) | ||
|
r591 | } | ||
|
r588 | for(file, PUBLIC_HEADERS) { | ||
name = $$split(file,'/') | ||||
name = $$last(name) | ||||
class = "$$cat($$file)" | ||||
class = $$find(class,class) | ||||
!isEmpty(class){ | ||||
class = $$split(class,QTCOMMERCIALCHART_EXPORT) | ||||
class = $$member(class,1) | ||||
|
r589 | class = $$split(class,' ') | ||
|
r588 | class = $$replace(class,' ','') | ||
class = $$member(class,0) | ||||
|
r627 | win32:{ | ||
command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" | ||||
}else{ | ||||
command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" | ||||
} | ||||
|
r588 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class | ||
|
r591 | system($$command) | ||
|
r588 | } | ||
} | ||||
|
r1041 | ############################# INSTALLERS ########################################## | ||
|
r36 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart | ||
|
r588 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS | ||
|
r1041 | INSTALLS += public_headers | ||
|
r588 | |||
install_build_public_headers.name = build_public_headers | ||||
|
r193 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h | ||
install_build_public_headers.input = PUBLIC_HEADERS | ||||
install_build_public_headers.commands = $$QMAKE_COPY \ | ||||
|
r145 | ${QMAKE_FILE_NAME} \ | ||
|
r193 | $$CHART_BUILD_PUBLIC_HEADER_DIR | ||
install_build_public_headers.CONFIG += target_predeps \ | ||||
|
r145 | no_link | ||
|
r588 | |||
install_build_private_headers.name = buld_private_headers | ||||
|
r193 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h | ||
install_build_private_headers.input = PRIVATE_HEADERS | ||||
install_build_private_headers.commands = $$QMAKE_COPY \ | ||||
${QMAKE_FILE_NAME} \ | ||||
$$CHART_BUILD_PRIVATE_HEADER_DIR | ||||
install_build_private_headers.CONFIG += target_predeps \ | ||||
no_link | ||||
|
r588 | |||
|
r360 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ | ||
|
r588 | install_build_private_headers \ | ||
|
r1041 | |||
win32:{ | ||||
|
r1047 | bintarget.CONFIG += no_check_exist | ||
|
r1440 | !staticlib: { | ||
bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll | ||||
} | ||||
|
r1047 | win32-msvc*:CONFIG(debug, debug|release): { | ||
|
r1214 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb | ||
|
r1047 | } | ||
|
r1044 | bintarget.path = $$[QT_INSTALL_BINS] | ||
|
r1047 | |||
libtarget.CONFIG += no_check_exist | ||||
|
r1214 | libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl | ||
|
r1047 | win32-msvc*: { | ||
|
r1214 | libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib | ||
|
r1047 | } else { | ||
|
r1214 | libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a | ||
|
r1047 | } | ||
|
r1044 | libtarget.path = $$[QT_INSTALL_LIBS] | ||
|
r1047 | |||
|
r1041 | DLLDESTDIR = $$CHART_BUILD_BIN_DIR | ||
|
r1044 | INSTALLS += bintarget libtarget | ||
}else{ | ||||
target.path=$$[QT_INSTALL_LIBS] | ||||
INSTALLS += target | ||||
} | ||||
|
r1419 | |||
|
r1442 | mac: !staticlib: { | ||
|
r1421 | # Update the name (id) of the library on OSX to point to the lib path | ||
|
r1419 | MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib" | ||
QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME" | ||||
|
r1421 | |||
# Update the name (id) of the installed library on OSX to point to the installation path | ||||
postinstall.path = $$[QT_INSTALL_LIBS] | ||||
postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME" | ||||
INSTALLS += postinstall | ||||
|
r1419 | } | ||
|
r1041 | ################################ DEVELOPMENT BUILD ########################################## | ||
|
r996 | # 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 | ||||
|
r715 | |||
|
r998 | development_build:!win32-msvc*:{ | ||
|
r808 | chartversion.target = $$PWD/qchartversion_p.h | ||
unix:{ | ||||
chartversion.commands = @echo \ | ||||
|
r996 | \" $${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 \" \ | ||||
|
r808 | > \ | ||
$$chartversion.target; | ||||
}else{ | ||||
chartversion.commands = @echo \ | ||||
"const char *buildTime = \"%date%_%time%\" ; \ | ||||
const char *gitHead = \"unknown\" ; " \ | ||||
> \ | ||||
$$chartversion.target | ||||
} | ||||
chartversion.depends = $$HEADERS \ | ||||
$$SOURCES | ||||
|
r996 | PRE_TARGETDEPS += $$chartversion.target | ||
|
r808 | QMAKE_CLEAN += $$PWD/qchartversion_p.h | ||
QMAKE_EXTRA_TARGETS += chartversion | ||||
|
r715 | } | ||
|
r808 | |||
|
r1041 | ############################### CLEAN ########################################### | ||
|
r145 | unix:QMAKE_DISTCLEAN += -r \ | ||
$$CHART_BUILD_HEADER_DIR \ | ||||
$$CHART_BUILD_LIB_DIR | ||||
win32:QMAKE_DISTCLEAN += /Q \ | ||||
$$CHART_BUILD_HEADER_DIR \ | ||||
$$CHART_BUILD_LIB_DIR | ||||
|
r588 | |||
|
r1084 | ############################## COVERAGE ######################################### | ||
|
r1087 | unix:coverage:{ | ||
|
r1084 | |||
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage | ||||
QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage | ||||
LIBS += -lgcov | ||||
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info | ||||
QMAKE_EXTRA_TARGETS += preparecoverage gencoverage | ||||
preparecoverage.target = prepare_coverage | ||||
preparecoverage.depends = all | ||||
preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\ | ||||
lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD; | ||||
gencoverage.target = gen_coverage | ||||
gencoverage.depends = all | ||||
gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\ | ||||
lcov -e ../coverage/base.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/base.info;\ | ||||
lcov -e ../coverage/src.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/src.info;\ | ||||
lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info; | ||||
} | ||||