[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3038-ge536f33

Stephen Kelly steveire at gmail.com
Thu Jul 11 04:27:53 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  e536f33176a1f5640138e0b500964cc532208f05 (commit)
       via  5c2e01072efb9cb6d92ed4bcb9172827f69a8d39 (commit)
       via  c64326bc0b2df30060a475e147c136ae5e7234ae (commit)
      from  a4b8fa40077a62edbc2f3c95073a66c1c92aa84e (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=e536f33176a1f5640138e0b500964cc532208f05
commit e536f33176a1f5640138e0b500964cc532208f05
Merge: a4b8fa4 5c2e010
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 11 04:27:47 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 11 04:27:47 2013 -0400

    Merge topic 'obsolete-qt4-macros' into next
    
    5c2e010 Mark qt4_use_modules and qt4_automoc as obsolete.
    c64326b Document some variables for deprecation control.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c2e01072efb9cb6d92ed4bcb9172827f69a8d39
commit 5c2e01072efb9cb6d92ed4bcb9172827f69a8d39
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 4 10:00:27 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jul 11 10:25:30 2013 +0200

    Mark qt4_use_modules and qt4_automoc as obsolete.

diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 8ce1934..7b37e1e 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -100,6 +100,7 @@
 #        because you need a custom filename for the moc file or something similar.
 #
 #  macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
+#        The qt4_automoc macro is obsolete.  Use the CMAKE_AUTOMOC feature instead.
 #        This macro is still experimental.
 #        It can be used to have moc automatically handled.
 #        So if you have the files foo.h and foo.cpp, and in foo.h a
@@ -174,6 +175,7 @@
 #        must exist and are not updated in any way.
 #
 # function QT4_USE_MODULES( target [link_type] modules...)
+#        This function is obsolete. Use target_link_libraries with IMPORTED targets instead.
 #        Make <target> use the <modules> from Qt. Using a Qt module means
 #        to link to the library, add the relevant include directories for the module,
 #        and add the relevant compiler defines for using the module.
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index a0b2e31..5e13b59 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -357,6 +357,17 @@ endmacro()
 
 
 macro(QT4_AUTOMOC)
+  if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
+    if(CMAKE_WARN_DEPRECATED)
+      set(messageType WARNING)
+    endif()
+    if(CMAKE_ERROR_DEPRECATED)
+      set(messageType FATAL_ERROR)
+    endif()
+    if(messageType)
+      message(${messageType} "The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.")
+    endif()
+  endif()
   QT4_GET_MOC_FLAGS(_moc_INCS)
 
   set(_matching_FILES )
@@ -467,6 +478,17 @@ macro(QT4_ADD_TRANSLATION _qm_files)
 endmacro()
 
 function(qt4_use_modules _target _link_type)
+  if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
+    if(CMAKE_WARN_DEPRECATED)
+      set(messageType WARNING)
+    endif()
+    if(CMAKE_ERROR_DEPRECATED)
+      set(messageType FATAL_ERROR)
+    endif()
+    if(messageType)
+      message(${messageType} "The qt4_use_modules function is obsolete. Use target_link_libraries with IMPORTED targets instead.")
+    endif()
+  endif()
   if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE")
     set(modules ${ARGN})
     set(link_type ${_link_type})
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c1a08d2..d3fad8f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -101,6 +101,9 @@ find_package(Qt5Core QUIET)
 if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
   add_RunCMake_test(IncompatibleQt)
 endif()
+if (QT4_FOUND)
+  add_RunCMake_test(ObsoleteQtMacros)
+endif()
 
 if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
   add_RunCMake_test(include_external_msproject)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-result.txt b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt
new file mode 100644
index 0000000..5946cac
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning at /home/stephen/dev/src/cmake/Modules/Qt4Macros.cmake:[^ ]+ \(message\):
+  The qt4_automoc macro is obsolete.  Use the CMAKE_AUTOMOC feature instead.
+Call Stack \(most recent call first\):
+  AutomocMacro-WARN.cmake:9 \(qt4_automoc\)
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake
new file mode 100644
index 0000000..6f6f3ca
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake
@@ -0,0 +1,9 @@
+
+cmake_minimum_required(VERSION 2.8.11)
+
+find_package(Qt4 REQUIRED)
+
+set(CMAKE_WARN_DEPRECATED 1)
+
+add_library(foo SHARED empty.cpp)
+qt4_automoc(foo_moc_srcs empty.cpp)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt
new file mode 100644
index 0000000..68dd8d6
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake b/Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake
new file mode 100644
index 0000000..fc16a81
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(UseModulesMacro-WARN)
+run_cmake(AutomocMacro-WARN)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-result.txt b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt
new file mode 100644
index 0000000..7dff1f1
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt
@@ -0,0 +1,6 @@
+CMake Warning at /home/stephen/dev/src/cmake/Modules/Qt4Macros.cmake:[^ ]+ \(message\):
+  The qt4_use_modules function is obsolete.  Use target_link_libraries with
+  IMPORTED targets instead.
+Call Stack \(most recent call first\):
+  UseModulesMacro-WARN.cmake:9 \(qt4_use_modules\)
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake
new file mode 100644
index 0000000..4c18aa3
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake
@@ -0,0 +1,9 @@
+
+cmake_minimum_required(VERSION 2.8.11)
+
+find_package(Qt4 REQUIRED)
+
+set(CMAKE_WARN_DEPRECATED 1)
+
+add_library(foo SHARED empty.cpp)
+qt4_use_modules(foo LINK_PRIVATE Core)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/empty.cpp b/Tests/RunCMake/ObsoleteQtMacros/empty.cpp
new file mode 100644
index 0000000..7279c5e
--- /dev/null
+++ b/Tests/RunCMake/ObsoleteQtMacros/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty(void)
+{
+  return 0;
+}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c64326bc0b2df30060a475e147c136ae5e7234ae
commit c64326bc0b2df30060a475e147c136ae5e7234ae
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 11 10:25:06 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jul 11 10:25:30 2013 +0200

    Document some variables for deprecation control.

diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 0a78ccf..0f89084 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -514,6 +514,13 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "analysis of libraries linked by a target.",
      false,
      "Variables that Provide Information");
+  cm->DefineProperty
+    ("CMAKE_MINIMUM_REQUIRED_VERSION", cmProperty::VARIABLE,
+     "Version specified to cmake_minimum_required command",
+     "Variable containing the VERSION component specified in the "
+     "cmake_minimum_required command.",
+     false,
+     "Variables that Provide Information");
 
 
   // Variables defined by cmake, that change the behavior
@@ -688,6 +695,23 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "Variables That Change Behavior");
 
   cm->DefineProperty
