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.
This commit is contained in:
Brad King 2014-04-10 11:03:41 -04:00
parent a6fee73dac
commit 73721c7ce0
2 changed files with 13 additions and 0 deletions

View File

@ -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_<LANG>_COMPILER_VERSION` variable instead.

View File

@ -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_<LANG>_COMPILER_VERSION variable instead."
)
endif()
# [INTERNAL]
# Please do not call this function directly
function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)