[Cmake-commits] CMake branch, next, updated. v3.3.0-rc1-430-gb39c01d

Stephen Kelly steveire at gmail.com
Wed Jun 10 17:54:53 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  b39c01dbb626bbbf2ce145311824997ad8965b33 (commit)
       via  00055af64dfbb8d6d797cc31d11a8152f2101eca (commit)
       via  3a379e4c0669f66563f30a507ecdcac72fe44859 (commit)
       via  daf3f0f7090a38bf0655cc858908de801649beb4 (commit)
       via  7b20344c1532898e021ae4afb44b0ac7e9fe0932 (commit)
       via  db60a9cc008402fe3243e470131f80017b946f3a (commit)
      from  83ef27fdf1bb1c23a1bf57d27cc4dad3f1f4a729 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b39c01dbb626bbbf2ce145311824997ad8965b33
commit b39c01dbb626bbbf2ce145311824997ad8965b33
Merge: 83ef27f 00055af
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jun 10 17:54:52 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jun 10 17:54:52 2015 -0400

    Merge topic 'fail-on-ancient-policies' into next
    
    00055af6 cmPolicies: Unconditionally use NEW behavior for ancient policies.
    3a379e4c Tests: Update the complex test for ancient policies.
    daf3f0f7 Tests: Update the minimum required cmake version.
    7b20344c Tests: Fix for NEW behavior of CMake.
    db60a9cc Tests: Implement PolicyScope tests in terms of newer policies.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00055af64dfbb8d6d797cc31d11a8152f2101eca
commit 00055af64dfbb8d6d797cc31d11a8152f2101eca
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 9 22:50:18 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jun 10 23:53:20 2015 +0200

    cmPolicies: Unconditionally use NEW behavior for ancient policies.

diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 5026893..e5f8d0b 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -53,6 +53,10 @@ static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
 #define CM_FOR_EACH_POLICY_ID_DOC(POLICY) \
   CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID_DOC)
 
