diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/AutogenInfo.cmake.in | 2 | ||||
-rw-r--r-- | Modules/FindQt4.cmake | 86 | ||||
-rw-r--r-- | Modules/Qt4Macros.cmake | 18 |
3 files changed, 32 insertions, 74 deletions
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in index 7554213..b6f9791 100644 --- a/Modules/AutogenInfo.cmake.in +++ b/Modules/AutogenInfo.cmake.in @@ -1,4 +1,4 @@ -set(AM_SOURCES @_moc_files@ ) +set(AM_SOURCES @_cpp_files@ ) set(AM_RCC_SOURCES @_rcc_files@ ) set(AM_SKIP_MOC @_skip_moc@ ) set(AM_SKIP_UIC @_skip_uic@ ) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 0bf2b99..2d2feae 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1185,71 +1185,29 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set(QT_LINGUIST_EXECUTABLE NOTFOUND) endif() - find_program(QT_MOC_EXECUTABLE - NAMES moc-qt4 moc moc4 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_UIC_EXECUTABLE - NAMES uic-qt4 uic uic4 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_UIC3_EXECUTABLE - NAMES uic3 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_RCC_EXECUTABLE - NAMES rcc - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_DBUSCPP2XML_EXECUTABLE - NAMES qdbuscpp2xml - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_DBUSXML2CPP_EXECUTABLE - NAMES qdbusxml2cpp - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_LUPDATE_EXECUTABLE - NAMES lupdate-qt4 lupdate lupdate4 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_LRELEASE_EXECUTABLE - NAMES lrelease-qt4 lrelease lrelease4 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE - NAMES qcollectiongenerator-qt4 qcollectiongenerator - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - - find_program(QT_DESIGNER_EXECUTABLE - NAMES designer-qt4 designer designer4 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) + macro(_find_qt4_program VAR NAME) + find_program(${VAR} + NAMES ${ARGN} + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH + ) + if (${VAR} AND NOT TARGET ${NAME}) + add_executable(${NAME} IMPORTED) + set_property(TARGET ${NAME} PROPERTY IMPORTED_LOCATION ${${VAR}}) + endif() + endmacro() - find_program(QT_LINGUIST_EXECUTABLE - NAMES linguist-qt4 linguist linguist4 - PATHS ${QT_BINARY_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) + _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc moc4) + _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic uic4) + _find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3) + _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc) + _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml) + _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp) + _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate lupdate4) + _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease lrelease4) + _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator) + _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer designer4) + _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist linguist4) if (QT_MOC_EXECUTABLE) set(QT_WRAP_CPP "YES") diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index fd9819f..df2318b 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -140,7 +140,7 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) set(_moc_extra_parameters_file @${_moc_parameters_file}) add_custom_command(OUTPUT ${outfile} - COMMAND ${QT_MOC_EXECUTABLE} ${_moc_extra_parameters_file} + COMMAND Qt4::moc ${_moc_extra_parameters_file} DEPENDS ${infile} ${_moc_working_dir} VERBATIM) @@ -191,7 +191,7 @@ macro (QT4_WRAP_UI outfiles ) get_filename_component(infile ${it} ABSOLUTE) set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h) add_custom_command(OUTPUT ${outfile} - COMMAND ${QT_UIC_EXECUTABLE} + COMMAND Qt4::uic ARGS ${ui_options} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} VERBATIM) set(${outfiles} ${${outfiles}} ${outfile}) @@ -238,7 +238,7 @@ macro (QT4_ADD_RESOURCES outfiles ) endif() add_custom_command(OUTPUT ${outfile} - COMMAND ${QT_RCC_EXECUTABLE} + COMMAND Qt4::rcc ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM) @@ -272,7 +272,7 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) endif() add_custom_command(OUTPUT "${_impl}" "${_header}" - COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile} + COMMAND Qt4::qdbusxml2cpp ${_params} -p ${_basename} ${_infile} DEPENDS ${_infile} VERBATIM) set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) @@ -318,7 +318,7 @@ macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options endif () add_custom_command(OUTPUT ${_target} - COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target} + COMMAND Qt4::qdbuscpp2xml ${_qt4_dbus_options} ${_in_file} -o ${_target} DEPENDS ${_in_file} VERBATIM ) endmacro() @@ -342,12 +342,12 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional if(_optionalClassName) add_custom_command(OUTPUT "${_impl}" "${_header}" - COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} + COMMAND Qt4::qdbuscpp2xml -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) else() add_custom_command(OUTPUT "${_impl}" "${_header}" - COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} + COMMAND Qt4::qdbusxml2cpp -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) endif() @@ -445,7 +445,7 @@ macro(QT4_CREATE_TRANSLATION _qm_files) file(WRITE ${_ts_pro} "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n") endif() add_custom_command(OUTPUT ${_ts_file} - COMMAND ${QT_LUPDATE_EXECUTABLE} + COMMAND Qt4::lupdate ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file} DEPENDS ${_my_sources} ${_ts_pro} VERBATIM) endforeach() @@ -466,7 +466,7 @@ macro(QT4_ADD_TRANSLATION _qm_files) endif() add_custom_command(OUTPUT ${qm} - COMMAND ${QT_LRELEASE_EXECUTABLE} + COMMAND Qt4::lrelease ARGS ${_abs_FILE} -qm ${qm} DEPENDS ${_abs_FILE} VERBATIM ) |