[Cmake-commits] CMake branch, next, updated. v3.3.0-rc2-531-ge7c86af

Brad King brad.king at kitware.com
Fri Jun 19 10:35:58 EDT 2015


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  e7c86afe9b8913a8b76c75fdcb83b85f511949d2 (commit)
       via  12c3fcde52e8bdd5eed37e2f07a559ca72e5cd3d (commit)
       via  0e346427a254024b8eafe52956e8f4ba05d856ed (commit)
      from  ec38bf5bffc3abb491ca90aaf78276eeb222fef7 (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=e7c86afe9b8913a8b76c75fdcb83b85f511949d2
commit e7c86afe9b8913a8b76c75fdcb83b85f511949d2
Merge: ec38bf5 12c3fcd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 19 10:35:57 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 19 10:35:57 2015 -0400

    Merge topic 'qt-autogen-always-run' into next
    
    12c3fcde QtAutogen: Use PRE_BUILD in Visual Studio generators even with rcc
    0e346427 QtAutogen: Always run autogen step even when rcc is enabled (#15608)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12c3fcde52e8bdd5eed37e2f07a559ca72e5cd3d
commit 12c3fcde52e8bdd5eed37e2f07a559ca72e5cd3d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 19 09:41:56 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 19 10:32:13 2015 -0400

    QtAutogen: Use PRE_BUILD in Visual Studio generators even with rcc
    
    In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their
    input changes, 2014-09-17) we stopped using the PRE_BUILD step in
    Visual Studio generators when rcc is on in order to run it as a
    custom command with dependencies.  Our parent commit switched back
    to always running the command, so now it can be in PRE_BUILD again.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index d2f6e36..10339d1 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -394,14 +394,9 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
     }
 #endif
 
+  // Ninja needs to know the rcc outputs are byproducts.
   std::vector<std::string> rcc_output;
-  bool const isNinja =
-    makefile->GetGlobalGenerator()->GetName() == "Ninja";
-  if(isNinja
-#if defined(_WIN32) && !defined(__CYGWIN__)
-        || usePRE_BUILD
-#endif
-        )
+  if (makefile->GetGlobalGenerator()->GetName() == "Ninja")
     {
     std::vector<cmSourceFile*> srcFiles;
     target->GetConfigCommonSourceFiles(srcFiles);
@@ -439,9 +434,6 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
               {
               this->ListQt4RccInputs(sf, depends);
               }
-#if defined(_WIN32) && !defined(__CYGWIN__)
-            usePRE_BUILD = false;
-#endif
             }
           }
         }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e346427a254024b8eafe52956e8f4ba05d856ed
