Mercurial > projects > qtd
comparison generator/CMakeLists.txt @ 132:a860544c5ee8
CMake: initial version of CMakeD script.
CMake: MSVC fixes (not work yet).
CMake: add experimental option BUILD_SHARED_LIBRARIES.
author | SokoL_SD |
---|---|
date | Sun, 07 Jun 2009 14:31:36 +0000 |
parents | eb3b5bbffc8f |
children | 1db8a1da977a |
comparison
equal
deleted
inserted
replaced
131:6d5eeec1d9a1 | 132:a860544c5ee8 |
---|---|
1 PROJECT(generator CXX C) | 1 PROJECT(generator CXX C) |
2 cmake_minimum_required(VERSION 2.6) | 2 cmake_minimum_required(VERSION 2.6) |
3 FIND_PACKAGE(Qt4 REQUIRED) | 3 FIND_PACKAGE(Qt4 REQUIRED) |
4 | |
5 ## Force Release settings | |
6 STRING(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_upper) | |
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}) | |
4 | 11 |
5 ## Sources | 12 ## Sources |
6 set(srcs | 13 set(srcs |
7 classlistgenerator.cpp | 14 classlistgenerator.cpp |
8 cppgenerator.cpp | 15 cppgenerator.cpp |
55 ## rpp | 62 ## rpp |
56 parser/rpp/preprocessor.cpp | 63 parser/rpp/preprocessor.cpp |
57 ) | 64 ) |
58 ## Moc headers | 65 ## Moc headers |
59 set(moc_hdrs | 66 set(moc_hdrs |
60 classlistgenerator.h | 67 #classlistgenerator.h |
61 cppgenerator.h | 68 cppgenerator.h |
62 cppheadergenerator.h | 69 cppheadergenerator.h |
63 cppimplgenerator.h | 70 cppimplgenerator.h |
64 docparser.h | 71 #docparser.h |
65 generatorsetd.h | 72 generatorsetd.h |
66 dgenerator.h | 73 dgenerator.h |
67 jumptable.h | 74 jumptable.h |
68 metainfogenerator.h | 75 #metainfogenerator.h |
69 metajavabuilder.h | 76 #metajavabuilder.h |
70 qdocgenerator.h | 77 #qdocgenerator.h |
71 uiconverter.h | 78 #uiconverter.h |
72 containergenerator.h | 79 containergenerator.h |
73 generator.h | 80 generator.h |
74 main.h | 81 #main.h |
75 reporthandler.h | 82 #reporthandler.h |
76 typeparser.h | 83 #typeparser.h |
77 typesystem.h | 84 #typesystem.h |
78 asttoxml.h | 85 #asttoxml.h |
79 fileout.h | 86 fileout.h |
80 generatorset.h | 87 generatorset.h |
81 metajava.h | 88 #metajava.h |
82 customtypes.h | 89 #customtypes.h |
83 abstractmetabuilder.h | 90 #abstractmetabuilder.h |
84 abstractmetalang.h | 91 #abstractmetalang.h |
85 prigenerator.h | 92 prigenerator.h |
86 | 93 |
87 ## rxx | 94 ## rxx |
88 parser/ast.h | 95 #parser/ast.h |
89 parser/lexer.h | 96 #parser/lexer.h |
90 parser/list.h | 97 #parser/list.h |
91 parser/parser.h | 98 #parser/parser.h |
92 parser/rxx_allocator.h | 99 #parser/rxx_allocator.h |
93 parser/rpp-allocator.h | 100 #parser/rpp-allocator.h |
94 parser/smallobject.h | 101 #parser/smallobject.h |
95 parser/tokens.h | 102 #parser/tokens.h |
96 parser/symbol.h | 103 #parser/symbol.h |
97 parser/control.h | 104 #parser/control.h |
98 parser/visitor.h | 105 #parser/visitor.h |
99 parser/default_visitor.h | 106 #parser/default_visitor.h |
100 parser/dumptree.h | 107 #parser/dumptree.h |
101 parser/binder.h | 108 #parser/binder.h |
102 parser/codemodel.h | 109 #parser/codemodel.h |
103 parser/codemodel_pointer.h | 110 #parser/codemodel_pointer.h |
104 parser/codemodel_fwd.h | 111 #parser/codemodel_fwd.h |
105 parser/type_compiler.h | 112 #parser/type_compiler.h |
106 parser/name_compiler.h | 113 #parser/name_compiler.h |
107 parser/declarator_compiler.h | 114 #parser/declarator_compiler.h |
108 parser/class_compiler.h | 115 #parser/class_compiler.h |
109 parser/codemodel_finder.h | 116 #parser/codemodel_finder.h |
110 parser/compiler_utils.h | 117 #parser/compiler_utils.h |
111 | 118 |
112 # rpp | 119 # rpp |
113 parser/rpp/pp-cctype.h | 120 #parser/rpp/pp-cctype.h |
114 parser/rpp/pp-engine-bits.h | 121 #parser/rpp/pp-engine-bits.h |
115 parser/rpp/pp-engine.h | 122 #parser/rpp/pp-engine.h |
116 parser/rpp/pp-environment.h | 123 #parser/rpp/pp-environment.h |
117 parser/rpp/pp-fwd.h | 124 #parser/rpp/pp-fwd.h |
118 parser/rpp/pp-internal.h | 125 #parser/rpp/pp-internal.h |
119 parser/rpp/pp-iterator.h | 126 #parser/rpp/pp-iterator.h |
120 parser/rpp/pp-macro-expander.h | 127 #parser/rpp/pp-macro-expander.h |
121 parser/rpp/pp-macro.h | 128 #parser/rpp/pp-macro.h |
122 parser/rpp/pp-scanner.h | 129 #parser/rpp/pp-scanner.h |
123 parser/rpp/pp-string.h | 130 #parser/rpp/pp-string.h |
124 parser/rpp/pp-symbol.h | 131 #parser/rpp/pp-symbol.h |
125 parser/rpp/pp.h | 132 #parser/rpp/pp.h |
126 parser/rpp/preprocessor.h | 133 #parser/rpp/preprocessor.h |
127 | 134 |
128 ) | 135 ) |
129 | 136 |
130 ## Resources. | 137 ## Resources. |
131 set(res_files | 138 set(res_files |
134 | 141 |
135 #win32-msvc2005:{ | 142 #win32-msvc2005:{ |
136 # QMAKE_CXXFLAGS += -wd4996 | 143 # QMAKE_CXXFLAGS += -wd4996 |
137 # QMAKE_CFLAGS += -wd4996 | 144 # QMAKE_CFLAGS += -wd4996 |
138 #} | 145 #} |
146 | |
147 #if(MSVC) | |
148 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500 /Zc:wchar_t-") | |
149 #endif(MSVC) | |
139 | 150 |
140 #win32-msvc.net { | 151 #win32-msvc.net { |
141 # QMAKE_CXXFLAGS += /Zm500 | 152 # QMAKE_CXXFLAGS += /Zm500 |
142 # QMAKE_CXXFLAGS -= -Zm200 | 153 # QMAKE_CXXFLAGS -= -Zm200 |
143 # QMAKE_CFLAGS -= -Zm200 | 154 # QMAKE_CFLAGS -= -Zm200 |
157 ## Build project | 168 ## Build project |
158 find_package (Qt4 REQUIRED) | 169 find_package (Qt4 REQUIRED) |
159 set (QT_USE_QTMAIN true) | 170 set (QT_USE_QTMAIN true) |
160 set (QT_USE_QTGUI false) | 171 set (QT_USE_QTGUI false) |
161 set (QT_USE_QTXML true) | 172 set (QT_USE_QTXML true) |
173 | |
162 include(${QT_USE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) | 174 include(${QT_USE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) |
163 | 175 |
164 set(inc_paths | 176 set(inc_paths |
165 ${inc_paths} | 177 ${inc_paths} |
166 ${QT_INCLUDES} | 178 ${QT_INCLUDES} |
180 ${srcs} ${moc_srcs} | 192 ${srcs} ${moc_srcs} |
181 ${res_wrapped_files}) | 193 ${res_wrapped_files}) |
182 include_directories(${inc_paths}) | 194 include_directories(${inc_paths}) |
183 add_executable(generator ${all_srcs} ) | 195 add_executable(generator ${all_srcs} ) |
184 target_link_libraries(generator ${libs}) | 196 target_link_libraries(generator ${libs}) |
197 | |
198 ## TODO: Precompilated header work well, but I don`t known license of PCHSupport_26.cmake. | |
199 ## downloaded from http://www.vtk.org/Bug/view.php?id=1260. | |
200 #OPTION(USEPCH "Build the project with precompiled-headers" ON) | |
201 #include(../cmake/PCHSupport_26.cmake) | |
202 # | |
203 #IF(NOT USEPCH) | |
204 # MESSAGE(STATUS "NOT using precompiled-header") | |
205 #ELSE(NOT USEPCH) | |
206 # MESSAGE(STATUS "Using precompiled-header") | |
207 # add_precompiled_header(generator ${CMAKE_CURRENT_SOURCE_DIR}/generator_pch.h) | |
208 #ENDIF(NOT USEPCH) | |
185 | 209 |
186 macro(add_dgen_target package) | 210 macro(add_dgen_target package) |
187 string(TOLOWER ${package} package) | 211 string(TOLOWER ${package} package) |
188 set(dgen_build_conf ${CMAKE_BINARY_DIR}/CMakeFiles/built_${package}.txt) | 212 set(dgen_build_conf ${CMAKE_BINARY_DIR}/CMakeFiles/built_${package}.txt) |
189 set(dgen_build_conf_req ${CMAKE_BINARY_DIR}/CMakeFiles/built_${package}_with_req.txt) | 213 set(dgen_build_conf_req ${CMAKE_BINARY_DIR}/CMakeFiles/built_${package}_with_req.txt) |