summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GeneratorExpression
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-26 15:51:34 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-26 15:53:36 (GMT)
commit89253992b8237d8c3bd93c2194dcd8bc18fa55db (patch)
tree54dc49b76410ed133fd17521dbe336e34258deb6 /Tests/RunCMake/GeneratorExpression
parent12b9005d7c015b1f8cece5a9d8cf5f1a9f4a18fa (diff)
downloadCMake-89253992b8237d8c3bd93c2194dcd8bc18fa55db.zip
CMake-89253992b8237d8c3bd93c2194dcd8bc18fa55db.tar.gz
CMake-89253992b8237d8c3bd93c2194dcd8bc18fa55db.tar.bz2
Tests: Add case for rejecting $<TARGET_FILE:...> on an INTERFACE library
Add an explicit test for this existing error. We already cover it for an OBJECT library but INTERFACE libraries are not allowed either.
Diffstat (limited to 'Tests/RunCMake/GeneratorExpression')
-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 0000000..d00491f
--- /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 0000000..3aa457e
--- /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 0000000..19566f4
--- /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 542b7fc..1c8fab5 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)