##// END OF EJS Templates
Another version of src.pro fun
Michal Klocek -
r1043:812fffe40dcc
parent child
Show More
@@ -1,195 +1,195
1 !include( ../config.pri ):error( Couldn't find the config.pri file! )
1 !include( ../config.pri ):error( Couldn't find the config.pri file! )
2
2
3 ############################# BUILD CONFIG ######################################
3 ############################# BUILD CONFIG ######################################
4
4
5 TARGET = $$LIBRARY_NAME
5 TARGET = $$LIBRARY_NAME
6 DESTDIR = $$CHART_BUILD_LIB_DIR
6 DESTDIR = $$CHART_BUILD_LIB_DIR
7 TEMPLATE = lib
7 TEMPLATE = lib
8 QT = core gui
8 QT = core gui
9 DEFINES += QTCOMMERCIALCHART_LIBRARY
9 DEFINES += QTCOMMERCIALCHART_LIBRARY
10 win32:CONFIG+=create_prl
10 win32:CONFIG += create_prl
11 # treat warnings as errors
11 # treat warnings as errors
12 win32-msvc*: {
12 win32-msvc*: {
13 QMAKE_CXXFLAGS += /WX
13 QMAKE_CXXFLAGS += /WX
14 } else {
14 } else {
15 QMAKE_CXXFLAGS += -Werror
15 QMAKE_CXXFLAGS += -Werror
16 }
16 }
17
17
18 ############################# DEPEDENCES ########################################
18 ############################# DEPEDENCES ########################################
19
19
20 win32-msvc*: LIBS += User32.lib
20 win32-msvc*: LIBS += User32.lib
21 LIBS -= -l$$LIBRARY_NAME
21 LIBS -= -l$$LIBRARY_NAME
22 INCLUDEPATH += ../include .
22 INCLUDEPATH += ../include .
23
23
24 ############################# SOURCES ##########################################
24 ############################# SOURCES ##########################################
25
25
26 SOURCES += \
26 SOURCES += \
27 $$PWD/chartdataset.cpp \
27 $$PWD/chartdataset.cpp \
28 $$PWD/chartpresenter.cpp \
28 $$PWD/chartpresenter.cpp \
29 $$PWD/charttheme.cpp \
29 $$PWD/charttheme.cpp \
30 $$PWD/domain.cpp \
30 $$PWD/domain.cpp \
31 $$PWD/qchart.cpp \
31 $$PWD/qchart.cpp \
32 $$PWD/qchartview.cpp \
32 $$PWD/qchartview.cpp \
33 $$PWD/qabstractseries.cpp \
33 $$PWD/qabstractseries.cpp \
34 $$PWD/chartbackground.cpp \
34 $$PWD/chartbackground.cpp \
35 $$PWD/chart.cpp \
35 $$PWD/chart.cpp \
36 $$PWD/scroller.cpp
36 $$PWD/scroller.cpp
37 PRIVATE_HEADERS += \
37 PRIVATE_HEADERS += \
38 $$PWD/chartdataset_p.h \
38 $$PWD/chartdataset_p.h \
39 $$PWD/chartitem_p.h \
39 $$PWD/chartitem_p.h \
40 $$PWD/chartpresenter_p.h \
40 $$PWD/chartpresenter_p.h \
41 $$PWD/charttheme_p.h \
41 $$PWD/charttheme_p.h \
42 $$PWD/domain_p.h \
42 $$PWD/domain_p.h \
43 $$PWD/chartbackground_p.h \
43 $$PWD/chartbackground_p.h \
44 $$PWD/chart_p.h \
44 $$PWD/chart_p.h \
45 $$PWD/chartconfig_p.h \
45 $$PWD/chartconfig_p.h \
46 $$PWD/qchart_p.h \
46 $$PWD/qchart_p.h \
47 $$PWD/qchartview_p.h \
47 $$PWD/qchartview_p.h \
48 $$PWD/scroller_p.h \
48 $$PWD/scroller_p.h \
49 $$PWD/qabstractseries_p.h
49 $$PWD/qabstractseries_p.h
50 PUBLIC_HEADERS += \
50 PUBLIC_HEADERS += \
51 $$PWD/qchart.h \
51 $$PWD/qchart.h \
52 $$PWD/qchartglobal.h \
52 $$PWD/qchartglobal.h \
53 $$PWD/qabstractseries.h \
53 $$PWD/qabstractseries.h \
54 $$PWD/qchartview.h
54 $$PWD/qchartview.h
55
55
56 include(animations/animations.pri)
56 include(animations/animations.pri)
57 include(areachart/areachart.pri)
57 include(areachart/areachart.pri)
58 include(axis/axis.pri)
58 include(axis/axis.pri)
59 include(barchart/barchart.pri)
59 include(barchart/barchart.pri)
60 include(legend/legend.pri)
60 include(legend/legend.pri)
61 include(linechart/linechart.pri)
61 include(linechart/linechart.pri)
62 include(piechart/piechart.pri)
62 include(piechart/piechart.pri)
63 include(scatterseries/scatter.pri)
63 include(scatterseries/scatter.pri)
64 include(splinechart/splinechart.pri)
64 include(splinechart/splinechart.pri)
65 include(themes/themes.pri)
65 include(themes/themes.pri)
66 include(xychart/xychart.pri)
66 include(xychart/xychart.pri)
67
67
68 HEADERS += $$PUBLIC_HEADERS
68 HEADERS += $$PUBLIC_HEADERS
69 HEADERS += $$PRIVATE_HEADERS
69 HEADERS += $$PRIVATE_HEADERS
70 HEADERS += $$THEMES
70 HEADERS += $$THEMES
71
71
72 ############################# BUILD PATH ##########################################
72 ############################# BUILD PATH ##########################################
73
73
74 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
74 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
75 MOC_DIR = $$CHART_BUILD_DIR/lib
75 MOC_DIR = $$CHART_BUILD_DIR/lib
76 UI_DIR = $$CHART_BUILD_DIR/lib
76 UI_DIR = $$CHART_BUILD_DIR/lib
77 RCC_DIR = $$CHART_BUILD_DIR/lib
77 RCC_DIR = $$CHART_BUILD_DIR/lib
78
78
79 ############################# PUBLIC HEADERS GENERTOR ##########################################
79 ############################# PUBLIC HEADERS GENERTOR ##########################################
80
80
81 #this is very primitive and lame parser , TODO: make perl script insted
81 #this is very primitive and lame parser , TODO: make perl script insted
82 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
82 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
83 {
83 {
84 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
84 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
85 win32:{
85 win32:{
86 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
86 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
87 }else{
87 }else{
88 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
88 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
89 }
89 }
90 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
90 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
91 system($$command)
91 system($$command)
92 }
92 }
93
93
94 for(file, PUBLIC_HEADERS) {
94 for(file, PUBLIC_HEADERS) {
95 name = $$split(file,'/')
95 name = $$split(file,'/')
96 name = $$last(name)
96 name = $$last(name)
97 class = "$$cat($$file)"
97 class = "$$cat($$file)"
98 class = $$find(class,class)
98 class = $$find(class,class)
99 !isEmpty(class){
99 !isEmpty(class){
100 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
100 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
101 class = $$member(class,1)
101 class = $$member(class,1)
102 class = $$split(class,' ')
102 class = $$split(class,' ')
103 class = $$replace(class,' ','')
103 class = $$replace(class,' ','')
104 class = $$member(class,0)
104 class = $$member(class,0)
105 win32:{
105 win32:{
106 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
106 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
107 }else{
107 }else{
108 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
108 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
109 }
109 }
110 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
110 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
111 system($$command)
111 system($$command)
112 }
112 }
113 }
113 }
114
114
115 ############################# INSTALLERS ##########################################
115 ############################# INSTALLERS ##########################################
116
116
117 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
117 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
118 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
118 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
119 INSTALLS += public_headers
119 INSTALLS += public_headers
120
120
121 install_build_public_headers.name = build_public_headers
121 install_build_public_headers.name = build_public_headers
122 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
122 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
123 install_build_public_headers.input = PUBLIC_HEADERS
123 install_build_public_headers.input = PUBLIC_HEADERS
124 install_build_public_headers.commands = $$QMAKE_COPY \
124 install_build_public_headers.commands = $$QMAKE_COPY \
125 ${QMAKE_FILE_NAME} \
125 ${QMAKE_FILE_NAME} \
126 $$CHART_BUILD_PUBLIC_HEADER_DIR
126 $$CHART_BUILD_PUBLIC_HEADER_DIR
127 install_build_public_headers.CONFIG += target_predeps \
127 install_build_public_headers.CONFIG += target_predeps \
128 no_link
128 no_link
129
129
130 install_build_private_headers.name = buld_private_headers
130 install_build_private_headers.name = buld_private_headers
131 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
131 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
132 install_build_private_headers.input = PRIVATE_HEADERS
132 install_build_private_headers.input = PRIVATE_HEADERS
133 install_build_private_headers.commands = $$QMAKE_COPY \
133 install_build_private_headers.commands = $$QMAKE_COPY \
134 ${QMAKE_FILE_NAME} \
134 ${QMAKE_FILE_NAME} \
135 $$CHART_BUILD_PRIVATE_HEADER_DIR
135 $$CHART_BUILD_PRIVATE_HEADER_DIR
136 install_build_private_headers.CONFIG += target_predeps \
136 install_build_private_headers.CONFIG += target_predeps \
137 no_link
137 no_link
138
138
139 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
139 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
140 install_build_private_headers \
140 install_build_private_headers \
141
141
142 target.path=$$[QT_INSTALL_LIBS]
142 target.path=$$[QT_INSTALL_LIBS]
143 INSTALLS += target
143 INSTALLS += target
144
144
145 win32:{
145 win32:{
146 dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
146 dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
147 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
147 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
148 dlltarget.path=$$[QT_INSTALL_BINS]
148 dlltarget.path=$$[QT_INSTALL_BINS]
149 target.files= ..\\lib\\*.a ..\\lib\\*.prl
149 target.files = ..\\lib\\*.a ..\\lib\\*.prl
150 INSTALLS += dlltarget
150 INSTALLS += dlltarget
151 }
151 }
152
152
153
153
154 ################################ DEVELOPMENT BUILD ##########################################
154 ################################ DEVELOPMENT BUILD ##########################################
155 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
155 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
156 # This is the case at least with shadow builds.
156 # This is the case at least with shadow builds.
157 # http://qt-project.org/wiki/jom
157 # http://qt-project.org/wiki/jom
158
158
159 development_build:!win32-msvc*:{
159 development_build:!win32-msvc*:{
160 chartversion.target = $$PWD/qchartversion_p.h
160 chartversion.target = $$PWD/qchartversion_p.h
161
161
162 unix:{
162 unix:{
163 chartversion.commands = @echo \
163 chartversion.commands = @echo \
164 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
164 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
165 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
165 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
166 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
166 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
167 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
167 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
168 $${LITERAL_HASH}endif \" \
168 $${LITERAL_HASH}endif \" \
169 > \
169 > \
170 $$chartversion.target;
170 $$chartversion.target;
171 }else{
171 }else{
172 chartversion.commands = @echo \
172 chartversion.commands = @echo \
173 "const char *buildTime = \"%date%_%time%\" ; \
173 "const char *buildTime = \"%date%_%time%\" ; \
174 const char *gitHead = \"unknown\" ; " \
174 const char *gitHead = \"unknown\" ; " \
175 > \
175 > \
176 $$chartversion.target
176 $$chartversion.target
177 }
177 }
178
178
179 chartversion.depends = $$HEADERS \
179 chartversion.depends = $$HEADERS \
180 $$SOURCES
180 $$SOURCES
181
181
182 PRE_TARGETDEPS += $$chartversion.target
182 PRE_TARGETDEPS += $$chartversion.target
183 QMAKE_CLEAN += $$PWD/qchartversion_p.h
183 QMAKE_CLEAN += $$PWD/qchartversion_p.h
184 QMAKE_EXTRA_TARGETS += chartversion
184 QMAKE_EXTRA_TARGETS += chartversion
185 }
185 }
186
186
187 ############################### CLEAN ###########################################
187 ############################### CLEAN ###########################################
188
188
189 unix:QMAKE_DISTCLEAN += -r \
189 unix:QMAKE_DISTCLEAN += -r \
190 $$CHART_BUILD_HEADER_DIR \
190 $$CHART_BUILD_HEADER_DIR \
191 $$CHART_BUILD_LIB_DIR
191 $$CHART_BUILD_LIB_DIR
192 win32:QMAKE_DISTCLEAN += /Q \
192 win32:QMAKE_DISTCLEAN += /Q \
193 $$CHART_BUILD_HEADER_DIR \
193 $$CHART_BUILD_HEADER_DIR \
194 $$CHART_BUILD_LIB_DIR
194 $$CHART_BUILD_LIB_DIR
195
195
General Comments 0
You need to be logged in to leave comments. Login now