[Cmake-commits] CMake branch, next, updated. v3.2.1-1370-ga7d2520

Stephen Kelly steveire at gmail.com
Wed Apr 1 15:08:28 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  a7d2520836725e9dcc8611ee24c6e80f7fefb14b (commit)
       via  30dd4f8ef80674b0ec32f6edfd7b1c6740776dfc (commit)
      from  a6782941026ce348d124e59e6c47c68e46585537 (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=a7d2520836725e9dcc8611ee24c6e80f7fefb14b
commit a7d2520836725e9dcc8611ee24c6e80f7fefb14b
Merge: a678294 30dd4f8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 1 15:08:26 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 1 15:08:26 2015 -0400

    Merge topic 'clean-up-cmMakefile' into next
    
    30dd4f8e cmMakefiles: Don't treat DEFINITIONS as a built-in property.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30dd4f8ef80674b0ec32f6edfd7b1c6740776dfc
commit 30dd4f8ef80674b0ec32f6edfd7b1c6740776dfc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 1 20:53:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 1 21:07:19 2015 +0200

    cmMakefiles: Don't treat DEFINITIONS as a built-in property.
    
    Add policy CMP0059 to cover this change.
    
    This is part of cleaning up cmMakefile - The DefineFlagsOrig member
    should not need to exist.

diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
new file mode 100644
index 0000000..a2fb157
--- /dev/null
+++ b/Help/policy/CMP0059.rst
@@ -0,0 +1,16 @@
+CMP0059
+-------
+
+Don't treat ``DEFINITIONS`` as a built-in directory property.
+
+CMake 3.3 and above no longer make a list of definitions available through
+the :prop_dir:`DEFINITIONS` directory property.
+
+The ``OLD`` behavior for this policy is to provide the list of flags given
+so far to the :command:`add_definitions` command.  The ``NEW`` behavior is
+to behave as a normal user-defined directory property.
+
+This policy was introduced in CMake version 3.3.
+CMake version |release| warns when the policy is not set and uses
+``OLD`` behavior.  Use the :command:`cmake_policy` command to set
+it to ``OLD`` or ``NEW`` explicitly.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6fbcaeb..ec1d814 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4209,8 +4209,19 @@ const char *cmMakefile::GetProperty(const std::string& prop,
     }
   else if (prop == "DEFINITIONS")
     {
-    output += this->DefineFlagsOrig;
-    return output.c_str();
+    switch(this->GetPolicyStatus(cmPolicies::CMP0059))
+      {
+      case cmPolicies::WARN:
+          this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()->
+                             GetPolicyWarning(cmPolicies::CMP0059));
+      case cmPolicies::OLD:
+        output += this->DefineFlagsOrig;
+        return output.c_str();
+      case cmPolicies::NEW:
+      case cmPolicies::REQUIRED_ALWAYS:
+      case cmPolicies::REQUIRED_IF_USED:
+        break;
+      }
     }
   else if (prop == "LINK_DIRECTORIES")
     {
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 592df8f..0a61bca 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -385,6 +385,11 @@ cmPolicies::cmPolicies()
     CMP0058, "CMP0058",
     "Ninja requires custom command byproducts to be explicit.",
     3,3,0, cmPolicies::WARN);
+
+  this->DefinePolicy(
+    CMP0059, "CMP0059",
+    "Do no treat DEFINITIONS as a built-in directory property.",
+    3,3,0, cmPolicies::WARN);
 }
 
 cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index b18b337..ced9d8c 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -116,6 +116,8 @@ public:
     CMP0057, ///< Disallow multiple MAIN_DEPENDENCY specifications
     /// for the same file.
     CMP0058, ///< Ninja requires custom command byproducts to be explicit
+    CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory
+    /// property.
 
     /** \brief Always the last entry.
      *
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
new file mode 100644
index 0000000..76992d8
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
@@ -0,0 +1,2 @@
+DEFS:
+CUSTOM CONTENT:CUSTOM_CONTENT
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
new file mode 100644
index 0000000..f7b9303
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
@@ -0,0 +1,17 @@
+
+cmake_policy(SET CMP0059 NEW)
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+  PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+  PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+  PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
new file mode 100644
index 0000000..e35e8c5
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
@@ -0,0 +1,2 @@
+DEFS: -DSOME_DEF
+CUSTOM CONTENT: -DSOME_DEF
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
new file mode 100644
index 0000000..2555774
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
@@ -0,0 +1,17 @@
+
+cmake_policy(SET CMP0059 OLD)
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+  PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+  PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+  PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
new file mode 100644
index 0000000..4e04d15
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
@@ -0,0 +1,18 @@
+CMake Warning \(dev\) at CMP0059-WARN.cmake:6 \(get_property\):
+  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
+  cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
+
+DEFS: -DSOME_DEF
+CMake Warning \(dev\) at CMP0059-WARN.cmake:14 \(get_property\):
+  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
+  cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
+
+CUSTOM CONTENT: -DSOME_DEF
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
new file mode 100644
index 0000000..9d0b49c
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
@@ -0,0 +1,17 @@
+
+
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+  PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+  PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+  PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMakeLists.txt b/Tests/RunCMake/CMP0059/CMakeLists.txt
new file mode 100644
index 0000000..ef2163c
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0059/RunCMakeTest.cmake b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake
new file mode 100644
index 0000000..9b57579
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0059-OLD)
+run_cmake(CMP0059-NEW)
+run_cmake(CMP0059-WARN)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 7b9c810..6daf27a 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -64,6 +64,7 @@ add_RunCMake_test(CMP0053)
 add_RunCMake_test(CMP0054)
 add_RunCMake_test(CMP0055)
 add_RunCMake_test(CMP0057)
+add_RunCMake_test(CMP0059)
 if(CMAKE_GENERATOR STREQUAL "Ninja")
   add_RunCMake_test(Ninja)
 endif()

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

Summary of changes:
 Help/policy/CMP0059.rst                              |   16 ++++++++++++++++
 Source/cmMakefile.cxx                                |   15 +++++++++++++--
 Source/cmPolicies.cxx                                |    5 +++++
 Source/cmPolicies.h                                  |    2 ++
 .../CMP0059-NEW-result.txt}                          |    0
 Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt        |    2 ++
 Tests/RunCMake/CMP0059/CMP0059-NEW.cmake             |   17 +++++++++++++++++
 .../CMP0059-OLD-result.txt}                          |    0
 Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt        |    2 ++
 Tests/RunCMake/CMP0059/CMP0059-OLD.cmake             |   17 +++++++++++++++++
 .../CMP0059-WARN-result.txt}                         |    0
 Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt       |   18 ++++++++++++++++++
 Tests/RunCMake/CMP0059/CMP0059-WARN.cmake            |   17 +++++++++++++++++
 Tests/RunCMake/{CMP0055 => CMP0059}/CMakeLists.txt   |    0
 Tests/RunCMake/CMP0059/RunCMakeTest.cmake            |    5 +++++
 Tests/RunCMake/CMakeLists.txt                        |    1 +
 16 files changed, 115 insertions(+), 2 deletions(-)
 create mode 100644 Help/policy/CMP0059.rst
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-NEW-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-OLD-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-WARN-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
 copy Tests/RunCMake/{CMP0055 => CMP0059}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/CMP0059/RunCMakeTest.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list