summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Export
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-08-21 06:55:30 (GMT)
committerBrad King <brad.king@kitware.com>2013-08-26 15:37:00 (GMT)
commitcc8f79670e6c6533a76b80656c87342c0c1696a4 (patch)
treeb2cbe12515525eec33698f2e33e698d3cd745aed /Tests/ExportImport/Export
parentfd4fb9ef040dde7961500e2241b43909a9e6b1a4 (diff)
downloadCMake-cc8f79670e6c6533a76b80656c87342c0c1696a4.zip
CMake-cc8f79670e6c6533a76b80656c87342c0c1696a4.tar.gz
CMake-cc8f79670e6c6533a76b80656c87342c0c1696a4.tar.bz2
try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIES
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt19
-rw-r--r--Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp8
-rw-r--r--Tests/ExportImport/Export/testSharedLibRequiredUser2.h14
3 files changed, 40 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index fb2ca86..1f23b2a 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -227,6 +227,21 @@ install(FILES
DESTINATION include/testSharedLibRequiredUser
)
+cmake_policy(SET CMP0022 NEW)
+add_library(testSharedLibRequiredUser2 SHARED testSharedLibRequiredUser2.cpp)
+generate_export_header(testSharedLibRequiredUser2)
+set_property(TARGET testSharedLibRequiredUser2 APPEND PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
+)
+set_property(TARGET testSharedLibRequiredUser2 PROPERTY LINK_LIBRARIES testSharedLibRequired)
+set_property(TARGET testSharedLibRequiredUser2 PROPERTY INTERFACE_LINK_LIBRARIES testSharedLibRequired)
+install(FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/testSharedLibRequiredUser2.h"
+ "${CMAKE_CURRENT_BINARY_DIR}/testsharedlibrequireduser2_export.h"
+ DESTINATION include/testSharedLibRequiredUser2
+)
+cmake_policy(SET CMP0022 OLD)
+
add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
set_property(TARGET testSharedLibDepends APPEND PROPERTY
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
@@ -298,6 +313,7 @@ install(TARGETS
testLibIncludeRequired6
testSharedLibRequired
testSharedLibRequiredUser
+ testSharedLibRequiredUser2
noIncludesInterface
EXPORT RequiredExp DESTINATION lib
INCLUDES DESTINATION
@@ -398,7 +414,8 @@ add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test.
# Export from build tree.
export(TARGETS testExe1 testLib1 testLib2 testLib3
testExe2libImp testLib3Imp testLib3ImpDep subdirlib
- testSharedLibRequired testSharedLibRequiredUser testSharedLibDepends renamed_on_export
+ testSharedLibRequired testSharedLibRequiredUser testSharedLibRequiredUser2
+ testSharedLibDepends renamed_on_export
cmp0022NEW cmp0022OLD
NAMESPACE bld_
FILE ExportBuildTree.cmake
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp b/Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp
new file mode 100644
index 0000000..d671bf0
--- /dev/null
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp
@@ -0,0 +1,8 @@
+
+#include "testSharedLibRequiredUser2.h"
+
+TestSharedLibRequired TestSharedLibRequiredUser2::foo()
+{
+ TestSharedLibRequired req;
+ return req;
+}
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser2.h b/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
new file mode 100644
index 0000000..a132940
--- /dev/null
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
@@ -0,0 +1,14 @@
+
+#ifndef TESTSHAREDLIBREQUIREDUSER2_H
+#define TESTSHAREDLIBREQUIREDUSER2_H
+
+#include "testsharedlibrequireduser2_export.h"
+
+#include "testSharedLibRequired.h"
+
+struct TESTSHAREDLIBREQUIREDUSER2_EXPORT TestSharedLibRequiredUser2
+{
+ TestSharedLibRequired foo();
+};
+
+#endif