From f69606d3354701c2e4ef4ed0718802e1fa6b7fd5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 17 Sep 2013 19:11:39 +0200 Subject: Qt4Macros: Port to use message(DEPRECATION) --- Modules/Qt4Macros.cmake | 20 ++------------------ .../ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt | 2 +- .../ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index f1aedd7..74bad89 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -355,15 +355,7 @@ 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() + message(DEPRECATION "The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.") endif() QT4_GET_MOC_FLAGS(_moc_INCS) @@ -476,15 +468,7 @@ 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() + message(DEPRECATION "The qt4_use_modules function is obsolete. Use target_link_libraries with IMPORTED targets instead.") endif() if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE") set(modules ${ARGN}) diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt index 6f7e8ee..f358cc4 100644 --- a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt +++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning at .*/Modules/Qt4Macros.cmake:[^ ]+ \(message\): +CMake Deprecation Warning at .*/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:7 \(qt4_automoc\) diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt index b90c665..c69af65 100644 --- a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt +++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning at .*/Modules/Qt4Macros.cmake:[^ ]+ \(message\): +CMake Deprecation Warning at .*/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\): -- cgit v0.12