Mercurial > projects > qtd
annotate generator/CMakeLists.txt @ 331:1defd6a98364 signals
Make static constructors shared. Requires new dmd. Remove irrelevant junk
author | eldar1@eldar1-laptop |
---|---|
date | Fri, 22 Jan 2010 23:59:07 +0000 |
parents | b460cd08041f |
children | 7341c47790d4 |
rev | line source |
---|---|
132 | 1 PROJECT(generator CXX C) |
2 cmake_minimum_required(VERSION 2.6) | |
283 | 3 find_package(Qt4 REQUIRED) |
132 | 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 | 6 string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_upper) |
132 | 7 set(CMAKE_CXX_FLAGS_${build_type_upper} ${CMAKE_CXX_FLAGS_RELEASE}) |
8 get_property(dir_prop DIRECTORY | |
9 PROPERTY COMPILE_DEFINITIONS_RELEASE) | |
10 set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_${build_type_upper} ${dir_prop}) | |
11 | |
12 ## Sources | |
13 set(srcs | |
14 classlistgenerator.cpp | |
15 cppgenerator.cpp | |
16 cppheadergenerator.cpp | |
17 cppimplgenerator.cpp | |
18 docparser.cpp | |
19 generatorsetd.cpp | |
20 dgenerator.cpp | |
21 jumptable.cpp | |
22 metainfogenerator.cpp | |
23 metajavabuilder.cpp | |
24 qdocgenerator.cpp | |
25 uiconverter.cpp | |
26 containergenerator.cpp | |
27 | |
28 generator.cpp | |
29 main.cpp | |
30 reporthandler.cpp | |
31 typeparser.cpp | |
32 typesystem.cpp | |
33 asttoxml.cpp | |
34 fileout.cpp | |
35 generatorset.cpp | |
36 metajava.cpp | |
37 customtypes.cpp | |
38 abstractmetabuilder.cpp | |
39 abstractmetalang.cpp | |
40 prigenerator.cpp | |
41 | |
42 # rxx | |
43 parser/ast.cpp | |
44 parser/lexer.cpp | |
45 parser/list.cpp | |
46 parser/parser.cpp | |
47 parser/smallobject.cpp | |
48 parser/control.cpp | |
49 parser/visitor.cpp | |
50 parser/default_visitor.cpp | |
51 parser/dumptree.cpp | |
52 parser/tokens.cpp | |
53 parser/binder.cpp | |
54 parser/codemodel.cpp | |
55 parser/type_compiler.cpp | |
56 parser/name_compiler.cpp | |
57 parser/declarator_compiler.cpp | |
58 parser/class_compiler.cpp | |
59 parser/codemodel_finder.cpp | |
60 parser/compiler_utils.cpp | |
61 | |
62 ## rpp | |
63 parser/rpp/preprocessor.cpp | |
64 ) | |
65 ## Moc headers | |
66 set(moc_hdrs | |
67 #classlistgenerator.h | |
68 cppgenerator.h | |
69 cppheadergenerator.h | |
70 cppimplgenerator.h | |
71 #docparser.h | |
72 generatorsetd.h | |
73 dgenerator.h | |
74 jumptable.h | |
75 #metainfogenerator.h | |
76 #metajavabuilder.h | |
77 #qdocgenerator.h | |
78 #uiconverter.h | |
79 containergenerator.h | |
80 generator.h | |
81 #main.h | |
82 #reporthandler.h | |
83 #typeparser.h | |
84 #typesystem.h | |
85 #asttoxml.h | |
86 fileout.h | |
87 generatorset.h | |
88 #metajava.h | |
89 #customtypes.h | |
90 #abstractmetabuilder.h | |
91 #abstractmetalang.h | |
92 prigenerator.h | |
93 | |
94 ## rxx | |
95 #parser/ast.h | |
96 #parser/lexer.h | |
97 #parser/list.h | |
98 #parser/parser.h | |
99 #parser/rxx_allocator.h | |
100 #parser/rpp-allocator.h | |
101 #parser/smallobject.h | |
102 #parser/tokens.h | |
103 #parser/symbol.h | |
104 #parser/control.h | |
105 #parser/visitor.h | |
106 #parser/default_visitor.h | |
107 #parser/dumptree.h | |
108 #parser/binder.h | |
109 #parser/codemodel.h | |
110 #parser/codemodel_pointer.h | |
111 #parser/codemodel_fwd.h | |
112 #parser/type_compiler.h | |
113 #parser/name_compiler.h | |
114 #parser/declarator_compiler.h | |
115 #parser/class_compiler.h | |
116 #parser/codemodel_finder.h | |
117 #parser/compiler_utils.h | |
118 | |
119 # rpp | |
120 #parser/rpp/pp-cctype.h | |
121 #parser/rpp/pp-engine-bits.h | |
122 #parser/rpp/pp-engine.h | |
123 #parser/rpp/pp-environment.h | |
124 #parser/rpp/pp-fwd.h | |
125 #parser/rpp/pp-internal.h | |
126 #parser/rpp/pp-iterator.h | |
127 #parser/rpp/pp-macro-expander.h | |
128 #parser/rpp/pp-macro.h | |
129 #parser/rpp/pp-scanner.h | |
130 #parser/rpp/pp-string.h | |
131 #parser/rpp/pp-symbol.h | |
132 #parser/rpp/pp.h | |
133 #parser/rpp/preprocessor.h | |
134 | |
135 ) | |
136 | |
137 ## Resources. | |
138 set(res_files | |
139 generator.qrc | |
140 ) | |
141 | |
142 ## Includes path. | |
143 set(inc_paths | |
144 ${CMAKE_CURRENT_SOURCE_DIR}/../common | |
145 ${CMAKE_CURRENT_SOURCE_DIR}/parser | |
146 ${CMAKE_CURRENT_SOURCE_DIR} | |
147 ${CMAKE_CURRENT_SOURCE_DIR}/parser/rpp | |
148 #${CMAKE_CURRENT_SOURCE_DIR}/parser/include | |
149 ) | |
150 | |
151 add_definitions(-DRXX_ALLOCATOR_INIT_0) | |
152 | |
153 ## Build project | |
154 find_package (Qt4 REQUIRED) | |
155 set (QT_USE_QTMAIN true) | |
156 set (QT_USE_QTGUI false) | |
157 set (QT_USE_QTXML true) | |
158 | |
159 include(${QT_USE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) | |
160 | |
161 set(inc_paths | |
162 ${inc_paths} | |
163 ${QT_INCLUDES} | |
164 ) | |
165 set(lib_paths | |
166 ${lib_paths} | |
167 ${QT_LIBRARY_DIR} | |
168 ) | |
169 set(libs | |
170 ${QT_LIBRARIES} | |
171 ) | |
172 | |
173 qt4_wrap_cpp(moc_srcs ${moc_hdrs}) | |
174 qt4_add_resources(res_wrapped_files ${res_files}) | |
175 | |
176 set (all_srcs | |
177 ${srcs} ${moc_srcs} | |
178 ${res_wrapped_files}) | |
179 include_directories(${inc_paths}) | |
180 add_executable(generator ${all_srcs} ) | |
181 target_link_libraries(generator ${libs}) | |
182 | |
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
|
183 ## TODO: Precompilated header works well, but I don't know a license of PCHSupport_26.cmake which |
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
|
184 ## was downloaded from http://www.vtk.org/Bug/view.php?id=1260. |
132 | 185 #OPTION(USEPCH "Build the project with precompiled-headers" ON) |
186 #include(../cmake/PCHSupport_26.cmake) | |
187 # | |
188 #IF(NOT USEPCH) | |
189 # MESSAGE(STATUS "NOT using precompiled-header") | |
190 #ELSE(NOT USEPCH) | |
191 # MESSAGE(STATUS "Using precompiled-header") | |
192 # add_precompiled_header(generator ${CMAKE_CURRENT_SOURCE_DIR}/generator_pch.h) | |
193 #ENDIF(NOT USEPCH) | |
194 | |
265 | 195 set(dgen_build_conf ${CMAKE_BINARY_DIR}/CMakeFiles/build.txt) |
196 set(jambi_inc ${CMAKE_BINARY_DIR}/CMakeFiles/qtjambi_masterinclude.h) | |
197 if( NOT "${packages_in_build_txt}" STREQUAL "${packages}" | |
198 OR NOT EXISTS ${dgen_build_conf} | |
199 OR NOT EXISTS ${jambi_inc}) | |
132 | 200 file(REMOVE ${dgen_build_conf}) |
265 | 201 file(REMOVE ${jambi_inc}) |
132 | 202 file(APPEND ${dgen_build_conf} "<typesystem>\n") |
265 | 203 foreach(package_normal ${packages}) |
204 string(TOLOWER ${package_normal} package) | |
205 string(TOUPPER ${package_normal} package_upper) | |
132 | 206 file(APPEND ${dgen_build_conf} " <load-typesystem name=\"typesystem_${package}.xml\" generate=\"yes\" />\n") |
265 | 207 file(APPEND ${jambi_inc} "#include <${QT_QT${package_upper}_INCLUDE_DIR}/Qt${package_normal}>\n") |
208 endforeach(package_normal ${packages}) | |
132 | 209 file(APPEND ${dgen_build_conf} "</typesystem>\n") |
237 | 210 set(packages_in_build_txt ${packages} CACHE INTERNAL "") |
265 | 211 endif( NOT "${packages_in_build_txt}" STREQUAL "${packages}" |
212 OR NOT EXISTS ${dgen_build_conf} | |
213 OR NOT EXISTS ${jambi_inc}) | |
132 | 214 |
215 set(gen_sources) | |
265 | 216 foreach(package_normal ${packages}) |
266
5134552d97f6
Bug fix for http://www.dsource.org/forums/viewtopic.php?t=4713
SokoL_SD
parents:
265
diff
changeset
|
217 string(TOLOWER ${package_normal} package) |
283 | 218 set(gen_sources ${gen_sources} ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${package}.xml) |
266
5134552d97f6
Bug fix for http://www.dsource.org/forums/viewtopic.php?t=4713
SokoL_SD
parents:
265
diff
changeset
|
219 set(d_inc_file_found d_inc_file_found-NOTFOUND) |
283 | 220 find_file(d_inc_file_found typesystem_${package}-java.java PATHS ${CMAKE_CURRENT_SOURCE_DIR}/) |
132 | 221 if(d_inc_file_found) |
266
5134552d97f6
Bug fix for http://www.dsource.org/forums/viewtopic.php?t=4713
SokoL_SD
parents:
265
diff
changeset
|
222 set(gen_sources ${gen_sources} ${d_inc_file_found}) |
132 | 223 endif(d_inc_file_found) |
265 | 224 endforeach(package_normal ${packages}) |
132 | 225 mark_as_advanced(d_inc_file_found) |
226 set(d_inc_file_found 1) | |
227 | |
232 | 228 if(CMAKE_HOST_WIN32) |
229 set(sep ";") | |
230 else(CMAKE_HOST_WIN32) | |
231 set(sep ":") | |
232 endif(CMAKE_HOST_WIN32) | |
233 foreach(path ${QT_INCLUDES}) | |
234 set(inc_paths ${path}${sep}) | |
235 endforeach(path ${QT_INCLUDES}) | |
239 | 236 if(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) |
237 set(out_dir ${CMAKE_SOURCE_DIR}) | |
238 else(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) | |
239 set(out_dir ${CMAKE_BINARY_DIR}/build) | |
240 endif(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) | |
241 set(dgen_impl ${out_dir}/cpp/qt_core/ArrayOps_shell.cpp) | |
132 | 242 add_custom_command(OUTPUT ${dgen_impl} |
243 COMMAND ${CMAKE_COMMAND} -E remove -f ${dgen_impl} | |
244 COMMAND "generator" | |
236 | 245 ARGS ${GEN_OPT} --include-paths=${inc_paths} |
239 | 246 --output-directory=${out_dir} |
283 | 247 --source-directory=${CMAKE_CURRENT_SOURCE_DIR} |
265 | 248 ${CMAKE_BINARY_DIR}/CMakeFiles/qtjambi_masterinclude.h |
132 | 249 ${CMAKE_BINARY_DIR}/CMakeFiles/build.txt |
250 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
|
251 DEPENDS generator ${gen_sources} ${CMAKE_BINARY_DIR}/CMakeFiles/build.txt |
235
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
232
diff
changeset
|
252 ) |
b796329e8c38
We need to start cmake twice. It is necessary for getting a class list from the generator and using this list for building other parts of QtD.
SokoL_SD
parents:
232
diff
changeset
|
253 add_custom_target(dgen ALL DEPENDS ${dgen_impl} COMMENT "") |