commit 0e346427a254024b8eafe52956e8f4ba05d856ed
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 19 09:38:04 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 19 10:29:38 2015 -0400

    QtAutogen: Always run autogen step even when rcc is enabled (#15608)
    
    In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their input
    changes, 2014-09-17) the "cmake -E cmake_autogen" rule was switched from
    always running to running as a custom command with dependencies if rcc
    is enabled.  This is not correct because automoc always needs to re-run.
    Switch back to always running the command.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index f472ed8..d2f6e36 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -466,31 +466,11 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
   else
 #endif
     {
-    cmTarget* autogenTarget = 0;
-    if (!rcc_output.empty() && !isNinja)
-      {
-      std::vector<std::string> no_byproducts;
-      makefile->AddCustomCommandToOutput(rcc_output, no_byproducts,
-                                         depends, "",
-                                         commandLines, 0,
-                                         workingDirectory.c_str(),
-                                         false, false);
-
-      cmCustomCommandLines no_commands;
-      autogenTarget = makefile->AddUtilityCommand(
-                          autogenTargetName, true,
-                          workingDirectory.c_str(), rcc_output,
-                          no_commands, false, autogenComment.c_str());
-
-      }
-    else
-      {
-      autogenTarget = makefile->AddUtilityCommand(
+    cmTarget* autogenTarget = makefile->AddUtilityCommand(
                                 autogenTargetName, true,
                                 workingDirectory.c_str(),
                                 /*byproducts=*/rcc_output, depends,
                                 commandLines, false, autogenComment.c_str());
-      }
 
     // Set target folder
     const char* autogenFolder = makefile->GetState()
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 60b44fd..1dfa648 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -167,3 +167,26 @@ file(TIMESTAMP "${qrc_file1}" file1_step1 "${timeformat}")
 if (NOT file1_step1 GREATER file1_before)
   message(SEND_ERROR "file1 (${qrc_file1}) should have changed in the first step!")
 endif()
+
+#-----------------------------------------------------------------------------
+try_compile(MOC_RERUN
+  "${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun"
+  "${CMAKE_CURRENT_SOURCE_DIR}/automoc_rerun"
+  automoc_rerun
+  CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+              "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
+  OUTPUT_VARIABLE output
+)
+if (NOT MOC_RERUN)
+  message(SEND_ERROR "Initial build of automoc_rerun failed. Output: ${output}")
+endif()
+
+configure_file(automoc_rerun/test1.h.in2 automoc_rerun/test1.h COPYONLY)
+
+execute_process(COMMAND "${CMAKE_COMMAND}" --build .
+  WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun"
+  RESULT_VARIABLE automoc_rerun_result
+  )
+if (automoc_rerun_result)
+  message(SEND_ERROR "Second build of automoc_rerun failed.")
+endif()
diff --git a/Tests/QtAutogen/automoc_rerun/CMakeLists.txt b/Tests/QtAutogen/automoc_rerun/CMakeLists.txt
new file mode 100644
index 0000000..17bc332
--- /dev/null
+++ b/Tests/QtAutogen/automoc_rerun/CMakeLists.txt
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 3.1)
+project(automoc_rerun CXX)
+
+if (QT_TEST_VERSION STREQUAL 4)
+  find_package(Qt4 REQUIRED)
+  set(QT_CORE_TARGET Qt4::QtCore)
+else()
+  if (NOT QT_TEST_VERSION STREQUAL 5)
+    message(SEND_ERROR "Invalid Qt version specified.")
+  endif()
+
+  find_package(Qt5Core REQUIRED)
+  set(QT_CORE_TARGET Qt5::Core)
+endif()
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+
+configure_file(test1.h.in1 test1.h COPYONLY)
+
+add_executable(test1
+  ${CMAKE_CURRENT_BINARY_DIR}/test1.h
+  test1.cpp
+  res1.qrc
+  )
+target_include_directories(test1 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries(test1 ${QT_CORE_TARGET})
diff --git a/Tests/QtAutogen/automoc_rerun/input.txt b/Tests/QtAutogen/automoc_rerun/input.txt
new file mode 100644
index 0000000..da62762
--- /dev/null
+++ b/Tests/QtAutogen/automoc_rerun/input.txt
@@ -0,0 +1 @@
+Res1 input.
diff --git a/Tests/QtAutogen/automoc_rerun/res1.qrc b/Tests/QtAutogen/automoc_rerun/res1.qrc
new file mode 100644
index 0000000..fb804b5
--- /dev/null
+++ b/Tests/QtAutogen/automoc_rerun/res1.qrc
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>input.txt</file>
+    </qresource>
+</RCC>
diff --git a/Tests/QtAutogen/automoc_rerun/test1.cpp b/Tests/QtAutogen/automoc_rerun/test1.cpp
new file mode 100644
index 0000000..4316a91
--- /dev/null
+++ b/Tests/QtAutogen/automoc_rerun/test1.cpp
@@ -0,0 +1,5 @@
+#include "test1.h"
+int main()
+{
+  return 0;
+}
diff --git a/Tests/QtAutogen/automoc_rerun/test1.h.in1 b/Tests/QtAutogen/automoc_rerun/test1.h.in1
new file mode 100644
index 0000000..fee2c09
--- /dev/null
+++ b/Tests/QtAutogen/automoc_rerun/test1.h.in1
@@ -0,0 +1,8 @@
+#include <QObject>
+class test1 : public QObject
+{
+  Q_OBJECT
+ public slots:
+   void onTst1() {}
+   void onTst2() {}
+};
diff --git a/Tests/QtAutogen/automoc_rerun/test1.h.in2 b/Tests/QtAutogen/automoc_rerun/test1.h.in2
new file mode 100644
index 0000000..6531d10
--- /dev/null
+++ b/Tests/QtAutogen/automoc_rerun/test1.h.in2
@@ -0,0 +1,7 @@
+#include <QObject>
+class test1 : public QObject
+{
+  Q_OBJECT
+ public slots:
+   void onTst1() {}
+};

-----------------------------------------------------------------------

Summary of changes:
 Source/cmQtAutoGenerators.cxx                      |   34 ++------------------
 Tests/QtAutogen/CMakeLists.txt                     |   23 +++++++++++++
 Tests/QtAutogen/automoc_rerun/CMakeLists.txt       |   27 ++++++++++++++++
 .../res1/input.txt.in => automoc_rerun/input.txt}  |    0
 .../res1.qrc.in => automoc_rerun/res1.qrc}         |    2 +-
 .../automoc_rerun/test1.cpp}                       |    2 +-
 Tests/QtAutogen/automoc_rerun/test1.h.in1          |    8 +++++
 Tests/QtAutogen/automoc_rerun/test1.h.in2          |    7 ++++
 8 files changed, 70 insertions(+), 33 deletions(-)
 create mode 100644 Tests/QtAutogen/automoc_rerun/CMakeLists.txt
 copy Tests/QtAutogen/{autorcc_depends/res1/input.txt.in => automoc_rerun/input.txt} (100%)
 copy Tests/QtAutogen/{autorcc_depends/res1.qrc.in => automoc_rerun/res1.qrc} (61%)
 copy Tests/{CTestTestDepends/simple.cxx => QtAutogen/automoc_rerun/test1.cpp} (58%)
 create mode 100644 Tests/QtAutogen/automoc_rerun/test1.h.in1
 create mode 100644 Tests/QtAutogen/automoc_rerun/test1.h.in2


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list