From fb95f820e06eb1933a7d3b71bc46eed4d5d25ee6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Jul 2014 09:31:56 -0400 Subject: [PATCH] Tests: Set policies in 'complex' tests These tests cover the OLD behavior of some policies. Set them to OLD to avoid warnings in the test output. Leave a comment that explains why this is done here but not recommended in general. --- Tests/Complex/CMakeLists.txt | 15 +++++++++++++++ Tests/ComplexOneConfig/CMakeLists.txt | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 222250c7f..5e5eead80 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -14,6 +14,21 @@ if(POLICY CMP0003) endif() endif() +# It is not recommended to set a policy to OLD, but this test +# covers the OLD behavior of some policies. +foreach(p + CMP0029 + CMP0032 + CMP0033 + CMP0034 + CMP0043 + CMP0050 + ) + if(POLICY ${p}) + cmake_policy(SET ${p} OLD) + endif() +endforeach() + # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 3f17dcc3b..3b73e709a 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -14,6 +14,21 @@ if(POLICY CMP0003) endif() endif() +# It is not recommended to set a policy to OLD, but this test +# covers the OLD behavior of some policies. +foreach(p + CMP0029 + CMP0032 + CMP0033 + CMP0034 + CMP0043 + CMP0050 + ) + if(POLICY ${p}) + cmake_policy(SET ${p} OLD) + endif() +endforeach() + # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)