##// END OF EJS Templates
Fix shadow build/jom.exe problems
Jani Honkonen -
r808:7ea08dd6d356
parent child
Show More
@@ -1,65 +1,73
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #ifndef CHARTCONFIG_H_
21 #ifndef CHARTCONFIG_H_
22 #define CHARTCONFIG_H_
22 #define CHARTCONFIG_H_
23
23
24 #include "qchartglobal.h"
24 #include "qchartglobal.h"
25 #ifdef Q_CC_MSVC
26 // There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
27 // This is the case at least with shadow builds.
28 // http://qt-project.org/wiki/jom
29 const char *buildTime = __DATE__;
30 const char *gitHead = "unknown";
31 #else
25 #include "qchartversion_p.h"
32 #include "qchartversion_p.h"
33 #endif
26
34
27
35
28 QTCOMMERCIALCHART_BEGIN_NAMESPACE
36 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29
37
30 class ChartConfig {
38 class ChartConfig {
31
39
32 private:
40 private:
33 ChartConfig(){
41 ChartConfig(){
34 #ifndef QT_NO_DEBUG
42 #ifndef QT_NO_DEBUG
35 qDebug()<<"buildTime" << buildTime;
43 qDebug()<<"buildTime" << buildTime;
36 qDebug()<<"gitHead" << gitHead;
44 qDebug()<<"gitHead" << gitHead;
37 #endif
45 #endif
38 m_instance = this;
46 m_instance = this;
39 }
47 }
40 public:
48 public:
41 static ChartConfig* instance(){
49 static ChartConfig* instance(){
42 if(!m_instance){
50 if(!m_instance){
43 m_instance= new ChartConfig();
51 m_instance= new ChartConfig();
44 }
52 }
45 return m_instance;
53 return m_instance;
46 }
54 }
47
55
48 QString compilationTime(){
56 QString compilationTime(){
49 return buildTime;
57 return buildTime;
50 }
58 }
51
59
52 QString compilationHead(){
60 QString compilationHead(){
53 return gitHead;
61 return gitHead;
54 }
62 }
55
63
56 private:
64 private:
57 static ChartConfig* m_instance;
65 static ChartConfig* m_instance;
58 };
66 };
59
67
60
68
61 ChartConfig* ChartConfig::m_instance=0;
69 ChartConfig* ChartConfig::m_instance=0;
62
70
63 #endif
71 #endif
64
72
65 QTCOMMERCIALCHART_END_NAMESPACE
73 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,158 +1,170
1 !include( ../common.pri ):error( Couldn't find the common.pri file! )
1 !include( ../common.pri ):error( Couldn't find the common.pri file! )
2 TARGET = QtCommercialChart
2 TARGET = QtCommercialChart
3 DESTDIR = $$CHART_BUILD_LIB_DIR
3 DESTDIR = $$CHART_BUILD_LIB_DIR
4 TEMPLATE = lib
4 TEMPLATE = lib
5 QT += core \
5 QT += core \
6 gui
6 gui
7 win32-msvc*: LIBS += User32.lib
7 win32-msvc*: LIBS += User32.lib
8 CONFIG += debug_and_release
8 CONFIG += debug_and_release
9 CONFIG(debug, debug|release):TARGET = QtCommercialChartd
9 CONFIG(debug, debug|release):TARGET = QtCommercialChartd
10 SOURCES += \
10 SOURCES += \
11 $$PWD/chartdataset.cpp \
11 $$PWD/chartdataset.cpp \
12 $$PWD/chartpresenter.cpp \
12 $$PWD/chartpresenter.cpp \
13 $$PWD/charttheme.cpp \
13 $$PWD/charttheme.cpp \
14 $$PWD/domain.cpp \
14 $$PWD/domain.cpp \
15 $$PWD/qchart.cpp \
15 $$PWD/qchart.cpp \
16 $$PWD/qchartview.cpp \
16 $$PWD/qchartview.cpp \
17 $$PWD/qseries.cpp \
17 $$PWD/qseries.cpp \
18 $$PWD/qlegend.cpp \
18 $$PWD/qlegend.cpp \
19 $$PWD/legendmarker.cpp \
19 $$PWD/legendmarker.cpp \
20 $$PWD/legendscrollbutton.cpp \
20 $$PWD/legendscrollbutton.cpp \
21 $$PWD/chartbackground.cpp \
21 $$PWD/chartbackground.cpp \
22 $$PWD/chart.cpp
22 $$PWD/chart.cpp
23 PRIVATE_HEADERS += \
23 PRIVATE_HEADERS += \
24 $$PWD/chartdataset_p.h \
24 $$PWD/chartdataset_p.h \
25 $$PWD/chartitem_p.h \
25 $$PWD/chartitem_p.h \
26 $$PWD/chartpresenter_p.h \
26 $$PWD/chartpresenter_p.h \
27 $$PWD/charttheme_p.h \
27 $$PWD/charttheme_p.h \
28 $$PWD/domain_p.h \
28 $$PWD/domain_p.h \
29 $$PWD/legendmarker_p.h \
29 $$PWD/legendmarker_p.h \
30 $$PWD/legendscrollbutton_p.h \
30 $$PWD/legendscrollbutton_p.h \
31 $$PWD/chartbackground_p.h \
31 $$PWD/chartbackground_p.h \
32 $$PWD/chart_p.h \
32 $$PWD/chart_p.h \
33 $$PWD/chartconfig_p.h \
33 $$PWD/chartconfig_p.h \
34 $$PWD/qchart_p.h \
34 $$PWD/qchart_p.h \
35 $$PWD/qchartview_p.h
35 $$PWD/qchartview_p.h
36 PUBLIC_HEADERS += \
36 PUBLIC_HEADERS += \
37 $$PWD/qchart.h \
37 $$PWD/qchart.h \
38 $$PWD/qchartglobal.h \
38 $$PWD/qchartglobal.h \
39 $$PWD/qseries.h \
39 $$PWD/qseries.h \
40 $$PWD/qchartview.h \
40 $$PWD/qchartview.h \
41 $$PWD/qlegend.h
41 $$PWD/qlegend.h
42
42
43 include(animations/animations.pri)
43 include(animations/animations.pri)
44 include(axis/axis.pri)
44 include(axis/axis.pri)
45 include(xychart/xychart.pri)
45 include(xychart/xychart.pri)
46 include(linechart/linechart.pri)
46 include(linechart/linechart.pri)
47 include(areachart/areachart.pri)
47 include(areachart/areachart.pri)
48 include(barchart/barchart.pri)
48 include(barchart/barchart.pri)
49 include(piechart/piechart.pri)
49 include(piechart/piechart.pri)
50 include(scatterseries/scatter.pri)
50 include(scatterseries/scatter.pri)
51 include(splinechart/splinechart.pri)
51 include(splinechart/splinechart.pri)
52 include(themes/themes.pri)
52 include(themes/themes.pri)
53
53
54
54
55 HEADERS += $$PUBLIC_HEADERS
55 HEADERS += $$PUBLIC_HEADERS
56 HEADERS += $$PRIVATE_HEADERS
56 HEADERS += $$PRIVATE_HEADERS
57 HEADERS += $$THEMES
57 HEADERS += $$THEMES
58 INCLUDEPATH += ../include .
58 INCLUDEPATH += ../include .
59
59
60 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
60 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
61 MOC_DIR = $$CHART_BUILD_DIR/lib
61 MOC_DIR = $$CHART_BUILD_DIR/lib
62 UI_DIR = $$CHART_BUILD_DIR/lib
62 UI_DIR = $$CHART_BUILD_DIR/lib
63 RCC_DIR = $$CHART_BUILD_DIR/lib
63 RCC_DIR = $$CHART_BUILD_DIR/lib
64 DEFINES += QTCOMMERCIALCHART_LIBRARY
64 DEFINES += QTCOMMERCIALCHART_LIBRARY
65
65
66 #qt public headers
66 #qt public headers
67 #this is very primitive and lame parser , TODO: make perl script insted
67 #this is very primitive and lame parser , TODO: make perl script insted
68 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
68 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
69 {
69 {
70 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
70 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
71 win32:{
71 win32:{
72 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
72 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
73 }else{
73 }else{
74 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
74 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
75 }
75 }
76 system($$command)
76 system($$command)
77 }
77 }
78
78
79 for(file, PUBLIC_HEADERS) {
79 for(file, PUBLIC_HEADERS) {
80 name = $$split(file,'/')
80 name = $$split(file,'/')
81 name = $$last(name)
81 name = $$last(name)
82 class = "$$cat($$file)"
82 class = "$$cat($$file)"
83 class = $$find(class,class)
83 class = $$find(class,class)
84 !isEmpty(class){
84 !isEmpty(class){
85 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
85 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
86 class = $$member(class,1)
86 class = $$member(class,1)
87 class = $$split(class,' ')
87 class = $$split(class,' ')
88 class = $$replace(class,' ','')
88 class = $$replace(class,' ','')
89 class = $$member(class,0)
89 class = $$member(class,0)
90 win32:{
90 win32:{
91 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
91 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
92 }else{
92 }else{
93 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
93 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
94 }
94 }
95 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
95 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
96 system($$command)
96 system($$command)
97 }
97 }
98 }
98 }
99
99
100 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
100 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
101 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
101 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
102
102
103 target.path = $$[QT_INSTALL_LIBS]
103 target.path = $$[QT_INSTALL_LIBS]
104 INSTALLS += target public_headers
104 INSTALLS += target public_headers
105
105
106 install_build_public_headers.name = build_public_headers
106 install_build_public_headers.name = build_public_headers
107 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
107 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
108 install_build_public_headers.input = PUBLIC_HEADERS
108 install_build_public_headers.input = PUBLIC_HEADERS
109 install_build_public_headers.commands = $$QMAKE_COPY \
109 install_build_public_headers.commands = $$QMAKE_COPY \
110 ${QMAKE_FILE_NAME} \
110 ${QMAKE_FILE_NAME} \
111 $$CHART_BUILD_PUBLIC_HEADER_DIR
111 $$CHART_BUILD_PUBLIC_HEADER_DIR
112 install_build_public_headers.CONFIG += target_predeps \
112 install_build_public_headers.CONFIG += target_predeps \
113 no_link
113 no_link
114
114
115 install_build_private_headers.name = buld_private_headers
115 install_build_private_headers.name = buld_private_headers
116 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
116 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
117 install_build_private_headers.input = PRIVATE_HEADERS
117 install_build_private_headers.input = PRIVATE_HEADERS
118 install_build_private_headers.commands = $$QMAKE_COPY \
118 install_build_private_headers.commands = $$QMAKE_COPY \
119 ${QMAKE_FILE_NAME} \
119 ${QMAKE_FILE_NAME} \
120 $$CHART_BUILD_PRIVATE_HEADER_DIR
120 $$CHART_BUILD_PRIVATE_HEADER_DIR
121 install_build_private_headers.CONFIG += target_predeps \
121 install_build_private_headers.CONFIG += target_predeps \
122 no_link
122 no_link
123
123
124 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
124 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
125 install_build_private_headers \
125 install_build_private_headers \
126
126
127
127
128 chartversion.target = $$PWD/qchartversion_p.h
128 !win32-msvc*: {
129 unix:{
129
130 chartversion.commands = @echo \
130 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
131 "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \
131 # This is the case at least with shadow builds.
132 const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \
132 # http://qt-project.org/wiki/jom
133 > \
133
134 $$chartversion.target;
134 chartversion.target = $$PWD/qchartversion_p.h
135 }else{
135
136 chartversion.commands = @echo \
136 unix:{
137 "const char *buildTime = \"%date%_%time%\" ; \
137 chartversion.commands = @echo \
138 const char *gitHead = \"unknown\" ; " \
138 "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \
139 > \
139 const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \
140 $$chartversion.target
140 > \
141 $$chartversion.target;
142 }else{
143 chartversion.commands = @echo \
144 "const char *buildTime = \"%date%_%time%\" ; \
145 const char *gitHead = \"unknown\" ; " \
146 > \
147 $$chartversion.target
148 }
149
150 chartversion.depends = $$HEADERS \
151 $$SOURCES
152
153 PRE_TARGETDEPS += $$PWD/qchartversion_p.h
154 QMAKE_CLEAN += $$PWD/qchartversion_p.h
155 QMAKE_EXTRA_TARGETS += chartversion
141 }
156 }
142 chartversion.depends = $$HEADERS \
157
143 $$SOURCES
144 PRE_TARGETDEPS += $$PWD/qchartversion_p.h
145 QMAKE_EXTRA_TARGETS += chartversion
146 unix:QMAKE_DISTCLEAN += -r \
158 unix:QMAKE_DISTCLEAN += -r \
147 $$CHART_BUILD_HEADER_DIR \
159 $$CHART_BUILD_HEADER_DIR \
148 $$CHART_BUILD_LIB_DIR
160 $$CHART_BUILD_LIB_DIR
149 win32:QMAKE_DISTCLEAN += /Q \
161 win32:QMAKE_DISTCLEAN += /Q \
150 $$CHART_BUILD_HEADER_DIR \
162 $$CHART_BUILD_HEADER_DIR \
151 $$CHART_BUILD_LIB_DIR
163 $$CHART_BUILD_LIB_DIR
152
164
153 # treat warnings as errors
165 # treat warnings as errors
154 win32-msvc*: {
166 win32-msvc*: {
155 QMAKE_CXXFLAGS += /WX
167 QMAKE_CXXFLAGS += /WX
156 } else {
168 } else {
157 QMAKE_CXXFLAGS += -Werror
169 QMAKE_CXXFLAGS += -Werror
158 }
170 }
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now