[Cmake-commits] CMake branch, next, updated. v3.7.1-1885-g8be34d3

Brad King brad.king at kitware.com
Mon Jan 9 16:02:08 EST 2017


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  8be34d3d4c4669793f8a400dfa111230d92af701 (commit)
       via  98f2143305b8b8c5ce08dfa38ee79750696865a6 (commit)
      from  07d64808b353bb14faa959596f0489a17f5f85f6 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8be34d3d4c4669793f8a400dfa111230d92af701
commit 8be34d3d4c4669793f8a400dfa111230d92af701
Merge: 07d6480 98f2143
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 9 16:02:07 2017 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 9 16:02:07 2017 -0500

    Merge topic 'read-only-type-target-property' into next
    
    98f21433 cmTarget: Enforce TYPE being a read-only property


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98f2143305b8b8c5ce08dfa38ee79750696865a6
commit 98f2143305b8b8c5ce08dfa38ee79750696865a6
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Thu Dec 29 23:11:50 2016 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 9 16:00:39 2017 -0500

    cmTarget: Enforce TYPE being a read-only property

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ee4ff39..9261ca8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -858,6 +858,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
   }
+  if (prop == "TYPE") {
+    std::ostringstream e;
+    e << "TYPE property is read-only\n";
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return;
+  }
   if (prop == "EXPORT_NAME" && this->IsImported()) {
     std::ostringstream e;
     e << "EXPORT_NAME property can't be set on imported targets (\""
diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake
index 37c7124..1ddacee 100644
--- a/Tests/RunCMake/set_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake
@@ -6,4 +6,5 @@ run_cmake(COMPILE_OPTIONS)
 run_cmake(INCLUDE_DIRECTORIES)
 run_cmake(LINK_LIBRARIES)
 run_cmake(SOURCES)
+run_cmake(TYPE)
 run_cmake(USER_PROP)
diff --git a/Tests/RunCMake/set_property/TYPE-result.txt b/Tests/RunCMake/set_property/TYPE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/set_property/TYPE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/set_property/TYPE-stderr.txt b/Tests/RunCMake/set_property/TYPE-stderr.txt
new file mode 100644
index 0000000..fbc8653
--- /dev/null
+++ b/Tests/RunCMake/set_property/TYPE-stderr.txt
@@ -0,0 +1 @@
+TYPE property is read-only
diff --git a/Tests/RunCMake/set_property/TYPE.cmake b/Tests/RunCMake/set_property/TYPE.cmake
new file mode 100644
index 0000000..8481266
--- /dev/null
+++ b/Tests/RunCMake/set_property/TYPE.cmake
@@ -0,0 +1,2 @@
+add_custom_target(CustomTarget)
+set_property(TARGET CustomTarget PROPERTY TYPE foo)

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

Summary of changes:
 Source/cmTarget.cxx                                              |    6 ++++++
 Tests/RunCMake/set_property/RunCMakeTest.cmake                   |    1 +
 .../BadSYSROOT-result.txt => set_property/TYPE-result.txt}       |    0
 Tests/RunCMake/set_property/TYPE-stderr.txt                      |    1 +
 Tests/RunCMake/set_property/TYPE.cmake                           |    2 ++
 5 files changed, 10 insertions(+)
 copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => set_property/TYPE-result.txt} (100%)
 create mode 100644 Tests/RunCMake/set_property/TYPE-stderr.txt
 create mode 100644 Tests/RunCMake/set_property/TYPE.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list