diff options
Diffstat (limited to 'Modules/Qt4Macros.cmake')
-rw-r--r-- | Modules/Qt4Macros.cmake | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 5c48970..33cacf1 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -140,20 +140,20 @@ endfunction () macro (QT4_GENERATE_MOC infile outfile ) -# get include dirs and flags - QT4_GET_MOC_FLAGS(moc_flags) - get_filename_component(abs_infile ${infile} ABSOLUTE) - set(_outfile "${outfile}") - if(NOT IS_ABSOLUTE "${outfile}") - set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") - endif() - - if (${ARGC} GREATER 3 AND "x${ARGV2}" STREQUAL "xTARGET") - set(moc_target ${ARGV3}) - endif() - QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}") - set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file - set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file + # get include dirs and flags + QT4_GET_MOC_FLAGS(moc_flags) + get_filename_component(abs_infile ${infile} ABSOLUTE) + set(_outfile "${outfile}") + if(NOT IS_ABSOLUTE "${outfile}") + set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + endif() + + if (${ARGC} GREATER 3 AND "x${ARGV2}" STREQUAL "xTARGET") + set(moc_target ${ARGV3}) + endif() + QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}") + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file endmacro () @@ -414,49 +414,49 @@ endmacro() macro(QT4_CREATE_TRANSLATION _qm_files) - QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN}) - set(_my_sources) - set(_my_dirs) - set(_my_tsfiles) - set(_ts_pro) - foreach (_file ${_lupdate_files}) - get_filename_component(_ext ${_file} EXT) - get_filename_component(_abs_FILE ${_file} ABSOLUTE) - if(_ext MATCHES "ts") - list(APPEND _my_tsfiles ${_abs_FILE}) - else() - if(NOT _ext) - list(APPEND _my_dirs ${_abs_FILE}) - else() - list(APPEND _my_sources ${_abs_FILE}) - endif() - endif() - endforeach() - foreach(_ts_file ${_my_tsfiles}) - if(_my_sources) - # make a .pro file to call lupdate on, so we don't make our commands too - # long for some systems - get_filename_component(_ts_name ${_ts_file} NAME_WE) - set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro) - set(_pro_srcs) - foreach(_pro_src ${_my_sources}) - string(APPEND _pro_srcs " \\\n \"${_pro_src}\"") - endforeach() - set(_pro_includes) - get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) - list(REMOVE_DUPLICATES _inc_DIRS) - foreach(_pro_include ${_inc_DIRS}) - get_filename_component(_abs_include "${_pro_include}" ABSOLUTE) - string(APPEND _pro_includes " \\\n \"${_abs_include}\"") - endforeach() - file(GENERATE OUTPUT ${_ts_pro} CONTENT "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n") - endif() - add_custom_command(OUTPUT ${_ts_file} + QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN}) + set(_my_sources) + set(_my_dirs) + set(_my_tsfiles) + set(_ts_pro) + foreach (_file ${_lupdate_files}) + get_filename_component(_ext ${_file} EXT) + get_filename_component(_abs_FILE ${_file} ABSOLUTE) + if(_ext MATCHES "ts") + list(APPEND _my_tsfiles ${_abs_FILE}) + else() + if(NOT _ext) + list(APPEND _my_dirs ${_abs_FILE}) + else() + list(APPEND _my_sources ${_abs_FILE}) + endif() + endif() + endforeach() + foreach(_ts_file ${_my_tsfiles}) + if(_my_sources) + # make a .pro file to call lupdate on, so we don't make our commands too + # long for some systems + get_filename_component(_ts_name ${_ts_file} NAME_WE) + set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro) + set(_pro_srcs) + foreach(_pro_src ${_my_sources}) + string(APPEND _pro_srcs " \\\n \"${_pro_src}\"") + endforeach() + set(_pro_includes) + get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) + list(REMOVE_DUPLICATES _inc_DIRS) + foreach(_pro_include ${_inc_DIRS}) + get_filename_component(_abs_include "${_pro_include}" ABSOLUTE) + string(APPEND _pro_includes " \\\n \"${_abs_include}\"") + endforeach() + file(GENERATE OUTPUT ${_ts_pro} CONTENT "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n") + endif() + add_custom_command(OUTPUT ${_ts_file} COMMAND Qt4::lupdate ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file} DEPENDS ${_my_sources} ${_ts_pro} VERBATIM) - endforeach() - QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles}) + endforeach() + QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles}) endmacro() |