+    ("CMAKE_WARN_DEPRECATED", cmProperty::VARIABLE,
+     "Whether to issue deprecation warnings for macros and functions.",
+     "If TRUE, this can be used by macros and functions to issue "
+     "deprecation warnings.  This variable is FALSE by default.",
+     false,
+     "Variables That Change Behavior");
+
+  cm->DefineProperty
+    ("CMAKE_ERROR_DEPRECATED", cmProperty::VARIABLE,
+     "Whether to issue deprecation errors for macros and functions.",
+     "If TRUE, this can be used by macros and functions to issue "
+     "fatal errors when deprecated macros or functions are used.  This "
+     "variable is FALSE by default.",
+     false,
+     "Variables That Change Behavior");
+
+  cm->DefineProperty
     ("CMAKE_PREFIX_PATH", cmProperty::VARIABLE,
      "Path used for searching by FIND_XXX(), with appropriate suffixes added.",
      "Specifies a path which will be used by the FIND_XXX() commands. It "

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

Summary of changes:
 Modules/FindQt4.cmake                              |    2 +
 Modules/Qt4Macros.cmake                            |   22 ++++++++++++++++++
 Source/cmDocumentVariables.cxx                     |   24 ++++++++++++++++++++
 Tests/RunCMake/CMakeLists.txt                      |    3 ++
 .../AutomocMacro-WARN-result.txt}                  |    0
 .../ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt  |    5 ++++
 .../ObsoleteQtMacros/AutomocMacro-WARN.cmake       |    9 +++++++
 .../CMakeLists.txt                                 |    0
 Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake |    4 +++
 .../UseModulesMacro-WARN-result.txt}               |    0
 .../UseModulesMacro-WARN-stderr.txt                |    6 +++++
 .../ObsoleteQtMacros/UseModulesMacro-WARN.cmake    |    9 +++++++
 .../ObsoleteQtMacros}/empty.cpp                    |    0
 13 files changed, 84 insertions(+), 0 deletions(-)
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-static-result.txt => ObsoleteQtMacros/AutomocMacro-WARN-result.txt} (100%)
 create mode 100644 Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake
 copy Tests/RunCMake/{CompatibleInterface => ObsoleteQtMacros}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-static-result.txt => ObsoleteQtMacros/UseModulesMacro-WARN-result.txt} (100%)
 create mode 100644 Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake
 copy Tests/{IncludeDirectories/TargetIncludeDirectories => RunCMake/ObsoleteQtMacros}/empty.cpp (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list