summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/AliasTarget/CMakeLists.txt3
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/CompatibleInterface/CMakeLists.txt2
-rw-r--r--Tests/InterfaceLibrary/CMakeLists.txt15
-rw-r--r--Tests/InterfaceLibrary/definetestexe.cpp9
-rw-r--r--Tests/InterfaceLibrary/libsdir/CMakeLists.txt26
-rw-r--r--Tests/InterfaceLibrary/libsdir/shareddependlib.cpp7
-rw-r--r--Tests/InterfaceLibrary/libsdir/shareddependlib/shareddependlib.h12
-rw-r--r--Tests/InterfaceLibrary/libsdir/sharedlib.cpp12
-rw-r--r--Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h15
-rw-r--r--Tests/InterfaceLibrary/sharedlibtestexe.cpp19
-rw-r--r--Tests/PositionIndependentTargets/CMakeLists.txt1
-rw-r--r--Tests/PositionIndependentTargets/interface/CMakeLists.txt27
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt4
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict4.cmake8
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt3
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict5.cmake9
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt4
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Conflict6.cmake8
-rw-r--r--Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/interface_library/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/interface_library/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/interface_library/invalid_name-result.txt1
-rw-r--r--Tests/RunCMake/interface_library/invalid_name-stderr.txt9
-rw-r--r--Tests/RunCMake/interface_library/invalid_name.cmake4
-rw-r--r--Tests/RunCMake/interface_library/target_commands-result.txt1
-rw-r--r--Tests/RunCMake/interface_library/target_commands-stderr.txt47
-rw-r--r--Tests/RunCMake/interface_library/target_commands.cmake13
32 files changed, 273 insertions, 1 deletions
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index a5eb0f6de7..fdb1638406 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -45,3 +45,6 @@ get_property(_alt2 TARGET PREFIX::Foo PROPERTY ALIASED_TARGET)
if (NOT ${_alt2} STREQUAL foo)
message(SEND_ERROR "ALIASED_TARGET is not foo.")
endif()
+
+add_library(iface INTERFACE)
+add_library(Alias::Iface ALIAS iface)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9c3ed594f7..ca32aacd78 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -246,6 +246,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(CompileOptions CompileOptions)
ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
ADD_TEST_MACRO(AliasTarget AliasTarget)
+ ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
set_tests_properties(EmptyLibrary PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target: test")
ADD_TEST_MACRO(CrossCompile CrossCompile)
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index ae1d2fa431..5ee9fd7a69 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -6,7 +6,7 @@ project(CompatibleInterface)
include(GenerateExportHeader)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-add_library(iface1 empty.cpp)
+add_library(iface1 INTERFACE)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_BOOL
BOOL_PROP1
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
new file mode 100644
index 0000000000..53aeb036b0
--- /dev/null
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(InterfaceLibrary)
+
+add_library(iface_nodepends INTERFACE)
+target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE)
+
+add_executable(InterfaceLibrary definetestexe.cpp)
+target_link_libraries(InterfaceLibrary iface_nodepends)
+
+add_subdirectory(libsdir)
+
+add_executable(sharedlibtestexe sharedlibtestexe.cpp)
+target_link_libraries(sharedlibtestexe shared_iface)
diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp
new file mode 100644
index 0000000000..decd37c51d
--- /dev/null
+++ b/Tests/InterfaceLibrary/definetestexe.cpp
@@ -0,0 +1,9 @@
+
+#ifndef IFACE_DEFINE
+#error Expected IFACE_DEFINE
+#endif
+
+int main(int,char**)
+{
+ return 0;
+}
diff --git a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
new file mode 100644
index 0000000000..6999646561
--- /dev/null
+++ b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
@@ -0,0 +1,26 @@
+
+include(GenerateExportHeader)
+
+add_library(sharedlib SHARED sharedlib.cpp)
+generate_export_header(sharedlib)
+
+add_library(shareddependlib SHARED shareddependlib.cpp)
+generate_export_header(shareddependlib)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
+
+target_link_libraries(sharedlib PUBLIC shareddependlib)
+
+target_include_directories(shareddependlib
+ PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/shareddependlib")
+target_compile_definitions(shareddependlib
+ INTERFACE $<1:SHAREDDEPENDLIB_DEFINE>)
+
+target_include_directories(sharedlib
+ PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sharedlib")
+target_compile_definitions(shareddependlib
+ INTERFACE $<1:SHAREDLIB_DEFINE>)
+
+add_library(shared_iface INTERFACE)
+target_link_libraries(shared_iface INTERFACE sharedlib)
diff --git a/Tests/InterfaceLibrary/libsdir/shareddependlib.cpp b/Tests/InterfaceLibrary/libsdir/shareddependlib.cpp
new file mode 100644
index 0000000000..378ba8165f
--- /dev/null
+++ b/Tests/InterfaceLibrary/libsdir/shareddependlib.cpp
@@ -0,0 +1,7 @@
+
+#include "shareddependlib.h"
+
+int SharedDependLibObject::foo() const
+{
+ return 0;
+}
diff --git a/Tests/InterfaceLibrary/libsdir/shareddependlib/shareddependlib.h b/Tests/InterfaceLibrary/libsdir/shareddependlib/shareddependlib.h
new file mode 100644
index 0000000000..ad9b484b7a
--- /dev/null
+++ b/Tests/InterfaceLibrary/libsdir/shareddependlib/shareddependlib.h
@@ -0,0 +1,12 @@
+
+#ifndef SHAREDDEPENDLIB_H
+#define SHAREDDEPENDLIB_H
+
+#include "shareddependlib_export.h"
+
+struct SHAREDDEPENDLIB_EXPORT SharedDependLibObject
+{
+ int foo() const;
+};
+
+#endif
diff --git a/Tests/InterfaceLibrary/libsdir/sharedlib.cpp b/Tests/InterfaceLibrary/libsdir/sharedlib.cpp
new file mode 100644
index 0000000000..c49ce905b1
--- /dev/null
+++ b/Tests/InterfaceLibrary/libsdir/sharedlib.cpp
@@ -0,0 +1,12 @@
+
+#include "sharedlib.h"
+
+SharedDependLibObject SharedLibObject::object() const
+{
+ SharedDependLibObject sdlo;
+ return sdlo;
+}
+int SharedLibObject::foo() const
+{
+ return 0;
+}
diff --git a/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h b/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h
new file mode 100644
index 0000000000..5b3c7db732
--- /dev/null
+++ b/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h
@@ -0,0 +1,15 @@
+
+#ifndef SHAREDLIB_H
+#define SHAREDLIB_H
+
+#include "sharedlib_export.h"
+
+#include "shareddependlib.h"
+
+struct SHAREDLIB_EXPORT SharedLibObject
+{
+ SharedDependLibObject object() const;
+ int foo() const;
+};
+
+#endif
diff --git a/Tests/InterfaceLibrary/sharedlibtestexe.cpp b/Tests/InterfaceLibrary/sharedlibtestexe.cpp
new file mode 100644
index 0000000000..c677f7067a
--- /dev/null
+++ b/Tests/InterfaceLibrary/sharedlibtestexe.cpp
@@ -0,0 +1,19 @@
+
+#ifndef SHAREDLIB_DEFINE
+#error Expected SHAREDLIB_DEFINE
+#endif
+
+#ifndef SHAREDDEPENDLIB_DEFINE
+#error Expected SHAREDDEPENDLIB_DEFINE
+#endif
+
+#include "sharedlib.h"
+#include "shareddependlib.h"
+
+int main(int,char**)
+{
+ SharedLibObject sl;
+ SharedDependLibObject sdl = sl.object();
+
+ return sdl.foo() + sl.foo();
+}
diff --git a/Tests/PositionIndependentTargets/CMakeLists.txt b/Tests/PositionIndependentTargets/CMakeLists.txt
index eec893d320..e79f3b74b7 100644
--- a/Tests/PositionIndependentTargets/CMakeLists.txt
+++ b/Tests/PositionIndependentTargets/CMakeLists.txt
@@ -9,5 +9,6 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}") # For pic_test.h
add_subdirectory(global)
add_subdirectory(targets)
+add_subdirectory(interface)
add_executable(PositionIndependentTargets main.cpp)
diff --git a/Tests/PositionIndependentTargets/interface/CMakeLists.txt b/Tests/PositionIndependentTargets/interface/CMakeLists.txt
new file mode 100644
index 0000000000..65f3b767ed
--- /dev/null
+++ b/Tests/PositionIndependentTargets/interface/CMakeLists.txt
@@ -0,0 +1,27 @@
+
+add_library(piciface INTERFACE)
+set_property(TARGET piciface PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+add_executable(test_empty_iface "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp")
+target_link_libraries(test_empty_iface piciface)
+
+add_library(sharedlib SHARED "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp")
+target_link_libraries(sharedlib piciface)
+set_property(TARGET sharedlib PROPERTY DEFINE_SYMBOL PIC_TEST_BUILD_DLL)
+
+add_executable(test_iface_via_shared "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp")
+target_link_libraries(test_iface_via_shared sharedlib)
+
+add_library(sharedlibpic SHARED "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp")
+set_property(TARGET sharedlibpic PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
+set_property(TARGET sharedlibpic PROPERTY DEFINE_SYMBOL PIC_TEST_BUILD_DLL)
+
+add_library(shared_iface INTERFACE)
+target_link_libraries(shared_iface INTERFACE sharedlibpic)
+
+add_executable(test_shared_via_iface "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp")
+target_link_libraries(test_shared_via_iface shared_iface)
+
+add_executable(test_shared_via_iface_non_conflict "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp")
+set_property(TARGET test_shared_via_iface_non_conflict PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_link_libraries(test_shared_via_iface_non_conflict shared_iface)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index e45aba3781..5d662d191d 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -100,6 +100,7 @@ add_RunCMake_test(variable_watch)
add_RunCMake_test(CMP0004)
add_RunCMake_test(TargetPolicies)
add_RunCMake_test(alias_targets)
+add_RunCMake_test(interface_library)
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt b/Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt
new file mode 100644
index 0000000000..76d5ea08a4
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error: Property POSITION_INDEPENDENT_CODE on target "conflict" is
+implied to be FALSE because it was used to determine the link libraries
+already. The INTERFACE_POSITION_INDEPENDENT_CODE property on
+dependency "picon" is in conflict.
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict4.cmake b/Tests/RunCMake/PositionIndependentCode/Conflict4.cmake
new file mode 100644
index 0000000000..ff5dfb353c
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict4.cmake
@@ -0,0 +1,8 @@
+
+add_library(piciface INTERFACE)
+
+add_library(picon INTERFACE)
+set_property(TARGET picon PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+add_executable(conflict "main.cpp")
+target_link_libraries(conflict picon $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:piciface>)
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt b/Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt
new file mode 100644
index 0000000000..ecd04928d3
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error: The INTERFACE_POSITION_INDEPENDENT_CODE property of "picoff" does
+not agree with the value of POSITION_INDEPENDENT_CODE already determined
+for "conflict".
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict5.cmake b/Tests/RunCMake/PositionIndependentCode/Conflict5.cmake
new file mode 100644
index 0000000000..e6055f4508
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict5.cmake
@@ -0,0 +1,9 @@
+
+add_library(picon INTERFACE)
+set_property(TARGET picon PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+add_library(picoff INTERFACE)
+set_property(TARGET picoff PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE OFF)
+
+add_executable(conflict "main.cpp")
+target_link_libraries(conflict picon picoff)
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt b/Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt
new file mode 100644
index 0000000000..0254e55575
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt
@@ -0,0 +1,4 @@
+Property POSITION_INDEPENDENT_CODE on target "conflict" is
+implied to be FALSE because it was used to determine the link libraries
+already. The INTERFACE_POSITION_INDEPENDENT_CODE property on
+dependency "picon" is in conflict.
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict6.cmake b/Tests/RunCMake/PositionIndependentCode/Conflict6.cmake
new file mode 100644
index 0000000000..7ea7c5f731
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Conflict6.cmake
@@ -0,0 +1,8 @@
+
+add_library(picoff INTERFACE)
+
+add_library(picon INTERFACE)
+set_property(TARGET picon PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+add_executable(conflict "main.cpp")
+target_link_libraries(conflict picon $<$<NOT:$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>>:picoff>)
diff --git a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
index 64a340c9c9..3a2009b48c 100644
--- a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
@@ -3,3 +3,6 @@ include(RunCMake)
run_cmake(Conflict1)
run_cmake(Conflict2)
run_cmake(Conflict3)
+run_cmake(Conflict4)
+run_cmake(Conflict5)
+run_cmake(Conflict6)
diff --git a/Tests/RunCMake/interface_library/CMakeLists.txt b/Tests/RunCMake/interface_library/CMakeLists.txt
new file mode 100644
index 0000000000..12cd3c7757
--- /dev/null
+++ b/Tests/RunCMake/interface_library/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
new file mode 100644
index 0000000000..56caf683fb
--- /dev/null
+++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(invalid_name)
+run_cmake(target_commands)
diff --git a/Tests/RunCMake/interface_library/invalid_name-result.txt b/Tests/RunCMake/interface_library/invalid_name-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/interface_library/invalid_name-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/invalid_name-stderr.txt b/Tests/RunCMake/interface_library/invalid_name-stderr.txt
new file mode 100644
index 0000000000..c66e0800ae
--- /dev/null
+++ b/Tests/RunCMake/interface_library/invalid_name-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at invalid_name.cmake:2 \(add_library\):
+ add_library Invalid name for INTERFACE library target: if\$ace
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_name.cmake:4 \(add_library\):
+ add_library Invalid name for INTERFACE library target: iface::target
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/invalid_name.cmake b/Tests/RunCMake/interface_library/invalid_name.cmake
new file mode 100644
index 0000000000..51a109d325
--- /dev/null
+++ b/Tests/RunCMake/interface_library/invalid_name.cmake
@@ -0,0 +1,4 @@
+
+add_library(if$ace INTERFACE)
+
+add_library(iface::target INTERFACE)
diff --git a/Tests/RunCMake/interface_library/target_commands-result.txt b/Tests/RunCMake/interface_library/target_commands-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/interface_library/target_commands-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/target_commands-stderr.txt b/Tests/RunCMake/interface_library/target_commands-stderr.txt
new file mode 100644
index 0000000000..be11b77545
--- /dev/null
+++ b/Tests/RunCMake/interface_library/target_commands-stderr.txt
@@ -0,0 +1,47 @@
+CMake Error at target_commands.cmake:4 \(target_link_libraries\):
+ INTERFACE library can only be used with the INTERFACE keyword of
+ target_link_libraries
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:5 \(target_link_libraries\):
+ INTERFACE library can only be used with the INTERFACE keyword of
+ target_link_libraries
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:6 \(target_link_libraries\):
+ INTERFACE library can only be used with the INTERFACE keyword of
+ target_link_libraries
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:7 \(target_link_libraries\):
+ INTERFACE library can only be used with the INTERFACE keyword of
+ target_link_libraries
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:9 \(target_include_directories\):
+ target_include_directories may only be set INTERFACE properties on
+ INTERFACE targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:10 \(target_include_directories\):
+ target_include_directories may only be set INTERFACE properties on
+ INTERFACE targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:12 \(target_compile_definitions\):
+ target_compile_definitions may only be set INTERFACE properties on
+ INTERFACE targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at target_commands.cmake:13 \(target_compile_definitions\):
+ target_compile_definitions may only be set INTERFACE properties on
+ INTERFACE targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/target_commands.cmake b/Tests/RunCMake/interface_library/target_commands.cmake
new file mode 100644
index 0000000000..3182e8933e
--- /dev/null
+++ b/Tests/RunCMake/interface_library/target_commands.cmake
@@ -0,0 +1,13 @@
+
+add_library(iface INTERFACE)
+
+target_link_libraries(iface PRIVATE foo)
+target_link_libraries(iface PUBLIC foo)
+target_link_libraries(iface foo)
+target_link_libraries(iface LINK_INTERFACE_LIBRARIES foo)
+
+target_include_directories(iface PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
+target_include_directories(iface PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
+
+target_compile_definitions(iface PRIVATE SOME_DEFINE)
+target_compile_definitions(iface PUBLIC SOME_DEFINE)