##// END OF EJS Templates
OSX install name tool now executed only on QtCommercialChart library during build
Tero Ahola -
r1419:9a2b5d956bb6
parent child
Show More
@@ -1,111 +1,95
1 1
2 2 LIBRARY_NAME = QtCommercialChart
3 3 coverage: CONFIG+=debug
4 4
5 5 ##################### SHADOW CONFIG #################################################
6 6
7 7 !contains($${PWD}, $${OUT_PWD}){
8 8 search = "$$PWD:::"
9 9 temp = $$split(search,"/")
10 10 temp = $$last(temp)
11 11 path = $$replace(search,$$temp,'')
12 12 temp = $$split(OUT_PWD,$$path)
13 13 temp = $$split(temp,'/')
14 14 temp = $$first(temp)
15 15 path = "$${path}$${temp}"
16 16 SHADOW=$$path
17 17 }else{
18 18 SHADOW=$$PWD
19 19 CONFIG-=development_build
20 20 }
21 21
22 22 ##################### BUILD PATHS ##################################################
23 23
24 24 CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include
25 25 CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private
26 26 CHART_BUILD_LIB_DIR = $$SHADOW/lib
27 27 CHART_BUILD_DIR = $$SHADOW/build
28 28 CHART_BUILD_BIN_DIR = $$SHADOW/bin
29 29 CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_BIN_DIR/QtCommercial/Chart
30 30 CHART_BUILD_DOC_DIR = $$SHADOW/doc
31 31
32 32 win32:{
33 33 CHART_BUILD_PUBLIC_HEADER_DIR = $$replace(CHART_BUILD_PUBLIC_HEADER_DIR, "/","\\")
34 34 CHART_BUILD_PRIVATE_HEADER_DIR = $$replace(CHART_BUILD_PRIVATE_HEADER_DIR, "/","\\")
35 35 CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\")
36 36 CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\")
37 37 CHART_BUILD_PLUGIN_DIR = $$replace(CHART_BUILD_PLUGIN_DIR, "/","\\")
38 38 CHART_BUILD_DOC_DIR = $$replace(CHART_BUILD_DOC_DIR, "/","\\")
39 39 CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\")
40 40 }
41 41
42 42 mac: {
43 43 # TODO: The following qmake flags are a work-around to make QtCommercial Charts compile on
44 44 # QtCommercial 4.8. On the other hand Charts builds successfully with Qt open source 4.8
45 45 # without these definitions, so this is probably a configuration issue on QtCommercial 4.8;
46 46 # it should probably define the minimum OSX version to be 10.5...
47 47 QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
48 48 QMAKE_LFLAGS *= -mmacosx-version-min=10.5
49 49
50 50 CHART_BUILD_LIB_DIR = $$CHART_BUILD_BIN_DIR
51 51 }
52 52
53 53 ##################### DEVELOPMENT BUILD ###################################################
54 54
55 55 development_build: {
56 56 DEFINES+=DEVELOPMENT_BUILD
57 57 CONFIG+=debug_and_release
58 58 }
59 59
60 60
61 61 ##################### BUILD CONFIG ########################################################
62 62
63 63 !system_build:{
64 64
65 65 INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR
66 66
67 67 !win32: {
68 68 LIBS += -L $$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR
69 69 }else{
70 70 win32-msvc*: {
71 71 # hack fix for error:
72 72 # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'"
73 73 QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR
74 74 }else{
75 75 LIBS += -L $$CHART_BUILD_LIB_DIR
76 76 }
77 77 }
78 78
79 79 CONFIG(debug, debug|release) {
80 80 mac: LIBRARY_NAME = $$join(LIBRARY_NAME,,,_debug)
81 81 win32: LIBRARY_NAME = $$join(LIBRARY_NAME,,,d)
82 }
83
84 LIBS += -l$$LIBRARY_NAME
85
86 mac: {
87 # This is a hack; we define variables for easier install_name_tool calls from project files of OSX executables/libraries
88 # install_name_tool is used to update the dependencies to chart library to match the local build folder
89 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
90 CONFIG(debug, debug|release) {
91 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
92 }
93 MAC_POST_LINK_PREFIX = install_name_tool -change $$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME
94 MAC_DEMOS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
95 MAC_EXAMPLES_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
96 MAC_TESTS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
97 MAC_AUTOTESTS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET
98 MAC_PLUGINS_BIN_DIR = $$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib"
99 82 }
100
83
84 LIBS += -l$$LIBRARY_NAME
101 85 } else {
102 86 CONFIG += qtcommercialchart
103 87 }
104 88
105 89 ##################### UNIT TESTS ##############################################################
106 90
107 91 CONFIG(debug, debug|release) {
108 92 CONFIG+=test_private
109 93 DEFINES+=BUILD_PRIVATE_UNIT_TESTS
110 94 }
111 95
@@ -1,12 +1,4
1 1 !include( ../demos.pri ):error( "Couldn't find the demos.pri file!" )
2 2 TARGET = chartthemes
3 3 SOURCES = main.cpp themewidget.cpp
4 4 HEADERS = themewidget.h
5
6 # This is a hack to make binaries to use the internal version of the QtCommercial Charts library on OSX
7 #CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
8 #CONFIG(debug, debug|release) {
9 # CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
10 #}
11
12 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../demos.pri ):error( "Couldn't find the demos.pri file!" )
2 2 TARGET = dynamicspline
3 3 HEADERS += chart.h
4 4 SOURCES += main.cpp chart.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,18 +1,15
1 1 !include( ../demos.pri ) {
2 2 error( "Couldn't find the demos.pri file!" )
3 3 }
4 4 TARGET = piechartcustomization
5 5 SOURCES += main.cpp \
6 6 pentool.cpp \
7 7 brushtool.cpp \
8 8 customslice.cpp \
9 9 mainwidget.cpp
10 10
11 11 HEADERS += \
12 12 pentool.h \
13 13 brushtool.h \
14 14 customslice.h \
15 15 mainwidget.h
16
17 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
18
@@ -1,10 +1,8
1 1 !include( ../demos.pri ) {
2 2 error( "Couldn't find the demos.pri file!" )
3 3 }
4 4
5 5 RESOURCES += resources.qrc
6 6 SOURCES += main.cpp
7 7
8 8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
9
10 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,10 +1,8
1 1 !include( ../demos.pri ) {
2 2 error( "Couldn't find the demos.pri file!" )
3 3 }
4 4
5 5 RESOURCES += resources.qrc
6 6 SOURCES += main.cpp
7 7
8 8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
9
10 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,14 +1,12
1 1 !include( ../demos.pri ) {
2 2 error( "Couldn't find the demos.pri file!" )
3 3 }
4 4
5 5 RESOURCES += resources.qrc
6 6 SOURCES += main.cpp\
7 7 customtablemodel.cpp \
8 8 declarativemodel.cpp
9 9 HEADERS += customtablemodel.h \
10 10 declarativemodel.h
11 11
12 12 include(qmlapplicationviewer/qmlapplicationviewer.pri)
13
14 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,10 +1,8
1 1 !include( ../demos.pri ) {
2 2 error( "Couldn't find the demos.pri file!" )
3 3 }
4 4
5 5 RESOURCES += resources.qrc
6 6 SOURCES += main.cpp
7 7
8 8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
9
10 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,10 +1,8
1 1 !include( ../demos.pri ) {
2 2 error( "Couldn't find the demos.pri file!" )
3 3 }
4 4
5 5 RESOURCES += resources.qrc
6 6 SOURCES += main.cpp
7 7
8 8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
9
10 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,7 +1,5
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = areachart
5 5 SOURCES += main.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 TARGET = barchart
6 6 SOURCES += main.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,18 +1,16
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 QT += core gui
6 6
7 7 TARGET = barmodelmapper
8 8 TEMPLATE = app
9 9
10 10
11 11 SOURCES += main.cpp\
12 12 tablewidget.cpp \
13 13 customtablemodel.cpp
14 14
15 15 HEADERS += tablewidget.h \
16 16 customtablemodel.h
17
18 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 TARGET = customchart
6 6 SOURCES += main.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 TARGET = groupedbarchart
6 6 SOURCES += main.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,12 +1,10
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 TARGET = legend
6 6 SOURCES += main.cpp \
7 7 mainwidget.cpp
8 8
9 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
10
11 9 HEADERS += \
12 10 mainwidget.h
@@ -1,7 +1,5
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = linechart
5 5 SOURCES += main.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,18 +1,16
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 QT += core gui
6 6
7 7 TARGET = modeldata
8 8 TEMPLATE = app
9 9
10 10
11 11 SOURCES += main.cpp\
12 12 tablewidget.cpp \
13 13 customtablemodel.cpp
14 14
15 15 HEADERS += tablewidget.h \
16 16 customtablemodel.h
17
18 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 TARGET = percentbarchart
6 6 SOURCES += main.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,7 +1,5
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = piechart
5 5 SOURCES += main.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,13 +1,11
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = piechartdrilldown
5 5 SOURCES += main.cpp \
6 6 drilldownslice.cpp \
7 7 drilldownchart.cpp
8 8
9 9 HEADERS += \
10 10 drilldownchart.h \
11 11 drilldownslice.h
12
13 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = presenterchart
5 5 HEADERS += chartview.h
6 6 SOURCES += main.cpp chartview.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,11 +1,9
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = scatterchart
5 5 SOURCES += main.cpp \
6 6 chartview.cpp
7 7
8 8 HEADERS += \
9 9 chartview.h
10
11 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,11 +1,9
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4
5 5 TARGET = scatterinteractions
6 6 SOURCES += main.cpp \
7 7 chartview.cpp
8 8 HEADERS += \
9 9 chartview.h
10
11 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,7 +1,5
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = splinechart
5 5 SOURCES += main.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,7 +1,5
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = stackedbarchart
5 5 SOURCES += main.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = stackedbarchartdrilldown
5 5 SOURCES += main.cpp drilldownseries.cpp drilldownchart.cpp
6 6 HEADERS += drilldownseries.h drilldownchart.h
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,9 +1,7
1 1 !include( ../examples.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 TARGET = zoomlinechart
5 5 HEADERS += chart.h chartview.h
6 6
7 7 SOURCES += main.cpp chart.cpp chartview.cpp
8
9 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_EXAMPLES_BIN_DIR"
@@ -1,45 +1,44
1 1 TARGET = qtcommercialchartqml
2 2 QT += declarative
3 3
4 4 !include( ../plugins.pri ) {
5 5 error( "Couldn't find the plugins.pri file!" )
6 6 }
7 7
8 8 contains(QT_MAJOR_VERSION, 5) {
9 9 # TODO: QtQuick2 not supported by the implementation currently
10 10 DEFINES += QTQUICK2
11 11 }
12 12
13 13 SOURCES += \
14 14 plugin.cpp \
15 15 declarativechart.cpp \
16 16 declarativexypoint.cpp \
17 17 declarativexyseries.cpp \
18 18 declarativelineseries.cpp \
19 19 declarativesplineseries.cpp \
20 20 declarativeareaseries.cpp \
21 21 declarativescatterseries.cpp \
22 22 declarativepieseries.cpp \
23 23 declarativebarseries.cpp
24 24
25 25 HEADERS += \
26 26 declarativechart.h \
27 27 declarativexypoint.h \
28 28 declarativexyseries.h \
29 29 declarativelineseries.h \
30 30 declarativesplineseries.h \
31 31 declarativeareaseries.h \
32 32 declarativescatterseries.h \
33 33 declarativepieseries.h \
34 34 declarativebarseries.h
35 35
36 36 TARGETPATH = QtCommercial/Chart
37 37 target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
38 38 qmldir.files += $$PWD/qmldir
39 39 qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
40 40 INSTALLS += target qmldir
41 41
42 42 FILE = $$PWD/qmldir
43 43 win32:{FILE = $$replace(FILE, "/","\\")}
44 44 QMAKE_POST_LINK += $$QMAKE_COPY $$FILE $$CHART_BUILD_PLUGIN_DIR
45 !system_build:mac: QMAKE_POST_LINK += " & $$MAC_POST_LINK_PREFIX $$MAC_PLUGINS_BIN_DIR"
@@ -1,235 +1,242
1 1 !include( ../config.pri ):error( "Couldn't find the config.pri file!" )
2 2
3 3 ############################# BUILD CONFIG ######################################
4 4
5 5 TARGET = $$LIBRARY_NAME
6 6 DESTDIR = $$CHART_BUILD_LIB_DIR
7 7 TEMPLATE = lib
8 8 QT = core gui
9 9 DEFINES += QTCOMMERCIALCHART_LIBRARY
10 10 win32:CONFIG += create_prl
11 11 # treat warnings as errors
12 12 win32-msvc*: {
13 13 QMAKE_CXXFLAGS += /WX
14 14 } else {
15 15 QMAKE_CXXFLAGS += -Werror
16 16 }
17 17
18 18 unix:{
19 19 QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
20 20 }
21 21
22 22 ############################# DEPEDENCES ########################################
23 23
24 24 win32-msvc*: LIBS += User32.lib
25 25 LIBS -= -l$$LIBRARY_NAME
26 26 INCLUDEPATH += ../include .
27 27
28 28 ############################# SOURCES ##########################################
29 29
30 30 SOURCES += \
31 31 $$PWD/chartdataset.cpp \
32 32 $$PWD/chartpresenter.cpp \
33 33 $$PWD/charttheme.cpp \
34 34 $$PWD/domain.cpp \
35 35 $$PWD/qchart.cpp \
36 36 $$PWD/qchartview.cpp \
37 37 $$PWD/qabstractseries.cpp \
38 38 $$PWD/chartbackground.cpp \
39 39 $$PWD/chart.cpp \
40 40 $$PWD/scroller.cpp
41 41 PRIVATE_HEADERS += \
42 42 $$PWD/chartdataset_p.h \
43 43 $$PWD/chartitem_p.h \
44 44 $$PWD/chartpresenter_p.h \
45 45 $$PWD/charttheme_p.h \
46 46 $$PWD/domain_p.h \
47 47 $$PWD/chartbackground_p.h \
48 48 $$PWD/chart_p.h \
49 49 $$PWD/chartconfig_p.h \
50 50 $$PWD/qchart_p.h \
51 51 $$PWD/qchartview_p.h \
52 52 $$PWD/scroller_p.h \
53 53 $$PWD/qabstractseries_p.h
54 54 PUBLIC_HEADERS += \
55 55 $$PWD/qchart.h \
56 56 $$PWD/qchartglobal.h \
57 57 $$PWD/qabstractseries.h \
58 58 $$PWD/qchartview.h
59 59
60 60 include(animations/animations.pri)
61 61 include(areachart/areachart.pri)
62 62 include(axis/axis.pri)
63 63 include(barchart/barchart.pri)
64 64 include(legend/legend.pri)
65 65 include(linechart/linechart.pri)
66 66 include(piechart/piechart.pri)
67 67 include(scatterchart/scatter.pri)
68 68 include(splinechart/splinechart.pri)
69 69 include(themes/themes.pri)
70 70 include(xychart/xychart.pri)
71 71
72 72 HEADERS += $$PUBLIC_HEADERS
73 73 HEADERS += $$PRIVATE_HEADERS
74 74 HEADERS += $$THEMES
75 75
76 76 ############################# BUILD PATH ##########################################
77 77
78 78 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
79 79 MOC_DIR = $$CHART_BUILD_DIR/lib
80 80 UI_DIR = $$CHART_BUILD_DIR/lib
81 81 RCC_DIR = $$CHART_BUILD_DIR/lib
82 82
83 83 ############################# PUBLIC HEADERS GENERTOR ##########################################
84 84
85 85 #this is very primitive and lame parser , TODO: make perl script insted
86 86 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
87 87 {
88 88 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
89 89 win32:{
90 90 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
91 91 }else{
92 92 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
93 93 }
94 94 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
95 95 system($$command)
96 96 }
97 97
98 98 for(file, PUBLIC_HEADERS) {
99 99 name = $$split(file,'/')
100 100 name = $$last(name)
101 101 class = "$$cat($$file)"
102 102 class = $$find(class,class)
103 103 !isEmpty(class){
104 104 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
105 105 class = $$member(class,1)
106 106 class = $$split(class,' ')
107 107 class = $$replace(class,' ','')
108 108 class = $$member(class,0)
109 109 win32:{
110 110 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
111 111 }else{
112 112 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
113 113 }
114 114 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
115 115 system($$command)
116 116 }
117 117 }
118 118
119 119 ############################# INSTALLERS ##########################################
120 120
121 121 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
122 122 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
123 123 INSTALLS += public_headers
124 124
125 125 install_build_public_headers.name = build_public_headers
126 126 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
127 127 install_build_public_headers.input = PUBLIC_HEADERS
128 128 install_build_public_headers.commands = $$QMAKE_COPY \
129 129 ${QMAKE_FILE_NAME} \
130 130 $$CHART_BUILD_PUBLIC_HEADER_DIR
131 131 install_build_public_headers.CONFIG += target_predeps \
132 132 no_link
133 133
134 134 install_build_private_headers.name = buld_private_headers
135 135 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
136 136 install_build_private_headers.input = PRIVATE_HEADERS
137 137 install_build_private_headers.commands = $$QMAKE_COPY \
138 138 ${QMAKE_FILE_NAME} \
139 139 $$CHART_BUILD_PRIVATE_HEADER_DIR
140 140 install_build_private_headers.CONFIG += target_predeps \
141 141 no_link
142 142
143 143 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
144 144 install_build_private_headers \
145 145
146 146 win32:{
147 147 bintarget.CONFIG += no_check_exist
148 148 bintarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
149 149 win32-msvc*:CONFIG(debug, debug|release): {
150 150 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
151 151 }
152 152 bintarget.path = $$[QT_INSTALL_BINS]
153 153
154 154 libtarget.CONFIG += no_check_exist
155 155 libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl
156 156 win32-msvc*: {
157 157 libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib
158 158 } else {
159 159 libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a
160 160 }
161 161 libtarget.path = $$[QT_INSTALL_LIBS]
162 162
163 163 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
164 164 INSTALLS += bintarget libtarget
165 165 }else{
166 166 target.path=$$[QT_INSTALL_LIBS]
167 167 INSTALLS += target
168 168 }
169
170 mac: {
171 # Update the name (id) of the library on OSX to point to the lib dir
172 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
173 QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME"
174 }
175
169 176 ################################ DEVELOPMENT BUILD ##########################################
170 177 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
171 178 # This is the case at least with shadow builds.
172 179 # http://qt-project.org/wiki/jom
173 180
174 181 development_build:!win32-msvc*:{
175 182 chartversion.target = $$PWD/qchartversion_p.h
176 183
177 184 unix:{
178 185 chartversion.commands = @echo \
179 186 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
180 187 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
181 188 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
182 189 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
183 190 $${LITERAL_HASH}endif \" \
184 191 > \
185 192 $$chartversion.target;
186 193 }else{
187 194 chartversion.commands = @echo \
188 195 "const char *buildTime = \"%date%_%time%\" ; \
189 196 const char *gitHead = \"unknown\" ; " \
190 197 > \
191 198 $$chartversion.target
192 199 }
193 200
194 201 chartversion.depends = $$HEADERS \
195 202 $$SOURCES
196 203
197 204 PRE_TARGETDEPS += $$chartversion.target
198 205 QMAKE_CLEAN += $$PWD/qchartversion_p.h
199 206 QMAKE_EXTRA_TARGETS += chartversion
200 207 }
201 208
202 209 ############################### CLEAN ###########################################
203 210
204 211 unix:QMAKE_DISTCLEAN += -r \
205 212 $$CHART_BUILD_HEADER_DIR \
206 213 $$CHART_BUILD_LIB_DIR
207 214 win32:QMAKE_DISTCLEAN += /Q \
208 215 $$CHART_BUILD_HEADER_DIR \
209 216 $$CHART_BUILD_LIB_DIR
210 217
211 218 ############################## COVERAGE #########################################
212 219
213 220 unix:coverage:{
214 221
215 222 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
216 223 QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
217 224
218 225 LIBS += -lgcov
219 226
220 227 QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info
221 228 QMAKE_EXTRA_TARGETS += preparecoverage gencoverage
222 229
223 230 preparecoverage.target = prepare_coverage
224 231 preparecoverage.depends = all
225 232 preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\
226 233 lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD;
227 234
228 235 gencoverage.target = gen_coverage
229 236 gencoverage.depends = all
230 237 gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\
231 238 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;\
232 239 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;\
233 240 lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info;
234 241 }
235 242
@@ -1,7 +1,5
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4
5 5 SOURCES += tst_chartdataset.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_domain.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4
5 5 SOURCES += \
6 6 tst_qbarmodelmapper.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qbarseries.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qbarset.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qchart.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qchartview.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qgroupedbarseries.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,7 +1,5
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 HEADERS += ../qxyseries/tst_qxyseries.h
5 5 SOURCES += tst_qlineseries.cpp ../qxyseries/tst_qxyseries.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qpercentbarseries.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4
5 5 SOURCES += \
6 6 tst_qpiemodelmapper.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qpieseries.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qpieslice.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ):error( "Couldn't find the auto.pri file!" )
2 2
3 3 HEADERS += ../qxyseries/tst_qxyseries.h
4 4 SOURCES += tst_qscatterseries.cpp ../qxyseries/tst_qxyseries.cpp
5
6 !system_build:mac:QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,7 +1,5
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 HEADERS += ../qxyseries/tst_qxyseries.h
5 5 SOURCES += tst_qsplineseries.cpp ../qxyseries/tst_qxyseries.cpp
6
7 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,6 +1,4
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4 SOURCES += tst_qstackedbarseries.cpp
5
6 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,8 +1,6
1 1 !include( ../auto.pri ) {
2 2 error( "Couldn't find the auto.pri file!" )
3 3 }
4 4
5 5 SOURCES += \
6 6 tst_qxymodelmapper.cpp
7
8 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_AUTOTESTS_BIN_DIR"
@@ -1,20 +1,18
1 1 !include( ../tests.pri ) {
2 2 error( "Couldn't find the test.pri file!" )
3 3 }
4 4
5 5 TEMPLATE = app
6 6
7 7 QT += core gui
8 8 contains(QT_MAJOR_VERSION, 5) {
9 9 QT += widgets
10 10 }
11 11
12 12 SOURCES += main.cpp \
13 13 mainwidget.cpp \
14 14 dataseriedialog.cpp
15 15
16 16 HEADERS += \
17 17 mainwidget.h \
18 18 dataseriedialog.h
19
20 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
@@ -1,10 +1,8
1 1 !include( ../tests.pri ) {
2 2 error( "Couldn't find the test.pri file!" )
3 3 }
4 4
5 5 RESOURCES += resources.qrc
6 6 SOURCES += main.cpp
7 7
8 8 include(qmlapplicationviewer/qmlapplicationviewer.pri)
9
10 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_DEMOS_BIN_DIR"
@@ -1,9 +1,7
1 1 !include( ../tests.pri ) {
2 2 error( "Couldn't find the examples.pri file!" )
3 3 }
4 4 QT+=opengl
5 5 TARGET = wavechart
6 6 SOURCES += main.cpp wavechart.cpp
7 7 HEADERS += wavechart.h
8
9 !system_build:mac: QMAKE_POST_LINK += "$$MAC_POST_LINK_PREFIX $$MAC_TESTS_BIN_DIR"
General Comments 0
You need to be logged in to leave comments. Login now