summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-11-20 10:06:29 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-08 00:07:27 (GMT)
commitce0c303d62941d2b10098b1ec00de3ced8556919 (patch)
tree46e32f12cb91c4172aebf3fe7004640382644408 /Tests
parent435c912848b08333e03c74439f725c9b96890d80 (diff)
downloadCMake-ce0c303d62941d2b10098b1ec00de3ced8556919.zip
CMake-ce0c303d62941d2b10098b1ec00de3ced8556919.tar.gz
CMake-ce0c303d62941d2b10098b1ec00de3ced8556919.tar.bz2
install: Teach EXPORT option to handle INTERFACE_LIBRARY targets
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/Interface/CMakeLists.txt20
-rw-r--r--Tests/ExportImport/Import/Interface/CMakeLists.txt13
2 files changed, 33 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index 01e89ef..fc9c0c7 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -27,3 +27,23 @@ export(TARGETS sharediface sharedlib headeronly
NAMESPACE bld_
FILE ../ExportInterfaceBuildTree.cmake
)
+
+install(TARGETS headeronly sharediface sharedlib
+ EXPORT expInterface
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib NAMELINK_SKIP
+ ARCHIVE DESTINATION lib
+ FRAMEWORK DESTINATION Frameworks
+ BUNDLE DESTINATION Applications
+)
+install(FILES
+ headeronly/headeronly.h
+ DESTINATION include/headeronly
+)
+install(FILES
+ sharedlib/sharedlib.h
+ "${CMAKE_CURRENT_BINARY_DIR}/sharedlib_export.h"
+ DESTINATION include/sharedlib
+)
+
+install(EXPORT expInterface NAMESPACE exp_ DESTINATION lib/exp)
diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt
index c8c8401..c7bd13e 100644
--- a/Tests/ExportImport/Import/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt
@@ -2,6 +2,9 @@
# Import targets from the exported build tree.
include(${Import_BINARY_DIR}/../Export/ExportInterfaceBuildTree.cmake)
+# Import targets from the exported install tree.
+include(${CMAKE_INSTALL_PREFIX}/lib/exp/expInterface.cmake)
+
add_library(define_iface INTERFACE)
set_property(TARGET define_iface PROPERTY
INTERFACE_COMPILE_DEFINITIONS DEFINE_IFACE_DEFINE)
@@ -40,3 +43,13 @@ macro(do_try_compile prefix)
endmacro()
do_try_compile(bld_)
+
+add_executable(headeronlytest_exp headeronlytest.cpp)
+target_link_libraries(headeronlytest_exp exp_headeronly)
+
+set_property(TARGET exp_sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface)
+
+add_executable(interfacetest_exp interfacetest.cpp)
+target_link_libraries(interfacetest_exp exp_sharediface)
+
+do_try_compile(exp_)