+#define CM_SELECT_ID_STATUS(F, A1, A2, A3, A4, A5, A6) F(A1, A6)
+#define CM_FOR_EACH_POLICY_ID_STATUS(POLICY) \
+  CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID_STATUS)
+
 static const char* idToString(cmPolicies::PolicyID id)
 {
   switch(id)
@@ -319,8 +323,18 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
 
 ///! Get the default status for a policy
 cmPolicies::PolicyStatus
-cmPolicies::GetPolicyStatus(cmPolicies::PolicyID)
+cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id)
 {
+  switch(id)
+    {
+#define POLICY_CASE(ID, STATUS) \
+    case cmPolicies::ID: \
+      return STATUS;
+  CM_FOR_EACH_POLICY_ID_STATUS(POLICY_CASE)
+#undef POLICY_CASE
+    case cmPolicies::CMPCOUNT:
+      return cmPolicies::WARN;
+    }
   return cmPolicies::WARN;
 }
 
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8a3c27d..85f3612 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -22,40 +22,40 @@ class cmPolicy;
 #define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT) \
   SELECT(POLICY, CMP0000, \
     "A minimum required CMake version must be specified.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0001, \
     "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0002, \
   "Logical target names must be globally unique.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0003, \
     "Libraries linked via full path no longer produce linker search paths.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0004, \
     "Libraries linked may not have leading or trailing whitespace.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0005, \
     "Preprocessor definition values are now escaped automatically.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0006, \
     "Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0007, \
     "list command no longer ignores empty elements.", \
-    2, 6, 0, cmPolicies::WARN) \
+    2, 6, 0, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0008, \
     "Libraries linked by full-path must have a valid library file name.", \
-    2, 6, 1, cmPolicies::WARN) \
+    2, 6, 1, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0009, \
     "FILE GLOB_RECURSE calls should not follow symlinks by default.", \
-    2, 6, 2, cmPolicies::WARN) \
+    2, 6, 2, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0010, \
     "Bad variable reference syntax is an error.", \
-    2, 6, 3, cmPolicies::WARN) \
+    2, 6, 3, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0011, \
     "Included scripts do automatic cmake_policy PUSH and POP.", \
-    2, 6, 3, cmPolicies::WARN) \
+    2, 6, 3, cmPolicies::REQUIRED_IF_USED) \
   SELECT(POLICY, CMP0012, \
     "if() recognizes numbers and boolean constants.", \
     2, 8, 0, cmPolicies::WARN) \
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index 77c34a9..99fc4d3 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -158,8 +158,6 @@ foreach(cmd Remove_Item Reverse Remove_Duplicates Sort Remove_At)
   set(${cmd}-Nonexistent-List-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-${cmd}-Nonexistent-List.cmake:2 \\(list\\):.*sub-command ${Cmd} requires list to be present.*")
 endforeach()
 
-set(Get-CMP0007-Warn-RESULT 0)
-set(Get-CMP0007-Warn-STDERR ".*CMake Warning \\(dev\\) at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Get-CMP0007-Warn.cmake:3 \\(list\\):.*Policy CMP0007 is not set:.*")
 
 check_cmake_test(List
   No-Arguments
@@ -176,15 +174,4 @@ check_cmake_test(List
   Sort-Nonexistent-List
   Remove_At-Nonexistent-List
   Remove_At-Invalid-Index
-  Get-CMP0007-Warn
 )
-
-set(thelist "" NEW OLD)
-
-foreach (_pol ${thelist})
-    cmake_policy(SET CMP0007 ${_pol})
-    list(GET thelist 1 thevalue)
-    if (NOT thevalue STREQUAL _pol)
-        message(SEND_ERROR "returned element '${thevalue}', but expected '${_pol}'")
-    endif()
-endforeach (_pol)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index c431280..c874271 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -64,7 +64,6 @@ run_cmake(UnterminatedCall1)
 run_cmake(UnterminatedCall2)
 run_cmake(UnterminatedString)
 run_cmake(UnterminatedBrace0)
-run_cmake(UnterminatedBrace1)
 run_cmake(UnterminatedBrace2)
 run_cmake(UnterminatedBracket0)
 run_cmake(UnterminatedBracket1)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
deleted file mode 100644
index 4e3c2b5..0000000
--- a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-CMake Warning \(dev\) at UnterminatedBrace1.cmake:3 \(set\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:3
-
-  when parsing string
-
-    \${
-
-  syntax error, unexpected \$end, expecting } \(2\)
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
deleted file mode 100644
index 93fba34..0000000
--- a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_minimum_required(VERSION 3.0)
-cmake_policy(SET CMP0010 OLD)
-set(var "${")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a379e4c0669f66563f30a507ecdcac72fe44859
commit 3a379e4c0669f66563f30a507ecdcac72fe44859
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jun 10 01:25:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jun 10 23:53:20 2015 +0200

    Tests: Update the complex test for ancient policies.

diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 5e5eead..1479a13 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -1,7 +1,7 @@
 #
 # A more complex test case
 #
-cmake_minimum_required(VERSION 2.4)
+cmake_minimum_required(VERSION 3.2)
 project (Complex)
 
 # Try setting a new policy.  The IF test is for coverage.
@@ -21,6 +21,7 @@ foreach(p
     CMP0032
     CMP0033
     CMP0034
+    CMP0035
     CMP0043
     CMP0050
     )
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index ec222a5..9dccd84 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -838,14 +838,6 @@ int main()
 #endif
 #endif // defined(_WIN32) && !defined(__CYGWIN__)
 
-  if(strcmp(CMAKE_MINIMUM_REQUIRED_VERSION, "2.4") == 0)
-    {
-    cmPassed("CMAKE_MINIMUM_REQUIRED_VERSION is set to 2.4");
-    }
-  else
-    {
-    cmFailed("CMAKE_MINIMUM_REQUIRED_VERSION is not set to the expected 2.4");
-    }
 
   // ----------------------------------------------------------------------
   // Test REMOVE command
diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake
index 4c8ec21..5758ba8 100644
--- a/Tests/Complex/Library/test_preprocess.cmake
+++ b/Tests/Complex/Library/test_preprocess.cmake
@@ -1,4 +1,4 @@
-set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
+set(TEST_FILE CMakeFiles/create_file.dir/create_file.cxx.i)
 file(READ ${TEST_FILE} CONTENTS)
 if("${CONTENTS}" MATCHES "Unable to close")
   message(STATUS "${TEST_FILE} created successfully!")
diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
index 4c8ec21..5758ba8 100644
--- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake
+++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
@@ -1,4 +1,4 @@
-set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
+set(TEST_FILE CMakeFiles/create_file.dir/create_file.cxx.i)
 file(READ ${TEST_FILE} CONTENTS)
 if("${CONTENTS}" MATCHES "Unable to close")
   message(STATUS "${TEST_FILE} created successfully!")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=daf3f0f7090a38bf0655cc858908de801649beb4
commit daf3f0f7090a38bf0655cc858908de801649beb4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jun 10 00:07:39 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jun 10 23:52:56 2015 +0200

    Tests: Update the minimum required cmake version.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 8865063..fabaa6c 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -347,9 +347,6 @@ if(BUILD_TESTING)
   ADD_TEST_MACRO(CrossCompile CrossCompile)
   set_tests_properties(CrossCompile PROPERTIES
     PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
-  if("${CMAKE_GENERATOR}" MATCHES "Make")
-    ADD_TEST_MACRO(Policy0002 Policy0002)
-  endif()
   if(CTEST_TEST_OSX_ARCH)
     ADD_TEST_MACRO(Architecture Architecture)
     set_tests_properties(Architecture PROPERTIES
diff --git a/Tests/EmptyProperty/CMakeLists.txt b/Tests/EmptyProperty/CMakeLists.txt
index 39e75f3..65aa216 100644
--- a/Tests/EmptyProperty/CMakeLists.txt
+++ b/Tests/EmptyProperty/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required (VERSION 3.3)
 project (EmptyProperty)
 
 set_property(DIRECTORY APPEND
diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt
index 458c88b..64620a5 100644
--- a/Tests/ExternalOBJ/CMakeLists.txt
+++ b/Tests/ExternalOBJ/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.3)
 project (ExternalOBJ)
 
 if(APPLE)
diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt
index 3ac125f..eedd9ec 100644
--- a/Tests/LibName/CMakeLists.txt
+++ b/Tests/LibName/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.3)
 project(LibName)
 # this is a test to make sure that relative path
 # LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH work
diff --git a/Tests/LinkLine/CMakeLists.txt b/Tests/LinkLine/CMakeLists.txt
index 6154dd4..d14c963 100644
--- a/Tests/LinkLine/CMakeLists.txt
+++ b/Tests/LinkLine/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required (VERSION 3.3)
 project( LinkLine )
 
 # Makes sure that the library order as specified by the user are
diff --git a/Tests/Policy0002/A/CMakeLists.txt b/Tests/Policy0002/A/CMakeLists.txt
deleted file mode 100644
index cee6422..0000000
--- a/Tests/Policy0002/A/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_executable(Policy0002 ../policy0002.c)
diff --git a/Tests/Policy0002/CMakeLists.txt b/Tests/Policy0002/CMakeLists.txt
deleted file mode 100644
index 0f6d331..0000000
--- a/Tests/Policy0002/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-project(Policy0002 C)
-cmake_policy(SET CMP0002 OLD)
-add_subdirectory(A)
-add_executable(Policy0002 policy0002.c)
diff --git a/Tests/Policy0002/policy0002.c b/Tests/Policy0002/policy0002.c
deleted file mode 100644
index 8488f4e..0000000
--- a/Tests/Policy0002/policy0002.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main(void)
-{
-  return 0;
-}
diff --git a/Tests/PreOrder/CMakeLists.txt b/Tests/PreOrder/CMakeLists.txt
index 8b4c439..a688c74 100644
--- a/Tests/PreOrder/CMakeLists.txt
+++ b/Tests/PreOrder/CMakeLists.txt
@@ -1,4 +1,5 @@
 # a simple test case
+cmake_minimum_required (VERSION 3.3)
 project (PreOrder)
 set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
 add_subdirectory(Library)
diff --git a/Tests/SBCS/CMakeLists.txt b/Tests/SBCS/CMakeLists.txt
index b3c3c2c..7a77711 100644
--- a/Tests/SBCS/CMakeLists.txt
+++ b/Tests/SBCS/CMakeLists.txt
@@ -1,4 +1,5 @@
 # a SBCS test case
+cmake_minimum_required (VERSION 3.3)
 project (SBCS)
 
 add_definitions(-D_SBCS)
diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt
index a951c2d..79ff071 100644
--- a/Tests/Simple/CMakeLists.txt
+++ b/Tests/Simple/CMakeLists.txt
@@ -1,4 +1,5 @@
 # a simple test case
+cmake_minimum_required (VERSION 3.3)
 project (Simple)
 
 add_executable (Simple simple.cxx)
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index faf3bc9..8caa2f0 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.3)
 project(StringFileTest)
 include_directories(${StringFileTest_BINARY_DIR})
 
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index 73ea05a..926caea 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.3)
 project(VSExternalInclude)
 
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
diff --git a/Tests/VSExternalInclude/Lib1/CMakeLists.txt b/Tests/VSExternalInclude/Lib1/CMakeLists.txt
index 9dfac86..0d08853 100644
--- a/Tests/VSExternalInclude/Lib1/CMakeLists.txt
+++ b/Tests/VSExternalInclude/Lib1/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required (VERSION 3.3)
 set(CMAKE_SUPPRESS_REGENERATION 1)
 project(LIB1)
 
diff --git a/Tests/VSExternalInclude/Lib2/CMakeLists.txt b/Tests/VSExternalInclude/Lib2/CMakeLists.txt
index f451354..017b8fe 100644
--- a/Tests/VSExternalInclude/Lib2/CMakeLists.txt
+++ b/Tests/VSExternalInclude/Lib2/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required (VERSION 3.3)
 set(CMAKE_SUPPRESS_REGENERATION 1)
 project(VSEXTERNAL_LIB2)
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b20344c1532898e021ae4afb44b0ac7e9fe0932
commit 7b20344c1532898e021ae4afb44b0ac7e9fe0932
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 9 23:14:25 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jun 10 23:52:56 2015 +0200

    Tests: Fix for NEW behavior of CMake.

diff --git a/Tests/CMakeTests/FileTestScript.cmake b/Tests/CMakeTests/FileTestScript.cmake
index 9a43569..a243aa6 100644
--- a/Tests/CMakeTests/FileTestScript.cmake
+++ b/Tests/CMakeTests/FileTestScript.cmake
@@ -73,7 +73,7 @@ elseif(testname STREQUAL glob_recurse_relative_no_expression) # fail
   file(GLOB_RECURSE v RELATIVE dddd)
 
 elseif(testname STREQUAL glob_non_full_path) # pass
-  file(GLOB_RECURSE v ffff*.*)
+  file(GLOB_RECURSE v FOLLOW_SYMLINKS ffff*.*)
   message("v='${v}'")
 
 elseif(testname STREQUAL make_directory_non_full_path) # pass
diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt
index 1cb8669..c676acc 100644
--- a/Tests/CPackComponents/CMakeLists.txt
+++ b/Tests/CPackComponents/CMakeLists.txt
@@ -79,7 +79,7 @@ set(CPACK_NSIS_MENU_LINKS
   )
 
 # Suggested default root for end users of the installer:
-set(CPACK_NSIS_INSTALL_ROOT "C:\\Program Files\\CMake Tests Install Root")
+set(CPACK_NSIS_INSTALL_ROOT "C:\\\\Program Files\\\\CMake Tests Install Root")
 
 # Include CPack to introduce the appropriate targets
 include(CPack)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db60a9cc008402fe3243e470131f80017b946f3a
commit db60a9cc008402fe3243e470131f80017b946f3a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jun 10 00:08:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jun 10 23:52:55 2015 +0200

    Tests: Implement PolicyScope tests in terms of newer policies.
    
    Keep the spirit of the tests.

diff --git a/Tests/PolicyScope/Bar.cmake b/Tests/PolicyScope/Bar.cmake
index cf1904c..2f94d8d 100644
--- a/Tests/PolicyScope/Bar.cmake
+++ b/Tests/PolicyScope/Bar.cmake
@@ -1,8 +1,5 @@
-cmake_minimum_required(VERSION 2.6.3)
+cmake_minimum_required(VERSION 3.2)
 
 # Make sure a policy set differently by our includer is now correct.
-cmake_policy(GET CMP0003 cmp)
-check(CMP0003 "NEW" "${cmp}")
-
-# Test allowing the top-level file to not have cmake_minimum_required.
-cmake_policy(SET CMP0000 OLD)
+cmake_policy(GET CMP0056 cmp)
+check(CMP0056 "NEW" "${cmp}")
diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt
index 413195a..b14c423 100644
--- a/Tests/PolicyScope/CMakeLists.txt
+++ b/Tests/PolicyScope/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.0)
 project(PolicyScope C)
 # No cmake_minimum_required(VERSION), it's in FindFoo.
 
@@ -12,33 +13,27 @@ endfunction()
 #-----------------------------------------------------------------------------
 # Test using a development framework that sets policies for us.
 
-# Policy CMP0011 should not be set at this point.
-cmake_policy(GET CMP0011 cmp)
-check(CMP0011 "" "${cmp}")
-
 # Put the test modules in the search path.
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
 
 # The included file should set policies for us.
-find_package(Foo)
+find_package(Foo NO_POLICY_SCOPE)
 
 # Check policies set by the package.
-cmake_policy(GET CMP0003 cmp)
-check(CMP0003 "OLD" "${cmp}")
-cmake_policy(GET CMP0002 cmp)
-check(CMP0002 "NEW" "${cmp}")
-cmake_policy(GET CMP0011 cmp)
-check(CMP0011 "NEW" "${cmp}")
+cmake_policy(GET CMP0056 cmp)
+check(CMP0056 "OLD" "${cmp}")
+cmake_policy(GET CMP0055 cmp)
+check(CMP0055 "NEW" "${cmp}")
 
 # Make sure an included file cannot change policies.
 include(Bar)
-cmake_policy(GET CMP0003 cmp)
-check(CMP0003 "OLD" "${cmp}")
+cmake_policy(GET CMP0056 cmp)
+check(CMP0056 "OLD" "${cmp}")
 
 # Allow the included file to change policies.
 include(Bar NO_POLICY_SCOPE)
-cmake_policy(GET CMP0003 cmp)
-check(CMP0003 "NEW" "${cmp}")
+cmake_policy(GET CMP0056 cmp)
+check(CMP0056 "NEW" "${cmp}")
 
 #-----------------------------------------------------------------------------
 # Test function and macro policy recording.
@@ -46,57 +41,56 @@ check(CMP0003 "NEW" "${cmp}")
 # Create the functions in an isolated scope in which we change policies.
 cmake_policy(PUSH)
 if(1)
-  # Change CMP0002
-  cmake_policy(SET CMP0002 OLD)
+  cmake_policy(SET CMP0055 OLD)
   function(func1)
-    # CMP0002 should be changed when this function is invoked
-    cmake_policy(GET CMP0002 cmp)
-    check(CMP0002 "OLD" "${cmp}")
+    # CMP0055 should be changed when this function is invoked
+    cmake_policy(GET CMP0055 cmp)
+    check(CMP0055 "OLD" "${cmp}")
   endfunction()
 
-  # Unset CMP0002
-  cmake_policy(VERSION 2.4)
+  # Unset CMP0055
+  cmake_policy(VERSION 3.1)
   macro(macro1)
-    # CMP0002 should be unset when this macro is invoked
-    cmake_policy(GET CMP0002 cmp)
-    check(CMP0002 "" "${cmp}")
+    # CMP0055 should be unset when this macro is invoked
+    cmake_policy(GET CMP0055 cmp)
+    check(CMP0055 "" "${cmp}")
 
     # Setting the policy should work here and also in the caller.
-    cmake_policy(SET CMP0002 OLD)
-    cmake_policy(GET CMP0002 cmp)
-    check(CMP0002 "OLD" "${cmp}")
+    cmake_policy(SET CMP0055 OLD)
+    cmake_policy(GET CMP0055 cmp)
+    check(CMP0055 "OLD" "${cmp}")
   endmacro()
 endif()
 cmake_policy(POP)
 
-# CMP0002 should still be NEW in this context.
-cmake_policy(GET CMP0002 cmp)
-check(CMP0002 "NEW" "${cmp}")
+# CMP0055 should still be NEW in this context.
+cmake_policy(GET CMP0055 cmp)
+check(CMP0055 "NEW" "${cmp}")
 
 # Check the recorded policies
 func1()
 macro1()
 
-# The macro should have changed CMP0002.
-cmake_policy(GET CMP0002 cmp)
-check(CMP0002 "OLD" "${cmp}")
+# The macro should have changed CMP0055.
+cmake_policy(GET CMP0055 cmp)
+check(CMP0055 "OLD" "${cmp}")
 
 #-----------------------------------------------------------------------------
 # Test CMAKE_POLICY_DEFAULT_CMP<NNNN> variable.
 cmake_policy(PUSH)
-  set(CMAKE_POLICY_DEFAULT_CMP0010 OLD) # ignored
-  set(CMAKE_POLICY_DEFAULT_CMP0012 OLD) # honored
-  set(CMAKE_POLICY_DEFAULT_CMP0013 NEW) # honored
-  set(CMAKE_POLICY_DEFAULT_CMP0014 "")  # noop
-  cmake_policy(VERSION 2.6.3)
-  cmake_policy(GET CMP0010 cmp)
-  check(CMP0010 "NEW" "${cmp}")
-  cmake_policy(GET CMP0012 cmp)
-  check(CMP0012 "OLD" "${cmp}")
-  cmake_policy(GET CMP0013 cmp)
-  check(CMP0013 "NEW" "${cmp}")
-  cmake_policy(GET CMP0014 cmp)
-  check(CMP0014 "" "${cmp}")
+  set(CMAKE_POLICY_DEFAULT_CMP0054 OLD) # ignored
+  set(CMAKE_POLICY_DEFAULT_CMP0055 OLD) # honored
+  set(CMAKE_POLICY_DEFAULT_CMP0056 NEW) # honored
+  set(CMAKE_POLICY_DEFAULT_CMP0057 "")  # noop
+  cmake_policy(VERSION 3.1)
+  cmake_policy(GET CMP0054 cmp)
+  check(CMP0054 "NEW" "${cmp}")
+  cmake_policy(GET CMP0055 cmp)
+  check(CMP0055 "OLD" "${cmp}")
+  cmake_policy(GET CMP0056 cmp)
+  check(CMP0056 "NEW" "${cmp}")
+  cmake_policy(GET CMP0057 cmp)
+  check(CMP0057 "" "${cmp}")
 cmake_policy(POP)
 
 #-----------------------------------------------------------------------------
diff --git a/Tests/PolicyScope/FindFoo.cmake b/Tests/PolicyScope/FindFoo.cmake
index 5b441e2..3f9ac8e 100644
--- a/Tests/PolicyScope/FindFoo.cmake
+++ b/Tests/PolicyScope/FindFoo.cmake
@@ -1,2 +1,2 @@
-cmake_minimum_required(VERSION 2.6.3)
-cmake_policy(SET CMP0003 OLD)
+cmake_minimum_required(VERSION 3.2)
+cmake_policy(SET CMP0056 OLD)

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list