Add deprecation warnings for policies CMP0097 and below

The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.16 and below to encourage projects to port
away from setting policies to OLD.
This commit is contained in:
Brad King
2022-02-03 10:36:37 -05:00
parent 40107d308f
commit a9ffded98c
5 changed files with 41 additions and 5 deletions

View File

@@ -444,7 +444,9 @@ if(do_git_tests)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
set(proj TS1-GIT-all-GIT_SUBMODULES-via-CMP0097-OLD)
set(CMAKE_WARN_DEPRECATED FALSE) # we are testing CMP0097 OLD behavior
cmake_policy(SET CMP0097 OLD)
unset(CMAKE_WARN_DEPRECATED)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
GIT_SUBMODULES ""