summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-stderr.txt26
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake1
4 files changed, 34 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-result.txt b/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-stderr.txt
new file mode 100644
index 0000000000..3aa457eeee
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface-stderr.txt
@@ -0,0 +1,26 @@
+CMake Error at BadTargetTypeInterface.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<TARGET_FILE:iface>
+
+ Target "iface" is not an executable or library.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at BadTargetTypeInterface.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<TARGET_SONAME_FILE:iface>
+
+ Target "iface" is not an executable or library.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at BadTargetTypeInterface.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<TARGET_LINKER_FILE:iface>
+
+ Target "iface" is not an executable or library.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface.cmake b/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface.cmake
new file mode 100644
index 0000000000..19566f4397
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadTargetTypeInterface.cmake
@@ -0,0 +1,6 @@
+add_library(iface INTERFACE)
+add_custom_target(check ALL COMMAND echo
+ $<TARGET_FILE:iface>
+ $<TARGET_SONAME_FILE:iface>
+ $<TARGET_LINKER_FILE:iface>
+ )
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 542b7fc87d..1c8fab5342 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ run_cmake(BadNOT)
run_cmake(BadStrEqual)
run_cmake(BadZero)
run_cmake(BadTargetName)
+run_cmake(BadTargetTypeInterface)
run_cmake(BadTargetTypeObject)
run_cmake(BadInstallPrefix)
run_cmake(CMP0044-WARN)