summaryrefslogtreecommitdiffstats
path: root/Tests/InterfaceLibrary
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-06 16:43:12 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-01-06 16:43:12 (GMT)
commitdc08199848c20c7f76a68dbf54a85c736809ac57 (patch)
tree0d0d5b59269c8edc078450b8aeecc519affa6a2f /Tests/InterfaceLibrary
parentb225dbbd0235b545383105e0571f84a1bf6b1be0 (diff)
parent84fac67f90b275116efa9ec25f5fcb2c2bf7f6b4 (diff)
downloadCMake-dc08199848c20c7f76a68dbf54a85c736809ac57.zip
CMake-dc08199848c20c7f76a68dbf54a85c736809ac57.tar.gz
CMake-dc08199848c20c7f76a68dbf54a85c736809ac57.tar.bz2
Merge topic 'minor-cleanups'
84fac67 Don't allow include() of export(EXPORT) file at configure time. faedd2b cmTarget: Fix system include annotation propagation. 9eb06d0 add_library: Disallow invalid signatures for INTERFACE_LIBRARY. 10d65d5 cmTarget: Move a variable initialization closer to where it is used. 0f3e8e9 Undefine local preprocessor loop variables. 9ba47ee Genex: Reform error-checking for nullary/unary expressions. fa651c7 cmTarget: Remove some of the INTERFACE_LIBRARY whitelisted properties. 61d138a cmTarget: INTERFACE_LIBRARY is always EXCLUDE_FROM_ALL. 3429541 export: Rename some variables to reflect content type. 7461d67 cmTarget: Enable convenient include dir handling for INTERFACE_LIBRARY. 7fc6e3d cmTarget: Remove dead code. 2af966d Genex: Add EQUAL expression. 2d66380 cmTarget: Use strtol for numeric parsing.
Diffstat (limited to 'Tests/InterfaceLibrary')
-rw-r--r--Tests/InterfaceLibrary/CMakeLists.txt6
-rw-r--r--Tests/InterfaceLibrary/definetestexe.cpp12
-rw-r--r--Tests/InterfaceLibrary/headerdir/CMakeLists.txt8
-rw-r--r--Tests/InterfaceLibrary/headerdir/iface_header.h1
-rw-r--r--Tests/InterfaceLibrary/libsdir/CMakeLists.txt2
5 files changed, 27 insertions, 2 deletions
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 8154ced..b396eb6 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -6,13 +6,15 @@ project(InterfaceLibrary)
add_library(iface_nodepends INTERFACE)
target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE)
+add_subdirectory(headerdir)
+
add_executable(InterfaceLibrary definetestexe.cpp)
-target_link_libraries(InterfaceLibrary iface_nodepends)
+target_link_libraries(InterfaceLibrary iface_nodepends headeriface)
add_subdirectory(libsdir)
add_executable(sharedlibtestexe sharedlibtestexe.cpp)
-target_link_libraries(sharedlibtestexe shared_iface)
+target_link_libraries(sharedlibtestexe shared_iface imported::iface)
add_library(broken EXCLUDE_FROM_ALL broken.cpp)
diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp
index decd37c..e7a10c1 100644
--- a/Tests/InterfaceLibrary/definetestexe.cpp
+++ b/Tests/InterfaceLibrary/definetestexe.cpp
@@ -3,6 +3,18 @@
#error Expected IFACE_DEFINE
#endif
+#include "iface_header.h"
+
+#ifndef IFACE_HEADER_SRCDIR
+#error Expected IFACE_HEADER_SRCDIR
+#endif
+
+#include "iface_header_builddir.h"
+
+#ifndef IFACE_HEADER_BUILDDIR
+#error Expected IFACE_HEADER_BUILDDIR
+#endif
+
int main(int,char**)
{
return 0;
diff --git a/Tests/InterfaceLibrary/headerdir/CMakeLists.txt b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
new file mode 100644
index 0000000..98f521e
--- /dev/null
+++ b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
+
+add_library(headeriface INTERFACE)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/iface_header_builddir.h"
+ "#define IFACE_HEADER_BUILDDIR\n"
+)
diff --git a/Tests/InterfaceLibrary/headerdir/iface_header.h b/Tests/InterfaceLibrary/headerdir/iface_header.h
new file mode 100644
index 0000000..82dd157
--- /dev/null
+++ b/Tests/InterfaceLibrary/headerdir/iface_header.h
@@ -0,0 +1 @@
+#define IFACE_HEADER_SRCDIR
diff --git a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
index 6999646..4e529df 100644
--- a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
@@ -24,3 +24,5 @@ target_compile_definitions(shareddependlib
add_library(shared_iface INTERFACE)
target_link_libraries(shared_iface INTERFACE sharedlib)
+
+add_library(imported::iface INTERFACE IMPORTED GLOBAL)