annotate generator/CMakeLists.txt @ 399:e40f33cc0bf5

Explicitly include qglobal.h before all the ?master includes?. This makes sure that macros like Q_CORE_EXPORT are already defined for all parsed header files. Starting with this commit, QtD should build successfully against the pre-built Cocoa packages on OS X 10.6.
author David Nadlinger <code@klickverbot.at>
date Sun, 16 Jan 2011 00:56:21 +0100
parents aa08a72d480a
children a81c53f7b83b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
1 PROJECT(generator CXX C)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
2 cmake_minimum_required(VERSION 2.6)
283
b61a413fc2f5 Fix in generator/CMakeLists.txt
SokoL_SD
parents: 266
diff changeset
3 find_package(Qt4 REQUIRED)
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
4
264
da7c867ef2ef 1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents: 239
diff changeset
5 ## Hack for msvc: force Release settings
283
b61a413fc2f5 Fix in generator/CMakeLists.txt
SokoL_SD
parents: 266
diff changeset
6 string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_upper)
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
7 set(CMAKE_CXX_FLAGS_${build_type_upper} ${CMAKE_CXX_FLAGS_RELEASE})
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
8 get_property(dir_prop DIRECTORY
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
9 PROPERTY COMPILE_DEFINITIONS_RELEASE)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
10 set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_${build_type_upper} ${dir_prop})
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
11
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
12 ## Sources
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
13 set(srcs
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
14 global.cpp
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
15 classlistgenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
16 cppgenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
17 cppheadergenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
18 cppimplgenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
19 docparser.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
20 generatorsetd.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
21 dgenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
22 jumptable.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
23 metainfogenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
24 metajavabuilder.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
25 qdocgenerator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
26 uiconverter.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
27 containergenerator.cpp
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
28
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
29 generator.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
30 main.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
31 reporthandler.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
32 typeparser.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
33 typesystem.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
34 asttoxml.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
35 fileout.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
36 generatorset.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
37 metajava.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
38 customtypes.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
39 abstractmetabuilder.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
40 abstractmetalang.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
41 prigenerator.cpp
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
42
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
43 # rxx
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
44 parser/ast.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
45 parser/lexer.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
46 parser/list.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
47 parser/parser.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
48 parser/smallobject.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
49 parser/control.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
50 parser/visitor.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
51 parser/default_visitor.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
52 parser/dumptree.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
53 parser/tokens.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
54 parser/binder.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
55 parser/codemodel.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
56 parser/type_compiler.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
57 parser/name_compiler.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
58 parser/declarator_compiler.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
59 parser/class_compiler.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
60 parser/codemodel_finder.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
61 parser/compiler_utils.cpp
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
62
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
63 ## rpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
64 parser/rpp/preprocessor.cpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
65 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
66 ## Moc headers
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
67 set(moc_hdrs
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
68 #classlistgenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
69 cppgenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
70 cppheadergenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
71 cppimplgenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
72 #docparser.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
73 generatorsetd.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
74 dgenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
75 jumptable.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
76 #metainfogenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
77 #metajavabuilder.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
78 #qdocgenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
79 #uiconverter.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
80 containergenerator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
81 generator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
82 #main.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
83 #reporthandler.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
84 #typeparser.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
85 #typesystem.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
86 #asttoxml.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
87 fileout.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
88 generatorset.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
89 #metajava.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
90 #customtypes.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
91 #abstractmetabuilder.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
92 #abstractmetalang.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
93 prigenerator.h
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
94
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
95 ## rxx
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
96 #parser/ast.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
97 #parser/lexer.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
98 #parser/list.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
99 #parser/parser.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
100 #parser/rxx_allocator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
101 #parser/rpp-allocator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
102 #parser/smallobject.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
103 #parser/tokens.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
104 #parser/symbol.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
105 #parser/control.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
106 #parser/visitor.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
107 #parser/default_visitor.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
108 #parser/dumptree.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
109 #parser/binder.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
110 #parser/codemodel.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
111 #parser/codemodel_pointer.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
112 #parser/codemodel_fwd.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
113 #parser/type_compiler.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
114 #parser/name_compiler.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
115 #parser/declarator_compiler.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
116 #parser/class_compiler.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
117 #parser/codemodel_finder.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
118 #parser/compiler_utils.h
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
119
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
120 # rpp
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
121 #parser/rpp/pp-cctype.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
122 #parser/rpp/pp-engine-bits.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
123 #parser/rpp/pp-engine.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
124 #parser/rpp/pp-environment.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
125 #parser/rpp/pp-fwd.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
126 #parser/rpp/pp-internal.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
127 #parser/rpp/pp-iterator.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
128 #parser/rpp/pp-macro-expander.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
129 #parser/rpp/pp-macro.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
130 #parser/rpp/pp-scanner.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
131 #parser/rpp/pp-string.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
132 #parser/rpp/pp-symbol.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
133 #parser/rpp/pp.h
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
134 #parser/rpp/preprocessor.h
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
135
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
136 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
137
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
138 ## Resources.
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
139 set(res_files
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
140 generator.qrc
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
141 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
142
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
143 ## Includes path.
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
144 set(inc_paths_for_build
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
145 ${CMAKE_CURRENT_SOURCE_DIR}/../common
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
146 ${CMAKE_CURRENT_SOURCE_DIR}/parser
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
147 ${CMAKE_CURRENT_SOURCE_DIR}
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
148 ${CMAKE_CURRENT_SOURCE_DIR}/parser/rpp
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
149 #${CMAKE_CURRENT_SOURCE_DIR}/parser/include
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
150 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
151
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
152 add_definitions(-DRXX_ALLOCATOR_INIT_0)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
153
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
154 ## Build project
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
155 find_package (Qt4 REQUIRED)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
156 set (QT_USE_QTMAIN true)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
157 set (QT_USE_QTGUI false)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
158 set (QT_USE_QTXML true)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
159
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
160 include(${QT_USE_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
161
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
162 set(inc_paths_for_build
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
163 ${inc_paths_for_build}
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
164 ${QT_INCLUDES}
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
165 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
166 set(lib_paths
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
167 ${lib_paths}
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
168 ${QT_LIBRARY_DIR}
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
169 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
170 set(libs
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
171 ${QT_LIBRARIES}
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
172 )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
173
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
174 qt4_wrap_cpp(moc_srcs ${moc_hdrs})
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
175 qt4_add_resources(res_wrapped_files ${res_files})
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
176
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
177 set (all_srcs
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
178 ${srcs} ${moc_srcs}
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
179 ${res_wrapped_files})
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
180 include_directories(${inc_paths_for_build})
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
181 add_executable(generator ${all_srcs} )
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
182 target_link_libraries(generator ${libs})
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
183
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
184 ## TODO: Precompilated header works well, but I don't know a license of PCHSupport_26.cmake which
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
185 ## was downloaded from http://www.vtk.org/Bug/view.php?id=1260.
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
186 #OPTION(USEPCH "Build the project with precompiled-headers" ON)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
187 #include(../cmake/PCHSupport_26.cmake)
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
188 #
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
189 #IF(NOT USEPCH)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
190 # MESSAGE(STATUS "NOT using precompiled-header")
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
191 #ELSE(NOT USEPCH)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
192 # MESSAGE(STATUS "Using precompiled-header")
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
193 # add_precompiled_header(generator ${CMAKE_CURRENT_SOURCE_DIR}/generator_pch.h)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
194 #ENDIF(NOT USEPCH)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
195
265
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
196 set(dgen_build_conf ${CMAKE_BINARY_DIR}/CMakeFiles/build.txt)
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
197 set(jambi_inc ${CMAKE_BINARY_DIR}/CMakeFiles/qtjambi_masterinclude.h)
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
198 if( NOT "${packages_in_build_txt}" STREQUAL "${packages}"
265
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
199 OR NOT EXISTS ${dgen_build_conf}
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
200 OR NOT EXISTS ${jambi_inc})
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
201 file(REMOVE ${dgen_build_conf})
265
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
202 file(REMOVE ${jambi_inc})
399
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
203
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
204 # Explicitly include qglobal.h before all the »master includes« to make
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
205 # sure Q_CORE_EXPORT and other macros are already defined for all
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
206 # processed headers. Otherwise, the parser would choke on classes in files
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
207 # included before "qglobal.h" in <QtCore/QtCore> using one of these macros
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
208 # (e.g. QXmlStreamReader).
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
209 file(APPEND ${jambi_inc} "#include <${QT_QTCORE_INCLUDE_DIR}/qglobal.h>")
e40f33cc0bf5 Explicitly include qglobal.h before all the ?master includes?.
David Nadlinger <code@klickverbot.at>
parents: 398
diff changeset
210
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
211 file(APPEND ${dgen_build_conf} "<typesystem>\n")
265
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
212 foreach(package_normal ${packages})
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
213 string(TOLOWER ${package_normal} package)
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
214 string(TOUPPER ${package_normal} package_upper)
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
215 file(APPEND ${dgen_build_conf} " <load-typesystem name=\"typesystem_${package}.xml\" generate=\"yes\" />\n")
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
216 # only append include if we have QT_QT${MODULE}_INCLUDE_DIR defined, otherwise handle customly
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
217 if(NOT ${QT_QT${package_upper}_INCLUDE_DIR} STREQUAL "")
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
218 file(APPEND ${jambi_inc} "#include <${QT_QT${package_upper}_INCLUDE_DIR}/Qt${package_normal}>\n")
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
219 endif()
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
220 endforeach()
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
221 file(APPEND ${dgen_build_conf} "</typesystem>\n")
237
62d0dce52dac CMake: improvements && fixes
SokoL_SD
parents: 236
diff changeset
222 set(packages_in_build_txt ${packages} CACHE INTERNAL "")
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
223 # merge include file for Qwt
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
224 if(BUILD_QT_QWT)
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
225 file(READ "${CMAKE_SOURCE_DIR}/include/qwt_masterinclude.h" jambi_inc_qwt)
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
226 file(APPEND ${jambi_inc} ${jambi_inc_qwt})
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
227 endif()
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
228 endif()
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
229
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
230 set(gen_sources)
265
6cd923119ab1 Another attempt for supporting MacOS.
SokoL_SD
parents: 264
diff changeset
231 foreach(package_normal ${packages})
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
232 string(TOLOWER ${package_normal} package)
283
b61a413fc2f5 Fix in generator/CMakeLists.txt
SokoL_SD
parents: 266
diff changeset
233 set(gen_sources ${gen_sources} ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${package}.xml)
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
234 set(d_inc_file_found d_inc_file_found-NOTFOUND)
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
235 find_file(d_inc_file_found typesystem_${package}-java.java PATHS ${CMAKE_CURRENT_SOURCE_DIR}/)
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
236 if(d_inc_file_found)
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
237 set(gen_sources ${gen_sources} ${d_inc_file_found})
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
238 endif()
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
239 endforeach()
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
240 mark_as_advanced(d_inc_file_found)
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
241 set(d_inc_file_found 1)
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
242
232
1db8a1da977a MacOS fix in CMake
SokoL_SD
parents: 132
diff changeset
243 foreach(path ${QT_INCLUDES})
398
aa08a72d480a Fixed construction of the ?--include-paths? generation argument in the build system.
David Nadlinger <code@klickverbot.at>
parents: 384
diff changeset
244 set(inc_paths_tmp ${path}${sep}${inc_paths_tmp})
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
245 endforeach()
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
246 set(inc_paths ${inc_paths}${sep}${inc_paths_tmp})
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
247
239
4716eaf4a67e Hack for building in a source directory
SokoL_SD
parents: 237
diff changeset
248 if(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
4716eaf4a67e Hack for building in a source directory
SokoL_SD
parents: 237
diff changeset
249 set(out_dir ${CMAKE_SOURCE_DIR})
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
250 else()
239
4716eaf4a67e Hack for building in a source directory
SokoL_SD
parents: 237
diff changeset
251 set(out_dir ${CMAKE_BINARY_DIR}/build)
378
7341c47790d4 binding of qwt
Eldar Insafutdinov
parents: 325
diff changeset
252 endif()
239
4716eaf4a67e Hack for building in a source directory
SokoL_SD
parents: 237
diff changeset
253 set(dgen_impl ${out_dir}/cpp/qt_core/ArrayOps_shell.cpp)
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
254 add_custom_command(OUTPUT ${dgen_impl}
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
255 COMMAND ${CMAKE_COMMAND} -E remove -f ${dgen_impl}
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
256 COMMAND "generator"
236
fcc0ada121e1 The fix from rev.236 is back
SokoL_SD
parents: 235
diff changeset
257 ARGS ${GEN_OPT} --include-paths=${inc_paths}
239
4716eaf4a67e Hack for building in a source directory
SokoL_SD
parents: 237
diff changeset
258 --output-directory=${out_dir}
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
259 --source-directory=${CMAKE_CURRENT_SOURCE_DIR}
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
260 ${CMAKE_BINARY_DIR}/CMakeFiles/qtjambi_masterinclude.h
132
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
261 ${CMAKE_BINARY_DIR}/CMakeFiles/build.txt
a860544c5ee8 CMake: initial version of CMakeD script.
SokoL_SD
parents: 42
diff changeset
262 COMMENT "Generating binding..."
264
da7c867ef2ef 1) A bug is fixed when the generator doesn't restart if typesystem_${package}-java.java has been changed.
SokoL_SD
parents: 239
diff changeset
263 DEPENDS generator ${gen_sources} ${CMAKE_BINARY_DIR}/CMakeFiles/build.txt
384
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
264 )
d2f48c4cb3e3 Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents: 378
diff changeset
265 add_custom_target(dgen ALL DEPENDS ${dgen_impl} COMMENT "")