##// END OF EJS Templates
Adding support for static builds.
Jani Honkonen -
r1440:3525e4e5ffa3
parent child
Show More
@@ -24,8 +24,11 licenses/
24 Building
24 Building
25 ========
25 ========
26
26
27 Configure project with qmake:
27 Configure project with qmake. On Windows by default both debug and release
28 qmake CONFIG+=release
28 versions are built. On other platforms you need to specify the version
29 (default is debug):
30 (Windows) qmake
31 (Other platforms) qmake CONFIG+=release
29
32
30 Build poject with make:
33 Build poject with make:
31 (Linux) make
34 (Linux) make
@@ -39,6 +42,12 If you want to install the libraries to your Qt library directory use:
39 If you want to uninstall the libraries
42 If you want to uninstall the libraries
40 make uninstall
43 make uninstall
41
44
45 Building as a statically linked library
46 =======================================
47
48 The same as above applies you will just have to add staticlib to the CONFIG:
49 qmake CONFIG+=staticlib
50
42 Documentation
51 Documentation
43 =============
52 =============
44
53
@@ -83,6 +83,10 INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR
83
83
84 LIBS += -l$$LIBRARY_NAME
84 LIBS += -l$$LIBRARY_NAME
85
85
86 # This will undefine Q_DECL_EXPORT/Q_DECL_IMPORT at qchartglobal.h
87 # They should not be used for staticlib builds.
88 staticlib:DEFINES+=QTCOMMERCIALCHART_STATICLIB
89
86 ##################### UNIT TESTS ##############################################################
90 ##################### UNIT TESTS ##############################################################
87
91
88 CONFIG(debug, debug|release) {
92 CONFIG(debug, debug|release) {
@@ -10,3 +10,6 RCC_DIR = $$CHART_BUILD_DIR/demos/$$TARGET
10
10
11 TEMPLATE = app
11 TEMPLATE = app
12 QT += core gui
12 QT += core gui
13
14 # staticlib config causes problems when building executables
15 staticlib: CONFIG-=staticlib
@@ -10,3 +10,6 RCC_DIR = $$CHART_BUILD_DIR/examples/$$TARGET
10
10
11 TEMPLATE = app
11 TEMPLATE = app
12 QT += core gui
12 QT += core gui
13
14 # staticlib config causes problems when building executables
15 staticlib: CONFIG-=staticlib
@@ -11,3 +11,6 OBJECTS_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
11 MOC_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
11 MOC_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
12 UI_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
12 UI_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
13 RCC_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
13 RCC_DIR = $$CHART_BUILD_DIR/plugins/$$TARGET
14
15 # staticlib config causes problems when building executables
16 staticlib: CONFIG-=staticlib
@@ -38,6 +38,13
38 # define QTCOMMERCIALCHART_AUTOTEST_EXPORT
38 # define QTCOMMERCIALCHART_AUTOTEST_EXPORT
39 #endif
39 #endif
40
40
41 #ifdef QTCOMMERCIALCHART_STATICLIB
42 # undef QTCOMMERCIALCHART_EXPORT
43 # undef QTCOMMERCIALCHART_AUTOTEST_EXPORT
44 # define QTCOMMERCIALCHART_EXPORT
45 # define QTCOMMERCIALCHART_AUTOTEST_EXPORT
46 #endif
47
41 #define QTCOMMERCIALCHART_NAMESPACE QtCommercialChart
48 #define QTCOMMERCIALCHART_NAMESPACE QtCommercialChart
42
49
43 #ifdef QTCOMMERCIALCHART_NAMESPACE
50 #ifdef QTCOMMERCIALCHART_NAMESPACE
@@ -51,12 +58,11
51 #endif
58 #endif
52
59
53 #if defined(DEVELOPMENT_BUILD) && !defined(QT_NO_DEBUG)
60 #if defined(DEVELOPMENT_BUILD) && !defined(QT_NO_DEBUG)
54 #define CHART_DEBUG chartDebug(3,__LINE__,__FILE__,__FUNCTION__)
55
56
57 #include <stdarg.h>
61 #include <stdarg.h>
58 #include <QDebug>
62 #include <QDebug>
59
63
64 #define CHART_DEBUG chartDebug(3,__LINE__,__FILE__,__FUNCTION__)
65
60 static inline QDebug chartDebug(int numargs,...)
66 static inline QDebug chartDebug(int numargs,...)
61 {
67 {
62 va_list valist;
68 va_list valist;
@@ -69,4 +75,5 static inline QDebug chartDebug(int numargs,...)
69 return qDebug()<<QString().append(function).append("(").append(file).append(":%1)").arg(line);
75 return qDebug()<<QString().append(function).append("(").append(file).append(":%1)").arg(line);
70 }
76 }
71 #endif
77 #endif
72 #endif
78
79 #endif // CHARTGLOBAL_H
@@ -151,7 +151,9 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
151
151
152 win32:{
152 win32:{
153 bintarget.CONFIG += no_check_exist
153 bintarget.CONFIG += no_check_exist
154 bintarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
154 !staticlib: {
155 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
156 }
155 win32-msvc*:CONFIG(debug, debug|release): {
157 win32-msvc*:CONFIG(debug, debug|release): {
156 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
158 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
157 }
159 }
@@ -9,3 +9,6 OBJECTS_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
9 MOC_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
9 MOC_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
10 UI_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
10 UI_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
11 RCC_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
11 RCC_DIR = $$CHART_BUILD_DIR/tests/$$TARGET
12
13 # staticlib config causes problems when building executables
14 staticlib: CONFIG-=staticlib
General Comments 0
You need to be logged in to leave comments. Login now