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 997c8dbda3cfb297a40d2c99b29344c74fb89d18 (commit) via 2ed0d06691d5123d92395208338a361b23ec3d62 (commit) from d851b266b2996058ae7c4da6eec3e0a7c7d86acd (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=997c8dbda3cfb297a40d2c99b29344c74fb89d18 commit 997c8dbda3cfb297a40d2c99b29344c74fb89d18 Merge: d851b26 2ed0d06 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Mar 5 08:33:04 2014 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Wed Mar 5 08:33:04 2014 -0500 Merge topic 'test-AUTOGEN-custom-command-depends' into next 2ed0d066 QtAutogen: Fix AUTOGEN depends on custom command output with VS. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ed0d06691d5123d92395208338a361b23ec3d62 commit 2ed0d06691d5123d92395208338a361b23ec3d62 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Mar 5 13:43:50 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Wed Mar 5 14:30:32 2014 +0100 QtAutogen: Fix AUTOGEN depends on custom command output with VS. Visual Studio is handled as a special case for autogen depends. However, the special handling works only for target dependencies, not file dependencies output by a custom command. Split dependencies into lists of targets and non-targets and handle the targets only as a special case. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index dfb310e..31026b6 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -261,20 +261,37 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) // https://connect.microsoft.com/VisualStudio/feedback/details/769495 usePRE_BUILD = vslg->GetVersion() >= cmLocalVisualStudioGenerator::VS7; } + std::vector<std::string> prebuildDeps; if(usePRE_BUILD) { + for (std::vector<std::string>::iterator it = depends.begin(); + it != depends.end(); ) + { + if(makefile->FindTargetToUse(it->c_str())) + { + // The PRE_BUILD handling below can not handle non-targets. + prebuildDeps.push_back(*it); + it = depends.erase(it); + } + else + { + ++it; + } + } + // Add the pre-build command directly to bypass the OBJECT_LIBRARY // rejection in cmMakefile::AddCustomCommandToTarget because we know // PRE_BUILD will work for an OBJECT_LIBRARY in this specific case. std::vector<std::string> no_output; - cmCustomCommand cc(makefile, no_output, depends, + cmCustomCommand cc(makefile, no_output, prebuildDeps, commandLines, autogenComment.c_str(), workingDirectory.c_str()); cc.SetEscapeOldStyle(false); cc.SetEscapeAllowMakeVars(true); target->AddPreBuildCommand(cc); } - else + + if(!usePRE_BUILD || !depends.empty()) #endif { cmTarget* autogenTarget = makefile->AddUtilityCommand( diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 4da125f..0821b45 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -58,11 +58,17 @@ add_custom_target(generate_moc_input COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" ) +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" +) + add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> test.qrc resourcetester.cpp generated.cpp ) -set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input) +set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE) diff --git a/Tests/QtAutogen/generated.h b/Tests/QtAutogen/generated.h index dd22489..b6c2711 100644 --- a/Tests/QtAutogen/generated.h +++ b/Tests/QtAutogen/generated.h @@ -5,11 +5,12 @@ #include <QObject> #include "myinterface.h" +#include "myotherinterface.h" -class Generated : public QObject, MyInterface +class Generated : public QObject, MyInterface, MyOtherInterface { Q_OBJECT - Q_INTERFACES(MyInterface) + Q_INTERFACES(MyInterface MyOtherInterface) public: explicit Generated(QObject *parent = 0); }; diff --git a/Tests/QtAutogen/myotherinterface.h.in b/Tests/QtAutogen/myotherinterface.h.in new file mode 100644 index 0000000..d21e7af --- /dev/null +++ b/Tests/QtAutogen/myotherinterface.h.in @@ -0,0 +1,14 @@ + +#ifndef MYOTHERINTERFACE_H +#define MYOTHERINTERFACE_H + +#include <QObject> + +class MyOtherInterface +{ + +}; + +Q_DECLARE_INTERFACE(MyOtherInterface, "org.cmake.example.MyOtherInterface") + +#endif ----------------------------------------------------------------------- Summary of changes: Source/cmQtAutoGenerators.cxx | 21 +++++++++++++++++++-- Tests/QtAutogen/CMakeLists.txt | 8 +++++++- Tests/QtAutogen/generated.h | 5 +++-- Tests/QtAutogen/myotherinterface.h.in | 14 ++++++++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 Tests/QtAutogen/myotherinterface.h.in hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits