Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Modules / Qt4Macros.cmake
1 # This file is included by FindQt4.cmake, don't include it directly.
2
3 #=============================================================================
4 # Copyright 2005-2009 Kitware, Inc.
5 #
6 # Distributed under the OSI-approved BSD License (the "License");
7 # see accompanying file Copyright.txt for details.
8 #
9 # This software is distributed WITHOUT ANY WARRANTY; without even the
10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # See the License for more information.
12 #=============================================================================
13 # (To distribute this file outside of CMake, substitute the full
14 #  License text for the above reference.)
15
16
17 ######################################
18 #
19 #       Macros for building Qt files
20 #
21 ######################################
22
23
24 macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options _qt4_target)
25   set(${_qt4_files})
26   set(${_qt4_options})
27   set(_QT4_DOING_OPTIONS FALSE)
28   set(_QT4_DOING_TARGET FALSE)
29   foreach(_currentArg ${ARGN})
30     if ("x${_currentArg}" STREQUAL "xOPTIONS")
31       set(_QT4_DOING_OPTIONS TRUE)
32     elseif ("x${_currentArg}" STREQUAL "xTARGET")
33       set(_QT4_DOING_TARGET TRUE)
34     else ()
35       if(_QT4_DOING_TARGET)
36         set(${_qt4_target} "${_currentArg}")
37       elseif(_QT4_DOING_OPTIONS)
38         list(APPEND ${_qt4_options} "${_currentArg}")
39       else()
40         list(APPEND ${_qt4_files} "${_currentArg}")
41       endif()
42     endif ()
43   endforeach()
44 endmacro ()
45
46
47 # macro used to create the names of output files preserving relative dirs
48 macro (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
49   string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
50   string(LENGTH ${infile} _infileLength)
51   set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
52   if(_infileLength GREATER _binlength)
53     string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
54     if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
55       file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
56     else()
57       file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
58     endif()
59   else()
60     file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
61   endif()
62   if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
63     string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
64   endif()
65   set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
66   string(REPLACE ".." "__" _outfile ${_outfile})
67   get_filename_component(outpath ${_outfile} PATH)
68   get_filename_component(_outfile ${_outfile} NAME_WE)
69   file(MAKE_DIRECTORY ${outpath})
70   set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
71 endmacro ()
72
73
74 macro (QT4_GET_MOC_FLAGS _moc_flags)
75   set(${_moc_flags})
76   get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
77
78   foreach(_current ${_inc_DIRS})
79     if("${_current}" MATCHES "\\.framework/?$")
80       string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
81       set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
82     else()
83       set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
84     endif()
85   endforeach()
86
87   get_directory_property(_defines COMPILE_DEFINITIONS)
88   foreach(_current ${_defines})
89     set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
90   endforeach()
91
92   if(Q_WS_WIN)
93     set(${_moc_flags} ${${_moc_flags}} -DWIN32)
94   endif()
95
96 endmacro()
97
98
99 # helper macro to set up a moc rule
100 macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
101   # For Windows, create a parameters file to work around command line length limit
102   # Pass the parameters in a file.  Set the working directory to
103   # be that containing the parameters file and reference it by
104   # just the file name.  This is necessary because the moc tool on
105   # MinGW builds does not seem to handle spaces in the path to the
106   # file given with the @ syntax.
107   get_filename_component(_moc_outfile_name "${outfile}" NAME)
108   get_filename_component(_moc_outfile_dir "${outfile}" PATH)
109   if(_moc_outfile_dir)
110     set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
111   endif()
112   set (_moc_parameters_file ${outfile}_parameters)
113   set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
114   string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
115
116   if(moc_target)
117     set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
118     set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>")
119
120     set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},\n-I>\n>")
121     set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},\n-D>\n>")
122
123     file (GENERATE
124       OUTPUT ${_moc_parameters_file}
125       CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n"
126     )
127
128     set(targetincludes)
129     set(targetdefines)
130   else()
131     file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n")
132   endif()
133
134   set(_moc_extra_parameters_file @${_moc_parameters_file})
135   add_custom_command(OUTPUT ${outfile}
136                       COMMAND ${QT_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
137                       DEPENDS ${infile}
138                       ${_moc_working_dir}
139                       VERBATIM)
140 endmacro ()
141
142
143 macro (QT4_GENERATE_MOC infile outfile )
144 # get include dirs and flags
145    QT4_GET_MOC_FLAGS(moc_flags)
146    get_filename_component(abs_infile ${infile} ABSOLUTE)
147    set(_outfile "${outfile}")
148    if(NOT IS_ABSOLUTE "${outfile}")
149      set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
150    endif()
151
152    if ("x${ARGV2}" STREQUAL "xTARGET")
153       set(moc_target ${ARGV3})
154    endif()
155    QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
156    set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
157 endmacro ()
158
159
160 # QT4_WRAP_CPP(outfiles inputfile ... )
161
162 macro (QT4_WRAP_CPP outfiles )
163   # get include dirs
164   QT4_GET_MOC_FLAGS(moc_flags)
165   QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
166
167   foreach (it ${moc_files})
168     get_filename_component(it ${it} ABSOLUTE)
169     QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
170     QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
171     set(${outfiles} ${${outfiles}} ${outfile})
172   endforeach()
173
174 endmacro ()
175
176
177 # QT4_WRAP_UI(outfiles inputfile ... )
178
179 macro (QT4_WRAP_UI outfiles )
180   QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
181
182   foreach (it ${ui_files})
183     get_filename_component(outfile ${it} NAME_WE)
184     get_filename_component(infile ${it} ABSOLUTE)
185     set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
186     add_custom_command(OUTPUT ${outfile}
187       COMMAND ${QT_UIC_EXECUTABLE}
188       ARGS ${ui_options} -o ${outfile} ${infile}
189       MAIN_DEPENDENCY ${infile} VERBATIM)
190     set(${outfiles} ${${outfiles}} ${outfile})
191   endforeach ()
192
193 endmacro ()
194
195
196 # QT4_ADD_RESOURCES(outfiles inputfile ... )
197
198 macro (QT4_ADD_RESOURCES outfiles )
199   QT4_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN})
200
201   foreach (it ${rcc_files})
202     get_filename_component(outfilename ${it} NAME_WE)
203     get_filename_component(infile ${it} ABSOLUTE)
204     get_filename_component(rc_path ${infile} PATH)
205     set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
206
207     set(_RC_DEPENDS)
208     if(EXISTS "${infile}")
209       #  parse file for dependencies
210       #  all files are absolute paths or relative to the location of the qrc file
211       file(READ "${infile}" _RC_FILE_CONTENTS)
212       string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
213       foreach(_RC_FILE ${_RC_FILES})
214         string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
215         if(NOT IS_ABSOLUTE "${_RC_FILE}")
216           set(_RC_FILE "${rc_path}/${_RC_FILE}")
217         endif()
218         set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
219       endforeach()
220       unset(_RC_FILES)
221       unset(_RC_FILE_CONTENTS)
222       # Since this cmake macro is doing the dependency scanning for these files,
223       # let's make a configured file and add it as a dependency so cmake is run
224       # again when dependencies need to be recomputed.
225       QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
226       configure_file("${infile}" "${out_depends}" COPY_ONLY)
227     else()
228       # The .qrc file does not exist (yet). Let's add a dependency and hope
229       # that it will be generated later
230       set(out_depends)
231     endif()
232
233     add_custom_command(OUTPUT ${outfile}
234       COMMAND ${QT_RCC_EXECUTABLE}
235       ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
236       MAIN_DEPENDENCY ${infile}
237       DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
238     set(${outfiles} ${${outfiles}} ${outfile})
239   endforeach ()
240
241 endmacro ()
242
243
244 macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
245   get_filename_component(_infile ${_interface} ABSOLUTE)
246   set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
247   set(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
248   set(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
249
250   get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
251   if(_nonamespace)
252     set(_params -N -m)
253   else()
254     set(_params -m)
255   endif()
256
257   get_source_file_property(_classname ${_interface} CLASSNAME)
258   if(_classname)
259     set(_params ${_params} -c ${_classname})
260   endif()
261
262   get_source_file_property(_include ${_interface} INCLUDE)
263   if(_include)
264     set(_params ${_params} -i ${_include})
265   endif()
266
267   add_custom_command(OUTPUT "${_impl}" "${_header}"
268       COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
269       DEPENDS ${_infile} VERBATIM)
270
271   set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
272
273   QT4_GENERATE_MOC("${_header}" "${_moc}")
274
275   list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
276   MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
277
278 endmacro()
279
280
281 macro(QT4_ADD_DBUS_INTERFACES _sources)
282   foreach (_current_FILE ${ARGN})
283     get_filename_component(_infile ${_current_FILE} ABSOLUTE)
284     get_filename_component(_basename ${_current_FILE} NAME)
285     # get the part before the ".xml" suffix
286     string(TOLOWER ${_basename} _basename)
287     string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
288     QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
289   endforeach ()
290 endmacro()
291
292
293 macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
294   QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options _qt4_dbus_target ${ARGN})
295
296   get_filename_component(_in_file ${_header} ABSOLUTE)
297   get_filename_component(_basename ${_header} NAME_WE)
298
299   if (_customName)
300     if (IS_ABSOLUTE ${_customName})
301       get_filename_component(_containingDir ${_customName} PATH)
302       if (NOT EXISTS ${_containingDir})
303         file(MAKE_DIRECTORY "${_containingDir}")
304       endif()
305       set(_target ${_customName})
306     else()
307       set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
308     endif()
309   else ()
310     set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
311   endif ()
312
313   add_custom_command(OUTPUT ${_target}
314       COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}
315       DEPENDS ${_in_file} VERBATIM
316   )
317 endmacro()
318
319
320 macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
321   get_filename_component(_infile ${_xml_file} ABSOLUTE)
322
323   set(_optionalBasename "${ARGV4}")
324   if (_optionalBasename)
325     set(_basename ${_optionalBasename} )
326   else ()
327     string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
328     string(TOLOWER ${_basename} _basename)
329   endif ()
330
331   set(_optionalClassName "${ARGV5}")
332   set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
333   set(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
334   set(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
335
336   if(_optionalClassName)
337     add_custom_command(OUTPUT "${_impl}" "${_header}"
338        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
339        DEPENDS ${_infile} VERBATIM
340     )
341   else()
342     add_custom_command(OUTPUT "${_impl}" "${_header}"
343        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
344        DEPENDS ${_infile} VERBATIM
345      )
346   endif()
347
348   QT4_GENERATE_MOC("${_header}" "${_moc}")
349   set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
350   MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
351
352   list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
353 endmacro()
354
355
356 macro(QT4_AUTOMOC)
357   if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
358     if(CMAKE_WARN_DEPRECATED)
359       set(messageType WARNING)
360     endif()
361     if(CMAKE_ERROR_DEPRECATED)
362       set(messageType FATAL_ERROR)
363     endif()
364     if(messageType)
365       message(${messageType} "The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.")
366     endif()
367   endif()
368   QT4_GET_MOC_FLAGS(_moc_INCS)
369
370   set(_matching_FILES )
371   foreach (_current_FILE ${ARGN})
372
373     get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
374     # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
375     # This is required to make uic work correctly:
376     # we need to add generated .cpp files to the sources (to compile them),
377     # but we cannot let automoc handle them, as the .cpp files don't exist yet when
378     # cmake is run for the very first time on them -> however the .cpp files might
379     # exist at a later run. at that time we need to skip them, so that we don't add two
380     # different rules for the same moc file
381     get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
382
383     if ( NOT _skip AND EXISTS ${_abs_FILE} )
384
385       file(READ ${_abs_FILE} _contents)
386
387       get_filename_component(_abs_PATH ${_abs_FILE} PATH)
388
389       string(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
390       if(_match)
391         foreach (_current_MOC_INC ${_match})
392           string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
393
394           get_filename_component(_basename ${_current_MOC} NAME_WE)
395           if(EXISTS ${_abs_PATH}/${_basename}.hpp)
396             set(_header ${_abs_PATH}/${_basename}.hpp)
397           else()
398             set(_header ${_abs_PATH}/${_basename}.h)
399           endif()
400           set(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
401           QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "" "")
402           MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
403         endforeach ()
404       endif()
405     endif ()
406   endforeach ()
407 endmacro()
408
409
410 macro(QT4_CREATE_TRANSLATION _qm_files)
411    QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN})
412    set(_my_sources)
413    set(_my_dirs)
414    set(_my_tsfiles)
415    set(_ts_pro)
416    foreach (_file ${_lupdate_files})
417      get_filename_component(_ext ${_file} EXT)
418      get_filename_component(_abs_FILE ${_file} ABSOLUTE)
419      if(_ext MATCHES "ts")
420        list(APPEND _my_tsfiles ${_abs_FILE})
421      else()
422        if(NOT _ext)
423          list(APPEND _my_dirs ${_abs_FILE})
424        else()
425          list(APPEND _my_sources ${_abs_FILE})
426        endif()
427      endif()
428    endforeach()
429    foreach(_ts_file ${_my_tsfiles})
430      if(_my_sources)
431        # make a .pro file to call lupdate on, so we don't make our commands too
432        # long for some systems
433        get_filename_component(_ts_name ${_ts_file} NAME_WE)
434        set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
435        set(_pro_srcs)
436        foreach(_pro_src ${_my_sources})
437          set(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
438        endforeach()
439        set(_pro_includes)
440        get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
441        foreach(_pro_include ${_inc_DIRS})
442          get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
443          set(_pro_includes "${_pro_includes} \"${_abs_include}\"")
444        endforeach()
445        file(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
446      endif()
447      add_custom_command(OUTPUT ${_ts_file}
448         COMMAND ${QT_LUPDATE_EXECUTABLE}
449         ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
450         DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
451    endforeach()
452    QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
453 endmacro()
454
455
456 macro(QT4_ADD_TRANSLATION _qm_files)
457   foreach (_current_FILE ${ARGN})
458     get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
459     get_filename_component(qm ${_abs_FILE} NAME_WE)
460     get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
461     if(output_location)
462       file(MAKE_DIRECTORY "${output_location}")
463       set(qm "${output_location}/${qm}.qm")
464     else()
465       set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
466     endif()
467
468     add_custom_command(OUTPUT ${qm}
469        COMMAND ${QT_LRELEASE_EXECUTABLE}
470        ARGS ${_abs_FILE} -qm ${qm}
471        DEPENDS ${_abs_FILE} VERBATIM
472     )
473     set(${_qm_files} ${${_qm_files}} ${qm})
474   endforeach ()
475 endmacro()
476
477 function(qt4_use_modules _target _link_type)
478   if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
479     if(CMAKE_WARN_DEPRECATED)
480       set(messageType WARNING)
481     endif()
482     if(CMAKE_ERROR_DEPRECATED)
483       set(messageType FATAL_ERROR)
484     endif()
485     if(messageType)
486       message(${messageType} "The qt4_use_modules function is obsolete. Use target_link_libraries with IMPORTED targets instead.")
487     endif()
488   endif()
489   if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE")
490     set(modules ${ARGN})
491     set(link_type ${_link_type})
492   else()
493     set(modules ${_link_type} ${ARGN})
494   endif()
495   foreach(_module ${modules})
496     string(TOUPPER ${_module} _ucmodule)
497     set(_targetPrefix QT_QT${_ucmodule})
498     if (_ucmodule STREQUAL QAXCONTAINER OR _ucmodule STREQUAL QAXSERVER)
499       if (NOT QT_Q${_ucmodule}_FOUND)
500         message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
501       endif()
502       set(_targetPrefix QT_Q${_ucmodule})
503     else()
504       if (NOT QT_QT${_ucmodule}_FOUND)
505         message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
506       endif()
507       if ("${_ucmodule}" STREQUAL "MAIN")
508         message(FATAL_ERROR "Can not use \"${_module}\" module with qt4_use_modules.")
509       endif()
510     endif()
511     target_link_libraries(${_target} ${link_type} ${${_targetPrefix}_LIBRARIES})
512     set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${${_targetPrefix}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default)
513     set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${${_targetPrefix}_COMPILE_DEFINITIONS})
514   endforeach()
515 endfunction()