Mercurial > projects > qtd
comparison generator/CMakeLists.txt @ 4:0a29ce1ae854
CMake build script.
Small fixes in examples.
author | SokoL_SD |
---|---|
date | Wed, 13 May 2009 19:01:55 +0000 |
parents | |
children | b8a79f9fba5a |
comparison
equal
deleted
inserted
replaced
3:323efbe5c2f7 | 4:0a29ce1ae854 |
---|---|
1 PROJECT(generator CXX C) | |
2 cmake_minimum_required(VERSION 2.6) | |
3 FIND_PACKAGE(Qt4 REQUIRED) | |
4 | |
5 ## Sources | |
6 set(srcs | |
7 classlistgenerator.cpp | |
8 cppgenerator.cpp | |
9 cppheadergenerator.cpp | |
10 cppimplgenerator.cpp | |
11 docparser.cpp | |
12 generatorsetd.cpp | |
13 dgenerator.cpp | |
14 jumptable.cpp | |
15 metainfogenerator.cpp | |
16 metajavabuilder.cpp | |
17 qdocgenerator.cpp | |
18 uiconverter.cpp | |
19 containergenerator.cpp | |
20 | |
21 generator.cpp | |
22 main.cpp | |
23 reporthandler.cpp | |
24 typeparser.cpp | |
25 typesystem.cpp | |
26 asttoxml.cpp | |
27 fileout.cpp | |
28 generatorset.cpp | |
29 metajava.cpp | |
30 customtypes.cpp | |
31 abstractmetabuilder.cpp | |
32 abstractmetalang.cpp | |
33 prigenerator.cpp | |
34 | |
35 # rxx | |
36 parser/ast.cpp | |
37 parser/lexer.cpp | |
38 parser/list.cpp | |
39 parser/parser.cpp | |
40 parser/smallobject.cpp | |
41 parser/control.cpp | |
42 parser/visitor.cpp | |
43 parser/default_visitor.cpp | |
44 parser/dumptree.cpp | |
45 parser/tokens.cpp | |
46 parser/binder.cpp | |
47 parser/codemodel.cpp | |
48 parser/type_compiler.cpp | |
49 parser/name_compiler.cpp | |
50 parser/declarator_compiler.cpp | |
51 parser/class_compiler.cpp | |
52 parser/codemodel_finder.cpp | |
53 parser/compiler_utils.cpp | |
54 | |
55 ## rpp | |
56 parser/rpp/preprocessor.cpp | |
57 ) | |
58 ## Moc headers | |
59 set(moc_hdrs | |
60 classlistgenerator.h | |
61 cppgenerator.h | |
62 cppheadergenerator.h | |
63 cppimplgenerator.h | |
64 docparser.h | |
65 generatorsetd.h | |
66 dgenerator.h | |
67 jumptable.h | |
68 metainfogenerator.h | |
69 metajavabuilder.h | |
70 qdocgenerator.h | |
71 uiconverter.h | |
72 containergenerator.h | |
73 generator.h | |
74 main.h | |
75 reporthandler.h | |
76 typeparser.h | |
77 typesystem.h | |
78 asttoxml.h | |
79 fileout.h | |
80 generatorset.h | |
81 metajava.h | |
82 customtypes.h | |
83 abstractmetabuilder.h | |
84 abstractmetalang.h | |
85 prigenerator.h | |
86 | |
87 ## rxx | |
88 parser/ast.h | |
89 parser/lexer.h | |
90 parser/list.h | |
91 parser/parser.h | |
92 parser/rxx_allocator.h | |
93 parser/rpp-allocator.h | |
94 parser/smallobject.h | |
95 parser/tokens.h | |
96 parser/symbol.h | |
97 parser/control.h | |
98 parser/visitor.h | |
99 parser/default_visitor.h | |
100 parser/dumptree.h | |
101 parser/binder.h | |
102 parser/codemodel.h | |
103 parser/codemodel_pointer.h | |
104 parser/codemodel_fwd.h | |
105 parser/type_compiler.h | |
106 parser/name_compiler.h | |
107 parser/declarator_compiler.h | |
108 parser/class_compiler.h | |
109 parser/codemodel_finder.h | |
110 parser/compiler_utils.h | |
111 | |
112 # rpp | |
113 parser/rpp/pp-cctype.h | |
114 parser/rpp/pp-engine-bits.h | |
115 parser/rpp/pp-engine.h | |
116 parser/rpp/pp-environment.h | |
117 parser/rpp/pp-fwd.h | |
118 parser/rpp/pp-internal.h | |
119 parser/rpp/pp-iterator.h | |
120 parser/rpp/pp-macro-expander.h | |
121 parser/rpp/pp-macro.h | |
122 parser/rpp/pp-scanner.h | |
123 parser/rpp/pp-string.h | |
124 parser/rpp/pp-symbol.h | |
125 parser/rpp/pp.h | |
126 parser/rpp/preprocessor.h | |
127 | |
128 ) | |
129 | |
130 ## Resources. | |
131 set(res_files | |
132 generator.qrc | |
133 ) | |
134 | |
135 #win32-msvc2005:{ | |
136 # QMAKE_CXXFLAGS += -wd4996 | |
137 # QMAKE_CFLAGS += -wd4996 | |
138 #} | |
139 | |
140 #win32-msvc.net { | |
141 # QMAKE_CXXFLAGS += /Zm500 | |
142 # QMAKE_CXXFLAGS -= -Zm200 | |
143 # QMAKE_CFLAGS -= -Zm200 | |
144 #} | |
145 | |
146 ## Includes path. | |
147 set(inc_paths | |
148 ${CMAKE_CURRENT_SOURCE_DIR} | |
149 ${CMAKE_CURRENT_SOURCE_DIR}/../common | |
150 ${CMAKE_CURRENT_SOURCE_DIR}/parser | |
151 ${CMAKE_CURRENT_SOURCE_DIR}/parser/include | |
152 ${CMAKE_CURRENT_SOURCE_DIR}/parser/rpp | |
153 ) | |
154 | |
155 add_definitions(-DRXX_ALLOCATOR_INIT_0) | |
156 | |
157 ## Build project | |
158 find_package (Qt4 REQUIRED) | |
159 set (QT_USE_QTMAIN true) | |
160 set (QT_USE_QTGUI false) | |
161 set (QT_USE_QTXML true) | |
162 include(${QT_USE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) | |
163 | |
164 set(inc_paths | |
165 ${inc_paths} | |
166 ${QT_INCLUDES} | |
167 ) | |
168 set(lib_paths | |
169 ${lib_paths} | |
170 ${QT_LIBRARY_DIR} | |
171 ) | |
172 set(libs | |
173 ${QT_LIBRARIES} | |
174 ) | |
175 | |
176 qt4_wrap_cpp(moc_srcs ${moc_hdrs}) | |
177 qt4_add_resources(res_wrapped_files ${res_files}) | |
178 | |
179 set (all_srcs | |
180 ${srcs} ${moc_srcs} | |
181 ${res_wrapped_files}) | |
182 include_directories(${inc_paths}) | |
183 add_executable(generator ${all_srcs} ) | |
184 target_link_libraries(generator ${libs}) | |
185 | |
186 foreach(package ${packages}) | |
187 set(gen_sources ${gen_sources} ${CMAKE_SOURCE_DIR}/generator/typesystem_${package}.xml) | |
188 endforeach(package ${packages}) | |
189 | |
190 MACRO(MAKE_WINDOWS_PATH pathname) | |
191 # An extra \\ escape is necessary to get a \ through CMake's processing. | |
192 STRING(REPLACE "/" "\\" ${pathname} "${${pathname}}") | |
193 # Enclose with UNESCAPED quotes. This means we need to escape our | |
194 # quotes once here, i.e. with \" | |
195 SET(${pathname} \"${${pathname}}\") | |
196 ENDMACRO(MAKE_WINDOWS_PATH) | |
197 | |
198 foreach(package ${packages}) | |
199 set(dgen_impl ${CMAKE_BINARY_DIR}/cpp/qt_${package}/qt_${package}.pri) | |
200 break(package ${packages}) | |
201 endforeach(package ${packages}) | |
202 | |
203 add_custom_command(OUTPUT ${dgen_impl} | |
204 COMMAND ${CMAKE_COMMAND} -E remove -f ${dgen_impl} | |
205 COMMAND "generator" | |
206 ARGS ${GEN_OPT} --qt-include-directory=${QT_INCLUDE_DIR} --output-directory=../ | |
207 --source-directory=${CMAKE_SOURCE_DIR}/generator | |
208 qtjambi_masterinclude.h | |
209 build_opengl.txt | |
210 COMMENT "Generating binding..." | |
211 DEPENDS generator ${gen_sources} | |
212 ) | |
213 add_custom_target(dgen DEPENDS ${dgen_impl} COMMENT "") | |
214 | |
215 macro(add_sources_for_generating) | |
216 foreach(source ${ARGN}) | |
217 add_custom_command(OUTPUT "${source}" | |
218 COMMAND "" | |
219 ARGS "" | |
220 DEPENDS ${dgen_impl} | |
221 COMMENT "" | |
222 ) | |
223 endforeach(source ${allcppsources}) | |
224 endmacro(add_sources_for_generating) |