[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2537-gaee813f

Stephen Kelly steveire at gmail.com
Sat Mar 16 13:59:11 EDT 2013


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  aee813fa79ed9e287ab7ec4b74fbb4097428442c (commit)
       via  6489015c75367493c9ea6a7bea69b67a88972651 (commit)
       via  e7813b15a63a4ff5150d22b01ef47b51b22045e5 (commit)
       via  27fb96b9783ba13ce4c8bd681b73c6f3a892d90c (commit)
      from  2e14151262193b285e7294adc9f390ca78a571ed (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=aee813fa79ed9e287ab7ec4b74fbb4097428442c
commit aee813fa79ed9e287ab7ec4b74fbb4097428442c
Merge: 2e14151 6489015
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 16 13:59:10 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Mar 16 13:59:10 2013 -0400

    Merge topic 'Automoc-Qt4-Qt5' into next
    
    6489015 Remove an endif() followed by an if() for the same condition.
    e7813b1 Add a test for Qt5Automoc
    27fb96b Make the QtAutomoc test compile with either Qt 4 or Qt 5


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6489015c75367493c9ea6a7bea69b67a88972651
commit 6489015c75367493c9ea6a7bea69b67a88972651
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 16 18:57:38 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Mar 16 18:57:38 2013 +0100

    Remove an endif() followed by an if() for the same condition.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index c548869..6789db7 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1031,8 +1031,7 @@ ${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/Qt4Automoc")
-  endif()
-  if(QT4_WORKS AND QT_QTGUI_FOUND)
+
     add_test(Qt4Targets ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Qt4Targets"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7813b15a63a4ff5150d22b01ef47b51b22045e5
commit e7813b15a63a4ff5150d22b01ef47b51b22045e5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 16 15:52:18 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Mar 16 18:57:01 2013 +0100

    Add a test for Qt5Automoc
    
    The same source is used as for the Qt4Automoc test.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e07bb69..c548869 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1003,19 +1003,34 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
 
+  find_package(Qt5Widgets QUIET NO_MODULE)
+  if(Qt5Widgets_FOUND)
+    add_test(Qt5Automoc ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/QtAutomoc"
+      "${CMake_BINARY_DIR}/Tests/Qt5Automoc"
+      ${build_generator_args}
+      --build-project QtAutomoc
+      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Automoc"
+      --force-new-ctest-process
+      --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
+      --test-command ${CMAKE_CTEST_COMMAND} -V
+      )
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Automoc")
+  endif()
   if(QT4_WORKS AND QT_QTGUI_FOUND)
-    add_test(QtAutomoc ${CMAKE_CTEST_COMMAND}
+    add_test(Qt4Automoc ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/QtAutomoc"
-      "${CMake_BINARY_DIR}/Tests/QtAutomoc"
+      "${CMake_BINARY_DIR}/Tests/Qt4Automoc"
       ${build_generator_args}
       --build-project QtAutomoc
-      --build-exe-dir "${CMake_BINARY_DIR}/Tests/QtAutomoc"
+      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Automoc"
       --force-new-ctest-process
-      --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+      --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
       --test-command ${CMAKE_CTEST_COMMAND} -V
       )
-    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Automoc")
   endif()
   if(QT4_WORKS AND QT_QTGUI_FOUND)
     add_test(Qt4Targets ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/QtAutomoc/Adir/CMakeLists.txt b/Tests/QtAutomoc/Adir/CMakeLists.txt
index abd328e..ebfdb5d 100644
--- a/Tests/QtAutomoc/Adir/CMakeLists.txt
+++ b/Tests/QtAutomoc/Adir/CMakeLists.txt
@@ -4,5 +4,5 @@ set(CMAKE_AUTOMOC ON)
 set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
 
 add_library(libA SHARED libA.cpp)
-target_link_libraries(libA LINK_PUBLIC Qt4::QtCore)
+target_link_libraries(libA LINK_PUBLIC ${QT_QTCORE_TARGET})
 generate_export_header(libA)
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index ebfbb03..49d433f 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -2,9 +2,28 @@ cmake_minimum_required(VERSION 2.8)
 
 project(QtAutomoc)
 
-find_package(Qt4 REQUIRED)
+if (QT_TEST_VERSION STREQUAL 4)
+  find_package(Qt4 REQUIRED)
+
+  include(UseQt4)
+
+  set(QT_QTCORE_TARGET Qt4::QtCore)
+else()
+  if (NOT QT_TEST_VERSION STREQUAL 5)
+    message(SEND_ERROR "Invalid Qt version specified.")
+  endif()
+  find_package(Qt5Widgets REQUIRED)
+
+  set(QT_QTCORE_TARGET Qt5::Core)
+
+  include_directories(${Qt5Widgets_INCLUDE_DIRS})
+  set(QT_LIBRARIES Qt5::Widgets)
+
+  if(Qt5_POSITION_INDEPENDENT_CODE)
+    set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+  endif()
+endif()
 
-include(UseQt4)
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27fb96b9783ba13ce4c8bd681b73c6f3a892d90c
commit 27fb96b9783ba13ce4c8bd681b73c6f3a892d90c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 16 15:51:29 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Mar 16 18:55:22 2013 +0100

    Make the QtAutomoc test compile with either Qt 4 or Qt 5

diff --git a/Tests/QtAutomoc/calwidget.cpp b/Tests/QtAutomoc/calwidget.cpp
index 24f3b4e..cbfa5a8 100644
--- a/Tests/QtAutomoc/calwidget.cpp
+++ b/Tests/QtAutomoc/calwidget.cpp
@@ -38,7 +38,14 @@
  **
  ****************************************************************************/
 
- #include <QtGui>
+ #include <QComboBox>
+ #include <QGridLayout>
+ #include <QLabel>
+ #include <QGroupBox>
+ #include <QCheckBox>
+ #include <QDateEdit>
+ #include <QCalendarWidget>
+ #include <QTextCharFormat>
 
  #include "calwidget.h"
 
@@ -414,10 +421,10 @@
 QComboBox *Window::createColorComboBox()
  {
      QComboBox *comboBox = new QComboBox;
-     comboBox->addItem(tr("Red"), Qt::red);
-     comboBox->addItem(tr("Blue"), Qt::blue);
-     comboBox->addItem(tr("Black"), Qt::black);
-     comboBox->addItem(tr("Magenta"), Qt::magenta);
+     comboBox->addItem(tr("Red"), QColor(Qt::red));
+     comboBox->addItem(tr("Blue"), QColor(Qt::blue));
+     comboBox->addItem(tr("Black"), QColor(Qt::black));
+     comboBox->addItem(tr("Magenta"), QColor(Qt::magenta));
      return comboBox;
  }
 
diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp
index d952171..bd80180 100644
--- a/Tests/QtAutomoc/main.cpp
+++ b/Tests/QtAutomoc/main.cpp
@@ -38,7 +38,7 @@
  **
  ****************************************************************************/
 
-#include <QtGui>
+#include <QApplication>
 
 #include "codeeditor.h"
 #include "calwidget.h"

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

Summary of changes:
 Tests/CMakeLists.txt                |   26 ++++++++++++++++++++------
 Tests/QtAutomoc/Adir/CMakeLists.txt |    2 +-
 Tests/QtAutomoc/CMakeLists.txt      |   23 +++++++++++++++++++++--
 Tests/QtAutomoc/calwidget.cpp       |   17 ++++++++++++-----
 Tests/QtAutomoc/main.cpp            |    2 +-
 5 files changed, 55 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list