summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmTargetPropCommandBase.cxx20
-rw-r--r--Tests/RunCMake/target_compile_definitions/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_definitions/empty_keyword_args-stderr.txt5
-rw-r--r--Tests/RunCMake/target_compile_features/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_features/empty_keyword_args-stderr.txt5
-rw-r--r--Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt5
-rw-r--r--Tests/RunCMake/target_include_directories/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_include_directories/empty_keyword_args-stderr.txt5
-rw-r--r--Tests/RunCMake/target_link_directories/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/empty_keyword_args-stderr.txt5
-rw-r--r--Tests/RunCMake/target_link_options/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt4
-rw-r--r--Tests/RunCMake/target_sources/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_sources/empty_keyword_args-stderr.txt4
15 files changed, 11 insertions, 49 deletions
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 48348f3..1b8ee81 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -84,15 +84,6 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
this->SetError("called with invalid arguments");
return false;
}
- if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
- scope != "INTERFACE") {
- this->SetError("may only set INTERFACE properties on INTERFACE targets");
- return false;
- }
- if (this->Target->IsImported() && scope != "INTERFACE") {
- this->SetError("may only set INTERFACE properties on IMPORTED targets");
- return false;
- }
++argIndex;
@@ -105,6 +96,17 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
}
content.push_back(args[i]);
}
+ if (!content.empty()) {
+ if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
+ scope != "INTERFACE") {
+ this->SetError("may only set INTERFACE properties on INTERFACE targets");
+ return false;
+ }
+ if (this->Target->IsImported() && scope != "INTERFACE") {
+ this->SetError("may only set INTERFACE properties on IMPORTED targets");
+ return false;
+ }
+ }
return this->PopulateTargetProperies(scope, content, prepend, system);
}
diff --git a/Tests/RunCMake/target_compile_definitions/empty_keyword_args-result.txt b/Tests/RunCMake/target_compile_definitions/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_compile_definitions/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_compile_definitions/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_compile_definitions/empty_keyword_args-stderr.txt
deleted file mode 100644
index d8fb3ba..0000000
--- a/Tests/RunCMake/target_compile_definitions/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_compile_definitions\):
- target_compile_definitions may only set INTERFACE properties on INTERFACE
- targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:5 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/empty_keyword_args-result.txt b/Tests/RunCMake/target_compile_features/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_compile_features/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_compile_features/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_compile_features/empty_keyword_args-stderr.txt
deleted file mode 100644
index eecd3cf..0000000
--- a/Tests/RunCMake/target_compile_features/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_compile_features\):
- target_compile_features may only set INTERFACE properties on INTERFACE
- targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt b/Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt
deleted file mode 100644
index 381ff48..0000000
--- a/Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_compile_options\):
- target_compile_options may only set INTERFACE properties on INTERFACE
- targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:5 \(include\)
diff --git a/Tests/RunCMake/target_include_directories/empty_keyword_args-result.txt b/Tests/RunCMake/target_include_directories/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_include_directories/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_include_directories/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_include_directories/empty_keyword_args-stderr.txt
deleted file mode 100644
index 6200703..0000000
--- a/Tests/RunCMake/target_include_directories/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_include_directories\):
- target_include_directories may only set INTERFACE properties on INTERFACE
- targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:5 \(include\)
diff --git a/Tests/RunCMake/target_link_directories/empty_keyword_args-result.txt b/Tests/RunCMake/target_link_directories/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_link_directories/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_link_directories/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_link_directories/empty_keyword_args-stderr.txt
deleted file mode 100644
index 26ee9a1..0000000
--- a/Tests/RunCMake/target_link_directories/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_link_directories\):
- target_link_directories may only set INTERFACE properties on INTERFACE
- targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:5 \(include\)
diff --git a/Tests/RunCMake/target_link_options/empty_keyword_args-result.txt b/Tests/RunCMake/target_link_options/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_link_options/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt
deleted file mode 100644
index 0103d00..0000000
--- a/Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_link_options\):
- target_link_options may only set INTERFACE properties on INTERFACE targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:5 \(include\)
diff --git a/Tests/RunCMake/target_sources/empty_keyword_args-result.txt b/Tests/RunCMake/target_sources/empty_keyword_args-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_sources/empty_keyword_args-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_sources/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_sources/empty_keyword_args-stderr.txt
deleted file mode 100644
index 9ff5bb0..0000000
--- a/Tests/RunCMake/target_sources/empty_keyword_args-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at empty_keyword_args.cmake:2 \(target_sources\):
- target_sources may only set INTERFACE properties on INTERFACE targets
-Call Stack \(most recent call first\):
- CMakeLists.txt:5 \(include\)