[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7344-g049b6cb

Stephen Kelly steveire at gmail.com
Wed Jan 29 12:13:36 EST 2014


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  049b6cb29a064eb49354811978be4c4342108630 (commit)
       via  1fc9ecfae63447f9109475c1b1ffb6a2974458d9 (commit)
      from  df4927f4ec6a1cca3830311eebb312b01354dbbe (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=049b6cb29a064eb49354811978be4c4342108630
commit 049b6cb29a064eb49354811978be4c4342108630
Merge: df4927f 1fc9ecf
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jan 29 12:13:35 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 29 12:13:35 2014 -0500

    Merge topic 'fix-Qt-autogen' into next
    
    1fc9ecfa FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fc9ecfae63447f9109475c1b1ffb6a2974458d9
commit 1fc9ecfae63447f9109475c1b1ffb6a2974458d9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jan 29 16:57:09 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jan 29 17:02:43 2014 +0100

    FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
    
    Commit 321e348e (QtAutogen: Use Qt 4 IMPORTED targets to find
    executable locations., 2014-01-24) attempted to fix this problem,
    but only solved it for a particular ordering of find_package for
    Qt 4 and Qt 5.
    
    Add a test to ensure that it works with both orderings.

diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 2d2feae..80ba798 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -589,6 +589,14 @@ _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)
 
 if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
+  if (Qt5Core_FOUND)
+    # Qt5CoreConfig sets QT_MOC_EXECUTABLE as a non-cache variable to the Qt 5
+    # path to moc.  Unset that variable when Qt 4 and 5 are used together, so
+    # that when find_program looks for moc, it is not set to the Qt 5 version.
+    # If FindQt4 has already put the Qt 4 path in the cache, the unset()
+    # command 'unhides' the (correct) cache variable.
+    unset(QT_MOC_EXECUTABLE)
+  endif()
   if (QT_QMAKE_EXECUTABLE_LAST)
     string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
   endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a79111a..60dc688 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1168,6 +1168,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         --test-command ${CMAKE_CTEST_COMMAND} -V
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc")
+      add_test(Qt4And5AutomocReverse ${CMAKE_CTEST_COMMAND}
+        --build-and-test
+        "${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc"
+        "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse"
+        ${build_generator_args}
+        --build-project Qt4And5Automoc
+        --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse"
+        --force-new-ctest-process
+        --build-options ${build_options} -DQT_REVERSE_FIND_ORDER=1
+        --test-command ${CMAKE_CTEST_COMMAND} -V
+        )
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse")
     endif()
   endif()
 
diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt
index 61d5743..ad74961 100644
--- a/Tests/Qt4And5Automoc/CMakeLists.txt
+++ b/Tests/Qt4And5Automoc/CMakeLists.txt
@@ -2,8 +2,13 @@ cmake_minimum_required(VERSION 2.8.12)
 
 project(Qt4And5Automoc)
 
-find_package(Qt4 REQUIRED)
-find_package(Qt5Core REQUIRED)
+if (QT_REVERSE_FIND_ORDER)
+  find_package(Qt5Core REQUIRED)
+  find_package(Qt4 REQUIRED)
+else()
+  find_package(Qt4 REQUIRED)
+  find_package(Qt5Core REQUIRED)
+endif()
 
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)

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

Summary of changes:
 Modules/FindQt4.cmake               |    8 ++++++++
 Tests/CMakeLists.txt                |   12 ++++++++++++
 Tests/Qt4And5Automoc/CMakeLists.txt |    9 +++++++--
 3 files changed, 27 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list