Mercurial > projects > qtd
annotate cmake/FindD.cmake @ 409:4a943393a167
Added wrapper for QImage::save.
It has been private back from QtJambi because the format argument is a plain char pointer instead of a QString, but unlike QPixmap, wrappers were missing.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Sun, 20 Mar 2011 20:39:44 +0100 |
parents | 8564ab82ea42 |
children | 4189f1d51a7d |
rev | line source |
---|---|
132 | 1 ##-------------------------------------------- |
2 ## Variables. | |
3 ##-------------------------------------------- | |
4 | |
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:
224
diff
changeset
|
5 ## Find D compiler and parse its version. |
402 | 6 find_program(DC NAMES dmd ldc gdmd) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
7 if (DC) |
132 | 8 get_filename_component(dc_path ${DC} PATH) |
9 if("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR}) | |
402 | 10 get_filename_component(DC ${DC} NAME) |
132 | 11 endif("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR}) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
12 exec_program(${DC} ARGS "" OUTPUT_VARIABLE d_output) |
132 | 13 string(REGEX MATCH "Digital Mars D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}") |
14 if (dmd_version) | |
402 | 15 set(D_IS_MARS true) |
16 set(D_IS_DMD true) | |
17 set(D_COMPILER_NAME "Digital Mars D Compiler") | |
18 string(REGEX REPLACE "Digital Mars D Compiler v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}") | |
19 string(REGEX REPLACE "Digital Mars D Compiler v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}") | |
132 | 20 else (dmd_version) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
21 string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}") |
132 | 22 if (is_ldc) |
23 exec_program(${DC} ARGS "--version" OUTPUT_VARIABLE d_output) | |
24 string(REGEX MATCH "based on DMD v[0-9]\\.[0-9]+" ldc_version "${d_output}") | |
25 set(D_IS_LLVM true) | |
26 set(D_IS_LDC true) | |
27 if(ldc_version) | |
28 set(D_IS_LLVM true) | |
29 set(D_COMPILER_NAME "LLVM-based D Compiler") | |
30 string(REGEX REPLACE "based on DMD v([0-9])\\.[0-9]+" "\\1" D_VERSION "${ldc_version}") | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
31 string(REGEX REPLACE "based on DMD v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${ldc_version}") |
132 | 32 else(ldc_version) |
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:
224
diff
changeset
|
33 message(FATAL_ERROR "LDC compiler found, but the version can not be processed") |
132 | 34 endif(ldc_version) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
35 else (is_ldc) |
402 | 36 string(REGEX MATCH "gdc" is_gdc "${d_output}") |
37 if(is_gdc) | |
38 set(D_COMPILER_NAME "GDC-based D Compiler") | |
39 set(D_VERSION 2) | |
40 else(is_gdc) | |
41 message(FATAL_ERROR "D compiler is not found") | |
42 endif(is_gdc) | |
43 endif(is_ldc) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
44 endif(dmd_version) |
132 | 45 message(STATUS "D compiler found -- ${D_COMPILER_NAME} v${D_VERSION}.${D_FRONTEND}") |
46 else (DC) | |
401
827147052d8d
Corrected typo in CMake error message, fixes #68.
David Nadlinger <code@klickverbot.at>
parents:
384
diff
changeset
|
47 message(FATAL_ERROR "D compiler is not found") |
132 | 48 endif (DC) |
49 | |
50 ## Get D compiler path. | |
51 get_filename_component(DC_PATH ${DC} PATH) | |
52 if("${DC_PATH}" STREQUAL "") | |
53 find_program(dc_path_tmp ${DC}) | |
54 get_filename_component(DC_PATH ${dc_path_tmp} PATH) | |
55 mark_as_advanced(dc_path_tmp) | |
56 endif("${DC_PATH}" STREQUAL "") | |
57 get_filename_component(dc_parent_dir ${DC_PATH} NAME) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
58 if("${dc_parent_dir}" STREQUAL "bin") |
132 | 59 get_filename_component(DC_PATH ${DC_PATH} PATH) |
60 endif("${dc_parent_dir}" STREQUAL "bin") | |
61 | |
62 #option(ONE_BUILD_COMMAND "Build in one command" "OFF") | |
63 set(ONE_BUILD_COMMAND OFF) ## TODO: test it and uncomment the previous line. | |
64 | |
65 if (NOT ONE_BUILD_COMMAND) | |
66 if(D_IS_MARS) | |
281
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
67 set(opt_tmp "ON") |
132 | 68 else(D_IS_MARS) |
281
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
69 set(opt_tmp "OFF") |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
70 endif(D_IS_MARS) |
132 | 71 option(SINGLE_D_OBJECT "Build all d sources to one object file" ${opt_tmp}) |
181 | 72 if(D_IS_LLVM) |
281
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
73 set(D_FLAGS ${D_FLAGS} -singleobj) |
181 | 74 endif(D_IS_LLVM) |
281
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
75 if(CMAKE_HOST_WIN32 AND D_IS_MARS) |
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
76 set(D_MODULES_PER_OBJECT 200 CACHE STRING "Max number of modules per object file") |
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
77 else(CMAKE_HOST_WIN32 AND D_IS_MARS) |
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
78 set(D_MODULES_PER_OBJECT 10000 CACHE STRING "Max number of modules per object file") |
7f2e3ffa1c33
Workaround of the major dmd/optlink bug. All examples that failed on Windows now work.
eldar
parents:
275
diff
changeset
|
79 endif(CMAKE_HOST_WIN32 AND D_IS_MARS) |
132 | 80 endif(NOT ONE_BUILD_COMMAND) |
81 | |
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:
224
diff
changeset
|
82 ## Specific flags for build configurations. |
132 | 83 ## TODO: Add another targets. |
84 set(D_RELEASE_FLAGS -O -release) | |
139 | 85 set(D_DEBUG_FLAGS -g ) |
132 | 86 if(D_IS_LLVM) |
87 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -enable-inlining) | |
273 | 88 set(D_VERSION_FLAG -d-version) |
274 | 89 set(D_DEBUG_FLAG -d-debug) |
132 | 90 else(D_IS_LLVM) |
91 set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -inline) | |
273 | 92 set(D_VERSION_FLAG -version) |
274 | 93 set(D_DEBUG_FLAG -debug) |
132 | 94 endif(D_IS_LLVM) |
95 if(CMAKE_HOST_WIN32) | |
368
185df9220ea7
Fixed startsWith. Implemented meta-object members as ranges. Freed QMetaObject from stuff that belongs to MetaClass
Max Samukha <maxter@maxter.com>
parents:
366
diff
changeset
|
96 # Linking fails with this. Commenting out for now. |
185df9220ea7
Fixed startsWith. Implemented meta-object members as ranges. Freed QMetaObject from stuff that belongs to MetaClass
Max Samukha <maxter@maxter.com>
parents:
366
diff
changeset
|
97 # set(D_RELEASE_FLAGS ${D_RELEASE_FLAGS} -L/subsystem:windows) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
98 endif(CMAKE_HOST_WIN32) |
274 | 99 set(D_DEBUG_FLAGS ${D_DEBUG_FLAGS} ${D_DEBUG_FLAG}) |
139 | 100 |
273 | 101 # Unittest flags. |
102 option(UNITTEST "Includes unittests" "OFF") | |
103 if(UNITTEST) | |
104 set(D_FLAGS ${D_FLAGS} -unittest) | |
105 endif(UNITTEST) | |
132 | 106 |
107 ## Settings. | |
108 if(CMAKE_HOST_WIN32) | |
109 set(D_OBJECT_SUFFIX .obj) | |
110 if(D_IS_MARS) | |
111 set(D_LIB_SUFFIX .lib) | |
112 set(D_LIB_PREFIX ) | |
113 elseif(D_IS_LDC) | |
114 set(D_LIB_SUFFIX .a) | |
115 set(D_LIB_PREFIX lib) | |
116 endif(D_IS_MARS) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
117 elseif(CMAKE_HOST_UNIX) |
132 | 118 set(D_LIB_SUFFIX .a) |
119 set(D_LIB_PREFIX lib) | |
120 set(D_OBJECT_SUFFIX .o) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
121 endif(CMAKE_HOST_WIN32) |
132 | 122 |
123 ##-------------------------------------------- | |
224 | 124 ## Macros and functions. |
132 | 125 ##-------------------------------------------- |
126 | |
274 | 127 macro(add_d_flags option) |
273 | 128 foreach(arg_tmp ${ARGN}) |
274 | 129 set(D_FLAGS ${D_FLAGS} ${option}=${arg_tmp}) |
273 | 130 endforeach(arg_tmp ${ARGN}) |
274 | 131 endmacro(add_d_flags option) |
132 | |
133 macro(add_d_versions) | |
134 add_d_flags(${D_VERSION_FLAG} ${ARGN}) | |
273 | 135 endmacro(add_d_versions) |
136 | |
274 | 137 macro(add_d_debugs) |
138 add_d_flags(${D_DEBUG_FLAG} ${ARGN}) | |
139 endmacro(add_d_debugs) | |
140 | |
224 | 141 ## Make a native path. |
132 | 142 ## Usage: |
143 ## set(path c:/file_path/file_name.cpp) | |
144 ## make_native_path(path) | |
145 ## message(STATUS ${path}) | |
146 ## Output: | |
147 ## -- "c:\file_path\file_name.cpp" | |
384
d2f48c4cb3e3
Same behavior of shared libs on linux and windows. Minor build script fixes.
Max Samukha <maxter@spambox.com>
parents:
368
diff
changeset
|
148 ## Command "file(TO_NATIVE_PATH ...)" gives incorrect results on Windows |
132 | 149 macro(make_native_path pathname) |
150 if(CMAKE_HOST_WIN32) | |
151 # An extra \\ escape is necessary to get a \ through CMake's processing. | |
152 string(REPLACE "/" "\\" ${pathname} "${${pathname}}") | |
153 # Enclose with UNESCAPED quotes. This means we need to escape our | |
154 # quotes once here, i.e. with \" | |
155 set(${pathname} \"${${pathname}}\") | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
156 endif(CMAKE_HOST_WIN32) |
132 | 157 endmacro(make_native_path) |
158 | |
159 ## | |
160 ## Example: | |
161 ## set(path 24.3+23.bin) | |
162 ## obj_path(path) | |
163 ## message(STATUS ${path}) | |
164 ## Example output: | |
165 ## -- 24\.3\+23\.bin | |
166 macro(regex_safe_string outvariable) | |
167 set(${outvariable} ${ARGN}) | |
168 set(__regex_chars__ ^ $ . ] [ - * + ? | \( \)) | |
169 foreach(__regex_char__ ${__regex_chars__}) | |
170 string(REPLACE "${__regex_char__}" | |
171 "\\${__regex_char__}" ${outvariable} ${${outvariable}} | |
172 ) | |
173 endforeach(__regex_char__ ${__regex_chars__}) | |
174 endmacro(regex_safe_string outvariable) | |
175 | |
176 ## Remove unnecessary path to the object file. | |
177 ## path -- path to object file. | |
178 ## Example: | |
179 ## set(path ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/target.dir/main.d.obj) | |
180 ## obj_path(path) | |
181 ## message(STATUS ${path}) | |
182 ## Example output: | |
183 ## -- CMakeFiles/target.dir/main.d.obj | |
184 macro(obj_path path) | |
185 regex_safe_string(cbd_safe_tmp ${CMAKE_CURRENT_BINARY_DIR}) | |
186 regex_safe_string(csd_safe_tmp ${CMAKE_CURRENT_SOURCE_DIR}) | |
187 set(regexp_str_tmp "(${cbd_safe_tmp}/|${csd_safe_tmp}/|)(.+)") | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
188 string(REGEX REPLACE ${regexp_str_tmp} "\\2" ${path} "${${path}}") |
132 | 189 endmacro(obj_path path) |
190 | |
191 ## Compile d files. | |
192 ## target -- name of a new target. | |
193 ## objects_list -- created object files. | |
194 ## params -- sources files. | |
195 macro(compile_d_files target objects_list) | |
196 set(${objects_list}) | |
197 set(tmp_dir_tmp ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
198 |
132 | 199 set(type_tmp SOURCES) |
200 set(SOURCES_tmp ) | |
201 set(FLAGS_tmp ) | |
202 | |
203 ## Parse parameters list. | |
204 set(params_tmp SOURCES FLAGS) | |
205 foreach(arg_tmp ${ARGN}) | |
215 | 206 set(found_type_tmp) |
207 if(NOT found_type_tmp) | |
132 | 208 foreach(param_tmp ${params_tmp}) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
209 if(arg_tmp STREQUAL param_tmp) |
132 | 210 set(type_tmp ${param_tmp}) |
215 | 211 set(found_type_tmp 1) |
132 | 212 break(param_tmp ${params_tmp}) |
213 endif(arg_tmp STREQUAL param_tmp) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
214 endforeach(param_tmp ${params_tmp}) |
215 | 215 endif(NOT found_type_tmp) |
216 if(NOT found_type_tmp) | |
132 | 217 set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp}) |
215 | 218 endif(NOT found_type_tmp) |
132 | 219 endforeach(arg_tmp ${ARGN}) |
220 | |
221 if(NOT SINGLE_D_OBJECT) | |
222 set(${objects_list}) | |
223 foreach (d_source_p_tmp ${SOURCES_tmp}) | |
224 get_filename_component(ext_tmp ${d_source_p_tmp} EXT) | |
225 find_file(d_source_p_tmp ${d_source_p_tmp} PATHS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} | |
226 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}) | |
227 set (d_source_tmp ${d_source_p_tmp}) | |
228 obj_path(d_source_tmp) | |
229 set(d_obj_tmp ${tmp_dir_tmp}/${d_source_tmp}${D_OBJECT_SUFFIX}) | |
230 set(${objects_list} ${${objects_list}} ${d_obj_tmp}) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
231 get_filename_component(path_tmp ${d_obj_tmp} PATH) |
132 | 232 file(MAKE_DIRECTORY ${path_tmp}) |
233 set(d_obj_out_tmp ${d_obj_tmp}) | |
234 obj_path(d_obj_out_tmp) | |
235 #get_imported_files(depends_tmp ${d_source_p_tmp}) ## Too slow..... | |
236 add_custom_command(OUTPUT "${d_obj_tmp}" | |
237 COMMAND "${DC}" | |
238 ARGS ${FLAGS_tmp} ${d_source_p_tmp} -c -of${d_obj_tmp} | |
239 COMMENT "Building ${d_obj_out_tmp}" | |
240 DEPENDS ${d_source_p} ${depends_tmp} | |
241 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
242 ) | |
243 endforeach (d_source_p_tmp ${SOURCES_tmp}) | |
244 else(NOT SINGLE_D_OBJECT) | |
274 | 245 if(D_IS_LDC) |
273 | 246 set(FLAGS_tmp ${FLAGS_tmp} -oq ) |
274 | 247 endif(D_IS_LDC) |
181 | 248 set(count_objects_tmp 0) |
249 set(files${count_objects_tmp}_tmp ) | |
250 set(counter_tmp 0) | |
251 set(files_tmp ) | |
252 set(objects_tmp ) | |
253 foreach (d_source_p_tmp ${SOURCES_tmp}) | |
254 math(EXPR counter_tmp "${counter_tmp} + 1") | |
255 set(files${count_objects_tmp}_tmp ${files${count_objects_tmp}_tmp} ${d_source_p_tmp}) | |
256 if(counter_tmp GREATER D_MODULES_PER_OBJECT) | |
257 math(EXPR count_objects_tmp "${count_objects_tmp} + 1") | |
258 set(files${count_objects_tmp}_tmp ) | |
259 set(counter_tmp 0) | |
260 endif(counter_tmp GREATER D_MODULES_PER_OBJECT) | |
261 endforeach (d_source_p_tmp ${SOURCES_tmp}) | |
262 | |
263 if(files${count_objects_tmp}_tmp) | |
264 math(EXPR count_objects_tmp "${count_objects_tmp} + 1") | |
265 endif(files${count_objects_tmp}_tmp) | |
266 | |
267 set(id_tmp 0) | |
268 while(id_tmp LESS ${count_objects_tmp}) | |
269 set(object_tmp ${tmp_dir_tmp}/${target}${id_tmp}${D_OBJECT_SUFFIX}) | |
270 set(d_obj_out_tmp ${${object_tmp}}) | |
271 obj_path(d_obj_out_tmp) | |
272 set(parameters_tmp ${FLAGS_tmp} -c ${files${id_tmp}_tmp} -of${object_tmp}) | |
273 set(parameters_list_file_tmp ${tmp_dir_tmp}/parameters${id_tmp}_obj) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
274 if(CMAKE_HOST_WIN32) |
181 | 275 file(REMOVE ${parameters_list_file_tmp}) |
276 foreach(arg_tmp ${parameters_tmp}) | |
277 file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n") | |
278 endforeach(arg_tmp) | |
279 set(param_tmp @${parameters_list_file_tmp}) | |
280 elseif(CMAKE_HOST_UNIX) | |
281 set(param_tmp ${parameters_tmp}) | |
282 endif(CMAKE_HOST_WIN32) | |
283 #get_imported_files(depends_tmp ${ARGN}) | |
284 add_custom_command(OUTPUT "${object_tmp}" | |
285 COMMAND "${DC}" | |
286 ARGS ${param_tmp} | |
287 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
288 DEPENDS ${files${id_tmp}_tmp} ${depends_tmp} | |
289 COMMENT "" | |
290 ) | |
291 set(objects_tmp ${objects_tmp} ${object_tmp}) | |
292 math(EXPR id_tmp "${id_tmp} + 1") | |
293 endwhile(id_tmp LESS ${count_objects_tmp}) | |
294 | |
295 set(${objects_list} ${objects_tmp}) | |
132 | 296 endif(NOT SINGLE_D_OBJECT) |
297 #add_custom_target(${target} DEPENDS "${${objects_list}}") | |
298 endmacro(compile_d_files objects_list) | |
299 | |
300 | |
301 ## Add D target. | |
302 ## name -- target name. | |
303 ## Params: | |
304 ## TYPE -- target type. | |
305 ## STATIC -- static library. | |
306 ## SHARED -- shared library. | |
307 ## BINARY -- executable. | |
308 ## SOURCES -- sources of the target. | |
309 ## INCLUDES -- include paths. | |
310 ## FLAGS -- build flags. | |
311 ## LIBS -- libraries for link. | |
312 ## LIB_PATHS -- libraries paths. | |
313 ## DEPENDS -- target depends. | |
314 macro(add_d_target name) | |
315 set(type_tmp SOURCES) | |
316 set(TYPE_tmp) | |
317 set(INCLUDES_tmp ) | |
318 set(FLAGS_tmp ) | |
319 set(SOURCES_tmp ) | |
203
d3383b16f1d7
Add a 'NO_DEPS_SOURCES' option to the 'add_d_target' macro. And use it for resources and forms in QtD examples.
SokoL_SD
parents:
181
diff
changeset
|
320 set(GEN_FILES_tmp ) |
132 | 321 set(OBJECTS_tmp ) |
322 set(LIBS_tmp ) | |
323 set(LIB_PATHS_tmp) | |
324 set(DEPENDS_tmp) | |
325 set(OUTPUT_PATH_tmp ) | |
326 set(compile_flags_tmp ${D_FLAGS}) | |
327 set(additional_commands_tmp ) | |
215 | 328 set(detect_deps_tmp 1) |
132 | 329 set(link_flags_tmp ) |
330 | |
331 ## Parse parameters list. | |
203
d3383b16f1d7
Add a 'NO_DEPS_SOURCES' option to the 'add_d_target' macro. And use it for resources and forms in QtD examples.
SokoL_SD
parents:
181
diff
changeset
|
332 set(params_tmp TYPE INCLUDES FLAGS SOURCES NO_DEPS_SOURCES OBJECTS LIBS LIB_PATHS DEPENDS OUTPUT_PATH) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
333 |
132 | 334 foreach(arg_tmp ${ARGN}) |
215 | 335 set(found_type_tmp) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
336 if(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS") |
215 | 337 set(detect_deps_tmp 0) |
338 set(found_type_tmp 1) | |
339 endif(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS") | |
340 if(NOT found_type_tmp) | |
132 | 341 foreach(param_tmp ${params_tmp}) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
342 if(arg_tmp STREQUAL param_tmp) |
132 | 343 set(type_tmp ${param_tmp}) |
215 | 344 set(found_type_tmp 1) |
132 | 345 break(param_tmp ${params_tmp}) |
346 endif(arg_tmp STREQUAL param_tmp) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
347 endforeach(param_tmp ${params_tmp}) |
215 | 348 endif(NOT found_type_tmp) |
349 if(NOT found_type_tmp) | |
132 | 350 set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp}) |
215 | 351 endif(NOT found_type_tmp) |
132 | 352 endforeach(arg_tmp ${ARGN}) |
353 | |
354 ## Init target type. | |
355 if (OUTPUT_PATH_tmp) | |
356 set(output_name_tmp "${OUTPUT_PATH_tmp}") | |
357 endif (OUTPUT_PATH_tmp) | |
358 if("${TYPE_tmp}" STREQUAL "STATIC") | |
359 set(link_flags_tmp ${link_flags_tmp} -lib) | |
360 if(NOT OUTPUT_PATH_tmp) | |
361 if(ARCHIVE_OUTPUT_DIRECTORY) | |
362 set(output_name_tmp ${ARCHIVE_OUTPUT_DIRECTORY}) | |
363 else(ARCHIVE_OUTPUT_DIRECTORY) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
364 set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/lib) |
132 | 365 endif(ARCHIVE_OUTPUT_DIRECTORY) |
366 endif(NOT OUTPUT_PATH_tmp) | |
367 set(output_name_tmp ${output_name_tmp}/${D_LIB_PREFIX}${name}${D_LIB_SUFFIX}) | |
368 elseif("${TYPE_tmp}" STREQUAL "BINARY") | |
369 set(build_binary_tmp 1) | |
370 if(NOT OUTPUT_PATH_tmp) | |
371 if(RUNTIME_OUTPUT_DIRECTORY) | |
372 set(output_name ${RUNTIME_OUTPUT_DIRECTORY}) | |
373 else(RUNTIME_OUTPUT_DIRECTORY) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
374 set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/bin) |
132 | 375 endif(RUNTIME_OUTPUT_DIRECTORY) |
376 endif(NOT OUTPUT_PATH_tmp) | |
377 set(output_name_tmp ${output_name_tmp}/${name}${CMAKE_EXECUTABLE_SUFFIX}) | |
378 elseif("${TYPE_tmp}" STREQUAL "SHARED") | |
379 if(D_IS_MARS) | |
355
08c1ca7975ab
obviated redundant virtual dispatch callbacks
Max Samukha <maxter@spambox.com>
parents:
281
diff
changeset
|
380 message(FATAL_ERROR "DMD does not support building shared libraries") |
132 | 381 endif(D_IS_MARS) |
382 if(NOT OUTPUT_PATH_tmp) | |
383 if(LIBRARY_OUTPUT_DIRECTORY) | |
384 set(output_name_tmp ${LIBRARY_OUTPUT_DIRECTORY}) | |
385 else(LIBRARY_OUTPUT_DIRECTORY) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
386 set(output_name_tmp ${CMAKE_CURRENT_BINARY_DIR}/lib) |
132 | 387 endif(LIBRARY_OUTPUT_DIRECTORY) |
388 endif(NOT OUTPUT_PATH_tmp) | |
389 set(build_binary 1) | |
390 set(output_name_tmp ${output_name_tmp}/${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}) | |
391 set(link_flags_tmp ${compile_flags_tmp} -L-shared) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
392 else("${TYPE_tmp}" STREQUAL "STATIC") |
132 | 393 message(FATAL_ERROR "D target ${TYPE_tmp} not supported") |
394 endif("${TYPE_tmp}" STREQUAL "STATIC") | |
395 | |
396 ## Include paths. | |
397 foreach(inc_tmp ${INCLUDES_tmp} ${D_INCLUDES}) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
398 set(compile_flags_tmp ${compile_flags_tmp} -I${inc_tmp}) |
132 | 399 endforeach(inc_tmp ${INCLUDES_tmp} ${D_INCLUDES}) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
400 |
132 | 401 ## Libraries and paths of them. |
402 set(libs_tmp) | |
403 if(build_binary_tmp) | |
404 if(D_IS_MARS AND CMAKE_HOST_WIN32) | |
405 foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS}) | |
406 make_native_path(lib_path_tmp) | |
407 string(REPLACE "/" "\\" lib_path_tmp "${lib_path_tmp}//") | |
408 set(lib_path_tmp \"${lib_path_tmp}\") | |
409 set(link_flags_tmp ${link_flags_tmp} -L+${lib_path_tmp}) | |
410 endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS}) | |
411 #set(additional_commands_tmp COMMAND set ARGS LIB=) | |
412 #foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS}) | |
413 #MAKE_NATIVE_PATH(lib_path_tmp) | |
414 #set(additional_commands_tmp ${additional_commands_tmp}${lib_path_tmp};) | |
415 #endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS}) | |
416 else(D_IS_MARS AND CMAKE_HOST_WIN32) | |
417 foreach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS}) | |
418 set(link_flags_tmp ${link_flags_tmp} -L-L${lib_path_tmp}) | |
419 endforeach(lib_path_tmp ${LIB_PATHS_tmp} ${D_LIB_PATHS}) | |
420 endif(D_IS_MARS AND CMAKE_HOST_WIN32) | |
421 foreach(lib_tmp ${LIBS_tmp} ${D_LIBS}) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
422 if(D_IS_MARS AND CMAKE_HOST_WIN32) |
132 | 423 set(link_flags_tmp ${link_flags_tmp} -L+${lib_tmp}) |
424 else(D_IS_MARS AND CMAKE_HOST_WIN32) | |
425 set(link_flags_tmp ${link_flags_tmp} -L-l${lib_tmp}) | |
426 endif(D_IS_MARS AND CMAKE_HOST_WIN32) | |
427 endforeach(lib_tmp ${LIBS_tmp} ${D_LIBS}) | |
428 endif(build_binary_tmp) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
429 |
132 | 430 set(not_obj_tmp ${ONE_BUILD_COMMAND}) |
431 ## Ldc not support -lib flag. | |
432 if(ONE_BUILD_COMMAND AND ${TYPE_tmp} STREQUAL "STATIC" AND D_IS_LLVM) | |
433 set(not_obj_tmp OFF) | |
434 endif(ONE_BUILD_COMMAND AND ${TYPE_tmp} STREQUAL "STATIC" AND D_IS_LLVM) | |
435 | |
436 if(build_binary_tmp AND NOT D_IS_MARS) | |
437 set(compile_flags_tmp ${compile_flags_tmp} -od${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${name}.dir) | |
438 endif(build_binary_tmp AND NOT D_IS_MARS) | |
439 | |
440 if(CMAKE_BUILD_TYPE) | |
441 string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER) | |
442 set(compile_flags_tmp ${compile_flags_tmp} ${D_${CMAKE_BUILD_TYPE_UPPER}_FLAGS}) | |
443 endif(CMAKE_BUILD_TYPE) | |
444 | |
215 | 445 if(detect_deps_tmp) |
446 message(STATUS "Getting dependencies for ${name}") | |
203
d3383b16f1d7
Add a 'NO_DEPS_SOURCES' option to the 'add_d_target' macro. And use it for resources and forms in QtD examples.
SokoL_SD
parents:
181
diff
changeset
|
447 get_files_depends(tmp ${SOURCES_tmp}) |
d3383b16f1d7
Add a 'NO_DEPS_SOURCES' option to the 'add_d_target' macro. And use it for resources and forms in QtD examples.
SokoL_SD
parents:
181
diff
changeset
|
448 set(SOURCES_tmp ${tmp}) |
215 | 449 endif(detect_deps_tmp) |
212 | 450 set(SOURCES_tmp ${SOURCES_tmp} ${NO_DEPS_SOURCES_tmp}) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
451 |
132 | 452 set(used_ar_tmp) |
453 get_filename_component(output_path_tmp ${output_name_tmp} PATH) | |
454 if (NOT not_obj_tmp) | |
455 compile_d_files(${name} objs_tmp ${SOURCES_tmp} FLAGS ${compile_flags_tmp}) | |
456 set(SOURCES_tmp ${objs_tmp}) | |
457 if(NOT D_IS_MARS AND ${TYPE_tmp} STREQUAL "STATIC") | |
458 set(parameters_tmp rcs ${output_name_tmp} ${SOURCES_tmp} ${OBJECTS_tmp}) | |
459 set(parameters_list_file_tmp ${tmp_dir_tmp}/parameters) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
460 if(CMAKE_HOST_WIN32) |
132 | 461 file(REMOVE ${parameters_list_file_tmp}) |
462 foreach(arg_tmp ${parameters_tmp}) | |
463 file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n") | |
464 endforeach(arg_tmp) | |
465 set(param_tmp @${parameters_list_file_tmp}) | |
466 elseif(CMAKE_HOST_UNIX) | |
467 set(param_tmp ${parameters_tmp}) | |
468 endif(CMAKE_HOST_WIN32) | |
469 add_custom_command( | |
470 OUTPUT "${output_name_tmp}" | |
471 COMMAND "${CMAKE_AR}" | |
472 ARGS ${param_tmp} | |
473 DEPENDS ${SOURCES_tmp} | |
474 COMMENT "Linking ${lib_name}" | |
475 ) | |
476 set(used_ar_tmp 1) | |
477 endif(NOT D_IS_MARS AND ${TYPE_tmp} STREQUAL "STATIC") | |
478 endif (NOT not_obj_tmp) | |
479 | |
480 if (NOT used_ar_tmp) | |
481 set(output_name_native_tmp ${output_name_tmp}) | |
482 if(D_IS_MARS) | |
483 set(additional_commands_tmp ${additional_commands_tmp} COMMAND ${CMAKE_COMMAND} -E make_directory ${output_path_tmp}) | |
484 make_native_path(output_name_native_tmp) | |
485 endif(D_IS_MARS) | |
486 set(parameters_tmp ${compile_flags_tmp} ${link_flags_tmp} ${SOURCES_tmp} ${OBJECTS_tmp} -of${output_name_native_tmp}) | |
487 set(parameters_list_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${name}.dir/parameters) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
488 if(CMAKE_HOST_WIN32) |
132 | 489 file(REMOVE ${parameters_list_file_tmp}) |
490 foreach(arg_tmp ${parameters_tmp}) | |
491 file(APPEND ${parameters_list_file_tmp} "${arg_tmp}\n") | |
492 endforeach(arg_tmp) | |
493 set(param_tmp @${parameters_list_file_tmp}) | |
494 elseif(CMAKE_HOST_UNIX) | |
495 set(param_tmp ${parameters_tmp}) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
496 endif(CMAKE_HOST_WIN32) |
132 | 497 #get_imported_files(depends_tmp ${SOURCES_tmp}) |
498 add_custom_command( | |
499 OUTPUT ${output_name_tmp} | |
500 ${additional_commands_tmp} | |
501 COMMAND ${DC} | |
502 ARGS ${param_tmp} | |
503 DEPENDS ${SOURCES_tmp} ${depends_tmp} | |
504 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
505 COMMENT "Linking ${name}" | |
506 ) | |
507 endif(NOT used_ar_tmp) | |
508 add_custom_target(${name} ALL DEPENDS ${DEPENDS_tmp} ${output_name_tmp}) | |
509 endmacro(add_d_target name) | |
510 | |
511 ## Add static library target. | |
512 macro(add_d_static_lib name) | |
513 add_d_target(${name} TYPE STATIC SOURCES ${ARGN}) | |
514 endmacro(add_d_static_lib name) | |
515 | |
516 ## Add binary target. | |
517 macro(add_d_program name) | |
518 add_d_target(${name} TYPE BINARY SOURCES ${ARGN}) | |
519 endmacro(add_d_program name) | |
520 | |
521 ## Add shared library target. | |
522 macro(add_d_shared_lib name) | |
523 add_d_target(${name} TYPE SHARED SOURCES ${ARGN}) | |
524 endmacro(add_d_shared_lib name) | |
525 | |
526 ## Add library target. | |
237 | 527 ## Library will shared if it supported. |
132 | 528 macro(add_d_lib name) |
529 if(D_IS_MARS) | |
530 add_d_target(${name} TYPE STATIC ${ARGN}) | |
531 else(D_IS_MARS) | |
532 add_d_target(${name} TYPE SHARED ${ARGN}) | |
533 endif(D_IS_MARS) | |
534 endmacro(add_d_lib name) | |
535 | |
245 | 536 ## |
237 | 537 macro(get_imported_files_old imported) |
132 | 538 execute_process(COMMAND ${DC} -c -o- -v ${compile_flags_tmp} ${ARGN} |
539 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
540 OUTPUT_VARIABLE dc_output_tmp | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
541 |
132 | 542 ) |
245 | 543 string(REGEX MATCHALL "import[^(]*([^)]*)" dc_output_tmp "${dc_output_tmp}") |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
544 |
237 | 545 ## Initial filter. |
546 regex_safe_string(tmp ${CMAKE_CURRENT_SOURCE_DIR}) | |
547 regex_safe_string(tmp2 ${CMAKE_CURRENT_BINARY_DIR}) | |
245 | 548 set(regex_includes_tmp "${tmp}|${tmp2}") |
237 | 549 |
132 | 550 set(${imported}) |
551 foreach(import_tmp ${dc_output_tmp}) | |
237 | 552 ## Getting a next import. |
245 | 553 string(REGEX REPLACE "import[^(]*\\(([^)]*)" "\\1" import_tmp ${import_tmp}) |
237 | 554 ## Filtering. |
245 | 555 string(REPLACE "\\" "/" import_tmp ${import_tmp}) |
556 string(REGEX MATCH "(${regex_includes_tmp})" found "${import_tmp}") | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
557 if(CMAKE_HOST_WIN32) |
245 | 558 string(SUBSTRING "${import_tmp}" 1 2 first_sym_tmp) |
559 set(full_path_tmp) | |
560 if(${first_sym_tmp} STREQUAL ":/") | |
561 set(full_path_tmp 1) | |
562 endif(${first_sym_tmp} STREQUAL ":/") | |
563 elseif(CMAKE_HOST_UNIX) | |
564 string(SUBSTRING "${import_tmp}" 0 1 first_sym_tmp) | |
565 set(full_path_tmp) | |
566 if(${first_sym_tmp} STREQUAL "/") | |
567 set(full_path_tmp 1) | |
568 endif(${first_sym_tmp} STREQUAL "/") | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
569 endif(CMAKE_HOST_WIN32) |
245 | 570 if(found OR NOT full_path_tmp) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
571 set(${imported} ${${imported}} ${import_tmp}) |
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
572 endif(found OR NOT full_path_tmp) |
132 | 573 endforeach(import_tmp ${dc_output_tmp}) |
237 | 574 endmacro(get_imported_files_old imported) |
132 | 575 |
576 macro(filter_paths result) | |
577 set(${result}) | |
578 set(read_now_tmp paths) | |
579 set(include_tmp) | |
580 set(paths_tmp) | |
581 foreach(arg_tmp ${ARGN}) | |
582 set(founded_tmp) | |
583 if(${arg_tmp} STREQUAL "INCLUDE_PATHS") | |
584 set(read_now_tmp includes) | |
585 set(founded_tmp 1) | |
586 elseif(${arg_tmp} STREQUAL "INCLUDE_CURRENT_DIR") | |
587 set(locale_tmp 1) | |
588 set(read_now_tmp paths) | |
589 set(founded_tmp 1) | |
590 endif(${arg_tmp} STREQUAL "INCLUDE_PATHS") | |
591 if(NOT founded_tmp) | |
592 set(${read_now_tmp}_tmp ${${read_now_tmp}_tmp} ${arg_tmp}) | |
593 endif(NOT founded_tmp) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
594 endforeach(arg_tmp ${ARGN}) |
132 | 595 regex_safe_string(include_tmp ${includes_tmp}) |
596 set(regex_include_tmp) | |
597 set(is_first_tmp 1) | |
598 foreach(include_tmp ${includes_tmp}) | |
599 if(is_first_tmp) | |
600 set(is_first_tmp 1) | |
601 else(is_first_tmp) | |
602 set(regex_includes_tmp ${regex_includes_tmp}|) | |
603 endif(is_first_tmp) | |
604 set(regex_includes_tmp ${regex_includes_tmp}${include_tmp}) | |
605 endforeach(include_tmp ${include_tmp}) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
606 foreach(path_tmp ${paths_tmp}) |
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
607 file(TO_CMAKE_PATH path_tmp ${path_tmp}) |
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
608 string(REGEX MATCH "(${regex_includes_tmp})[^/]*" found "${path_tmp}") |
132 | 609 set(full_path_tmp 1) |
610 if(locale_tmp) | |
611 string(SUBSTRING "${path_tmp}" 0 1 first_sym_tmp) | |
612 set(full_path_tmp) | |
613 if(${first_sym_tmp} STREQUAL "/") | |
614 set(full_path_tmp 1) | |
615 endif(${first_sym_tmp} STREQUAL "/") | |
616 endif(locale_tmp) | |
617 if(NOT found AND full_path_tmp) | |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
618 else(NOT found AND full_path_tmp) |
132 | 619 set(${result} ${${result}} ${path_tmp}) |
366
da4235301224
Fixed VoidFunc. Updated to dmd.2.047.
Max Samukha <maxter@spambox.com>
parents:
355
diff
changeset
|
620 endif(NOT found AND full_path_tmp) |
132 | 621 endforeach(path_tmp ${paths_tmp}) |
622 endmacro(filter_paths ) | |
623 | |
624 macro(get_files_depends out) | |
275 | 625 set(deps_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/${ARGN}.deps) |
626 set(update_deps_tmp 0) | |
627 foreach(arg_tmp ${ARGN}) | |
628 if(NOT IS_ABSOLUTE arg_tmp) | |
629 set(arg_tmp ${CMAKE_CURRENT_SOURCE_DIR}/${arg_tmp}) | |
630 endif(NOT IS_ABSOLUTE arg_tmp) | |
631 if(${arg_tmp} IS_NEWER_THAN ${deps_file_tmp}) | |
632 set(update_deps_tmp 1) | |
633 break(arg_tmp ${ARGN}) | |
634 endif(${arg_tmp} IS_NEWER_THAN ${deps_file_tmp}) | |
635 endforeach(arg_tmp ${ARGN}) | |
636 if(update_deps_tmp) | |
637 get_imported_files_old(${out} ${ARGN}) | |
638 #filter_paths(${out} ${${out}} INCLUDE_CURRENT_DIR INCLUDE_PATHS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | |
639 set(${out} ${ARGN} ${${out}}) | |
640 file(WRITE ${deps_file_tmp} "${${out}}") | |
641 else(update_deps_tmp) | |
642 file(STRINGS ${deps_file_tmp} ${out}) | |
643 endif(update_deps_tmp) | |
132 | 644 endmacro(get_files_depends out) |