summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Import
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-09-23 11:45:17 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-05 00:18:37 (GMT)
commit894f52f32d96ae92df0ba3dac2a70fe9c87e818d (patch)
treeac4350fb4cea5b188f7880ea4207d4a4fecbdf7e /Tests/ExportImport/Import
parentf5b1980fb27fa902d37856ec3e22daddfeb9d52f (diff)
downloadCMake-894f52f32d96ae92df0ba3dac2a70fe9c87e818d.zip
CMake-894f52f32d96ae92df0ba3dac2a70fe9c87e818d.tar.gz
CMake-894f52f32d96ae92df0ba3dac2a70fe9c87e818d.tar.bz2
Handle INTERFACE properties transitively for includes and defines.
Contextually, the behavior is as if the properties content from another target is included in the string and then the result is evaluated.
Diffstat (limited to 'Tests/ExportImport/Import')
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt15
-rw-r--r--Tests/ExportImport/Import/A/deps_iface.cpp24
2 files changed, 39 insertions, 0 deletions
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 8841792..b77562e 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -152,3 +152,18 @@ check_function_exists(testLib1 HAVE_TESTLIB1_FUNCTION)
if (NOT HAVE_TESTLIB1_FUNCTION)
message(SEND_ERROR "Using imported target testLib2 in check_function_exists() failed !")
endif()
+
+#-----------------------------------------------------------------------------
+# Test that dependent imported targets have usable
+# INTERFACE_COMPILE_DEFINITIONS and INTERFACE_INCLUDE_DIRECTORIES
+
+add_library(deps_iface deps_iface.cpp)
+target_link_libraries(deps_iface testLibsDepends)
+set_property(TARGET deps_iface APPEND PROPERTY
+ COMPILE_DEFINITIONS
+ $<TARGET_PROPERTY:testLibDepends,INTERFACE_COMPILE_DEFINITIONS>
+)
+set_property(TARGET deps_iface APPEND PROPERTY
+ INCLUDE_DIRECTORIES
+ $<TARGET_PROPERTY:testLibDepends,INTERFACE_INCLUDE_DIRECTORIES>
+)
diff --git a/Tests/ExportImport/Import/A/deps_iface.cpp b/Tests/ExportImport/Import/A/deps_iface.cpp
new file mode 100644
index 0000000..7190b92
--- /dev/null
+++ b/Tests/ExportImport/Import/A/deps_iface.cpp
@@ -0,0 +1,24 @@
+
+#include "testLibIncludeRequired1.h"
+#include "testLibIncludeRequired2.h"
+#include "testLibIncludeRequired6.h"
+
+#ifndef testLibRequired_IFACE_DEFINE
+#error Expected testLibRequired_IFACE_DEFINE
+#endif
+
+#ifdef BuildOnly_DEFINE
+#error Unexpected BuildOnly_DEFINE
+#endif
+
+#ifndef InstallOnly_DEFINE
+#error Expected InstallOnly_DEFINE
+#endif
+
+extern int testLibDepends(void);
+
+
+int main(int,char **)
+{
+ return testLibDepends();
+}