From 73721c7ce0dc8fc9ee07fe70746aa44284390d89 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Apr 2014 11:03:41 -0400 Subject: [PATCH] CMakeDetermineVSServicePack: Add deprecation diagnostic Warn project developers at runtime that the module should not be used anymore. Issue the diagnostic only when the project requires a new enough CMake to use the alternative. Honor the CMAKE_(ERROR|WARN)_DEPRECATED settings. --- Help/release/dev/CMakeDetermineVSServicePack.rst | 6 ++++++ Modules/CMakeDetermineVSServicePack.cmake | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 Help/release/dev/CMakeDetermineVSServicePack.rst diff --git a/Help/release/dev/CMakeDetermineVSServicePack.rst b/Help/release/dev/CMakeDetermineVSServicePack.rst new file mode 100644 index 000000000..d9d7b415c --- /dev/null +++ b/Help/release/dev/CMakeDetermineVSServicePack.rst @@ -0,0 +1,6 @@ +CMakeDetermineVSServicePack +--------------------------- + +* The :module:`CMakeDetermineVSServicePack` module now warns that + it is deprecated and should not longer be used. Use the + :variable:`CMAKE__COMPILER_VERSION` variable instead. diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake index 285438781..688608479 100644 --- a/Modules/CMakeDetermineVSServicePack.cmake +++ b/Modules/CMakeDetermineVSServicePack.cmake @@ -43,6 +43,13 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8) + message(DEPRECATION + "This module is deprecated and should not be used. " + "Use the CMAKE__COMPILER_VERSION variable instead." + ) +endif() + # [INTERNAL] # Please do not call this function directly function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)