This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via f030a3a55a25b12401b66e4c0573f78ea2fbb0c1 (commit) via 19b96de7f917c7089114167823aba43281ac196b (commit) via 7ec00ebe031f21dfb37091769528ef0b6131dcff (commit) via 08c09a26a36a59393338c6c9fb147e4a31e1de2f (commit) via d7bdf0f3dc11121d10ca44476000ee3d216c5228 (commit) via 7ea41a0288e38f1e2f1e6c3e6e6b15e7dbcb851d (commit) via 058ddd3adf73d80974b6bf40103e8b1b35a30d03 (commit) via 558a7791233cecd9f87b8bd9caa9fcca58ef5d8b (commit) from 7699c35215babd00f1b41af868592a4ae0046e78 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f030a3a55a25b12401b66e4c0573f78ea2fbb0c1 commit f030a3a55a25b12401b66e4c0573f78ea2fbb0c1 Merge: 7699c35 19b96de Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 08:35:09 2014 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Jan 24 08:35:09 2014 -0500 Merge topic 'fix-Qt-autogen' into next 19b96de7 QtAutogen: Fix autouic target options in the presence of a config. 7ec00ebe QtAutogen: Remove unused variables. 08c09a26 QtAutogen: Remove read of SKIP_AUTOUIC target property. d7bdf0f3 QtAutogen: Use Qt 4 IMPORTED targets to find executable locations. 7ea41a02 Qt4: Use IMPORTED executable names with custom commands. 058ddd3a Qt4: Create IMPORTED executable targets for all Qt executables. 558a7791 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19b96de7f917c7089114167823aba43281ac196b commit 19b96de7f917c7089114167823aba43281ac196b Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 13:19:36 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Jan 24 13:21:45 2014 +0100 QtAutogen: Fix autouic target options in the presence of a config. Read the correct variable. Add scopes to prevent escape of variables. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index cd576f4..23a3998 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1035,6 +1035,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, this->MocExecutable = makefile->GetSafeDefinition("AM_QT_MOC_EXECUTABLE"); this->UicExecutable = makefile->GetSafeDefinition("AM_QT_UIC_EXECUTABLE"); this->RccExecutable = makefile->GetSafeDefinition("AM_QT_RCC_EXECUTABLE"); + { std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS"; std::string compileDefsProp = compileDefsPropOrig; if(config) @@ -1045,6 +1046,8 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, const char *compileDefs = makefile->GetDefinition(compileDefsProp.c_str()); this->MocCompileDefinitionsStr = compileDefs ? compileDefs : makefile->GetSafeDefinition(compileDefsPropOrig.c_str()); + } + { std::string includesPropOrig = "AM_MOC_INCLUDES"; std::string includesProp = includesPropOrig; if(config) @@ -1055,6 +1058,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, const char *includes = makefile->GetDefinition(includesProp.c_str()); this->MocIncludesStr = includes ? includes : makefile->GetSafeDefinition(includesPropOrig.c_str()); + } this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS"); this->ProjectBinaryDir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR"); this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR"); @@ -1074,7 +1078,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, = makefile->GetSafeDefinition(uicOptionsProp.c_str()); cmSystemTools::ExpandListArgument( uicTargetOptions ? uicTargetOptions - : makefile->GetSafeDefinition(includesPropOrig.c_str()), + : makefile->GetSafeDefinition(uicOptionsPropOrig.c_str()), this->UicTargetOptions); const char *uicOptionsOptions = makefile->GetSafeDefinition("AM_UIC_OPTIONS_OPTIONS"); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ec00ebe031f21dfb37091769528ef0b6131dcff commit 7ec00ebe031f21dfb37091769528ef0b6131dcff Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 13:18:35 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Jan 24 13:21:38 2014 +0100 QtAutogen: Remove unused variables. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 88c4297..cd576f4 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1964,7 +1964,6 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName) std::vector<cmStdString> command; command.push_back(this->UicExecutable); - std::string options; std::vector<std::string> opts = this->UicTargetOptions; std::map<std::string, std::string>::const_iterator optionIt = this->UicOptions.find(ui_input_file); @@ -2039,7 +2038,6 @@ bool cmQtAutoGenerators::GenerateQrc() &sourceNewerThanQrc); if (this->GenerateAll || !success || sourceNewerThanQrc >= 0) { - std::string options; std::map<std::string, std::string>::const_iterator optionIt = this->RccOptions.find(*si); if (optionIt != this->RccOptions.end()) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08c09a26a36a59393338c6c9fb147e4a31e1de2f commit 08c09a26a36a59393338c6c9fb147e4a31e1de2f Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 13:12:10 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Jan 24 13:12:10 2014 +0100 QtAutogen: Remove read of SKIP_AUTOUIC target property. Skipping AUTOUIC for a target is achieved by setting the AUTOUIC target property go OFF. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 2987c25..88c4297 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -652,8 +652,6 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, std::string skip_uic; const char *sep = ""; - bool skip = target->GetPropertyAsBool("SKIP_AUTOUIC"); - std::set<cmStdString> skipped; for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin(); @@ -663,12 +661,8 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, cmSourceFile* sf = *fileIt; std::string absFile = cmsys::SystemTools::GetRealPath( sf->GetFullPath().c_str()); - if (!skip) - { - skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")); - } - if (skip) + if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"))) { skip_uic += sep; skip_uic += absFile; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7bdf0f3dc11121d10ca44476000ee3d216c5228 commit d7bdf0f3dc11121d10ca44476000ee3d216c5228 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 13:02:16 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Jan 24 13:10:14 2014 +0100 QtAutogen: Use Qt 4 IMPORTED targets to find executable locations. Avoid using the moc from Qt 5 with Qt 4 based targets. Moc generates a version check to ensure that such generated code does not compile. The Qt4And5Automoc unit test should have been testing this, but it was not because the test was broken. In that unit test, moc was run on trivial files which have no significant content, and in particular no Q_OBJECT macro. Therefore moc was generating empty files which do not even contain the version check. Fix this by generating files for input to moc at cmake time. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index da22ab5..2987c25 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -549,9 +549,6 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target, } } - const char *qtMoc = makefile->GetSafeDefinition("QT_MOC_EXECUTABLE"); - makefile->AddDefinition("_qt_moc_executable", qtMoc); - const char *qtVersion = makefile->GetDefinition("_target_qt_version"); if (strcmp(qtVersion, "5") == 0) { @@ -564,13 +561,21 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target, } makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(0)); } - else + else if (strcmp(qtVersion, "4") == 0) { - if (strcmp(qtVersion, "4") != 0) + cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc"); + if (!qt4Moc) { - cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and " - "Qt 5 ", autogenTargetName.c_str()); + cmSystemTools::Error("Qt4::moc target not found ", + autogenTargetName.c_str()); + return; } + makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(0)); + } + else + { + cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and " + "Qt 5 ", autogenTargetName.c_str()); } } @@ -641,9 +646,6 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, { cmMakefile *makefile = target->GetMakefile(); - const char *qtUic = makefile->GetSafeDefinition("QT_UIC_EXECUTABLE"); - makefile->AddDefinition("_qt_uic_executable", qtUic); - std::vector<cmSourceFile*> srcFiles; target->GetSourceFiles(srcFiles); @@ -747,20 +749,27 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, if (!qt5Uic) { // Project does not use Qt5Widgets, but has AUTOUIC ON anyway - makefile->RemoveDefinition("_qt_uic_executable"); } else { makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(0)); } } - else + else if (strcmp(qtVersion, "4") == 0) { - if (strcmp(qtVersion, "4") != 0) + cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic"); + if (!qt4Uic) { - cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and " - "Qt 5 ", targetName); + cmSystemTools::Error("Qt4::uic target not found ", + targetName); + return; } + makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(0)); + } + else + { + cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and " + "Qt 5 ", targetName); } } @@ -927,9 +936,6 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target) makefile->AddDefinition("_qt_rcc_options_options", cmLocalGenerator::EscapeForCMake(rccFileOptions.c_str()).c_str()); - const char *qtRcc = makefile->GetSafeDefinition("QT_RCC_EXECUTABLE"); - makefile->AddDefinition("_qt_rcc_executable", qtRcc); - const char* targetName = target->GetName(); if (strcmp(qtVersion, "5") == 0) { @@ -942,13 +948,21 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target) } makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(0)); } - else + else if (strcmp(qtVersion, "4") == 0) { - if (strcmp(qtVersion, "4") != 0) + cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc"); + if (!qt4Rcc) { - cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and " - "Qt 5 ", targetName); + cmSystemTools::Error("Qt4::rcc target not found ", + targetName); + return; } + makefile->AddDefinition("_qt_rcc_executable", qt4Rcc->GetLocation(0)); + } + else + { + cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and " + "Qt 5 ", targetName); } } diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt index 0cc80fe..61d5743 100644 --- a/Tests/Qt4And5Automoc/CMakeLists.txt +++ b/Tests/Qt4And5Automoc/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 2.8.12) project(Qt4And5Automoc) @@ -7,7 +8,17 @@ find_package(Qt5Core REQUIRED) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_executable(qt4_exe main_qt4.cpp) +macro(generate_main_file VERSION) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/main_qt${VERSION}.cpp" COPYONLY) + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/main_qt${VERSION}.cpp" + "#include \"main_qt${VERSION}.moc\"\n" + ) +endmacro() + +generate_main_file(4) +generate_main_file(5) + +add_executable(qt4_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt4.cpp") target_link_libraries(qt4_exe Qt4::QtCore) -add_executable(qt5_exe main_qt5.cpp) +add_executable(qt5_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt5.cpp") target_link_libraries(qt5_exe Qt5::Core) diff --git a/Tests/Qt4And5Automoc/main.cpp b/Tests/Qt4And5Automoc/main.cpp.in similarity index 100% rename from Tests/Qt4And5Automoc/main.cpp rename to Tests/Qt4And5Automoc/main.cpp.in diff --git a/Tests/Qt4And5Automoc/main_qt4.cpp b/Tests/Qt4And5Automoc/main_qt4.cpp deleted file mode 100644 index a84ce89..0000000 --- a/Tests/Qt4And5Automoc/main_qt4.cpp +++ /dev/null @@ -1,4 +0,0 @@ - -#include "main.cpp" - -#include "main_qt4.moc" diff --git a/Tests/Qt4And5Automoc/main_qt5.cpp b/Tests/Qt4And5Automoc/main_qt5.cpp deleted file mode 100644 index 287b261..0000000 --- a/Tests/Qt4And5Automoc/main_qt5.cpp +++ /dev/null @@ -1,4 +0,0 @@ - -#include "main.cpp" - -#include "main_qt5.moc" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ea41a0288e38f1e2f1e6c3e6e6b15e7dbcb851d commit 7ea41a0288e38f1e2f1e6c3e6e6b15e7dbcb851d Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 13:00:48 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Jan 24 13:06:22 2014 +0100 Qt4: Use IMPORTED executable names with custom commands. Finding Qt 5 can overwrite the QT_MOC_EXECUTABLE variable with the moc from Qt 5. Use the IMPORTED target with the explicit version in the name to avoid that. 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 ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=058ddd3adf73d80974b6bf40103e8b1b35a30d03 commit 058ddd3adf73d80974b6bf40103e8b1b35a30d03 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Jan 24 12:55:21 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Jan 24 13:06:22 2014 +0100 Qt4: Create IMPORTED executable targets for all Qt executables. Qt 5 already has similar IMPORTED targets. The versioned namespace will allow de-conflicting the variable names between Qt 4 and Qt 5. diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 0bf2b99..6628214 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") ----------------------------------------------------------------------- Summary of changes: Modules/FindQt4.cmake | 86 ++++++------------------ Modules/Qt4Macros.cmake | 18 ++--- Source/CMakeVersion.cmake | 2 +- Source/cmQtAutoGenerators.cxx | 74 +++++++++++--------- Tests/Qt4And5Automoc/CMakeLists.txt | 15 ++++- Tests/Qt4And5Automoc/{main.cpp => main.cpp.in} | 0 Tests/Qt4And5Automoc/main_qt4.cpp | 4 -- Tests/Qt4And5Automoc/main_qt5.cpp | 4 -- 8 files changed, 87 insertions(+), 116 deletions(-) rename Tests/Qt4And5Automoc/{main.cpp => main.cpp.in} (100%) delete mode 100644 Tests/Qt4And5Automoc/main_qt4.cpp delete mode 100644 Tests/Qt4And5Automoc/main_qt5.cpp hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits