Merge topic 'read-only-type-target-property'

98f21433 cmTarget: Enforce TYPE being a read-only property
This commit is contained in:
Brad King
2017-01-09 16:27:25 -05:00
committed by CMake Topic Stage
5 changed files with 11 additions and 0 deletions
+6
View File
@@ -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 (\""
@@ -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)
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
TYPE property is read-only
+2
View File
@@ -0,0 +1,2 @@
add_custom_target(CustomTarget)
set_property(TARGET CustomTarget PROPERTY TYPE foo)