summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-10-01 18:05:35 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-10-01 18:05:35 (GMT)
commit49c7b649f958d34e06023a85af705122124328f5 (patch)
treeda779fbe7ff05fd344c241fb4f863cbc27f6efce /Tests
parent7dce31f3d03e2202ad54d8b6eb8ab00bce8bbe00 (diff)
parent80112da54e1aa8e64f73a2a5a6a4f73431ac6764 (diff)
downloadCMake-49c7b649f958d34e06023a85af705122124328f5.zip
CMake-49c7b649f958d34e06023a85af705122124328f5.tar.gz
CMake-49c7b649f958d34e06023a85af705122124328f5.tar.bz2
Merge topic 'export-sets'
80112da Merge topic 'AutomocUseTargetProperties' into export-sets 955b966 exports: add a test for exporting dependent targets 6f50a04 exports: define a CMAKE_FIND_PACKAGE_NAME var set by find_package() 0cfd055 exports: move the handling of missing targets into subclasses 190f2c8 exports: fix build with MSVC6 8b5f448 exports: first try at error handling if a target is missing 87f4c01 exports: accept a missing target if it is exported exactly once 999061a exports: store pointers to all installations of each export set 64b3a6c exports: cmGlobalGenerator::ExportSets destructor will clear it 81cdab5 exports: Hold an ExportSet pointer in cm*Export*Generator 5c898fb exports: Add cmExportSetMap class d13ec1a exports: Create class cmExportSet 4e2347c exports: Rename cmGlobalGenerator::AddTargetToExport{s,} e846e70 exports: Remove cmTargetExport constructor 81c66c8 exports: Move cmTargetExport to a dedicated header file ae4ab62 find_package: add support for a <package>_NOT_FOUND_MESSAGE variable ...
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Export/testLibDepends.c4
-rw-r--r--Tests/ExportImport/Export/testLibRequired.c1
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt4
4 files changed, 21 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index f118c30..e19ab88 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -87,6 +87,18 @@ target_link_libraries(testLibCycleA testLibCycleB)
target_link_libraries(testLibCycleB testLibCycleA)
set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
+# Test exporting dependent libraries into different exports
+add_library(testLibRequired testLibRequired.c)
+add_library(testLibDepends testLibDepends.c)
+target_link_libraries(testLibDepends testLibRequired)
+
+install(TARGETS testLibRequired EXPORT RequiredExp DESTINATION lib )
+install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredConfig.cmake DESTINATION lib/cmake/testLibRequired)
+
+install(TARGETS testLibDepends EXPORT DependsExp DESTINATION lib )
+install(EXPORT DependsExp FILE testLibDependsConfig.cmake DESTINATION lib/cmake/testLibDepends)
+
+
# Install and export from install tree.
install(
TARGETS
diff --git a/Tests/ExportImport/Export/testLibDepends.c b/Tests/ExportImport/Export/testLibDepends.c
new file mode 100644
index 0000000..2849b33
--- /dev/null
+++ b/Tests/ExportImport/Export/testLibDepends.c
@@ -0,0 +1,4 @@
+
+extern int testLibRequired(void);
+
+int testLibDepends(void) { return testLibRequired(); }
diff --git a/Tests/ExportImport/Export/testLibRequired.c b/Tests/ExportImport/Export/testLibRequired.c
new file mode 100644
index 0000000..e126d44
--- /dev/null
+++ b/Tests/ExportImport/Export/testLibRequired.c
@@ -0,0 +1 @@
+int testLibRequired(void) { return 0; }
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 650af6a..8841792 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -4,6 +4,10 @@ include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake)
# Import targets from the exported install tree.
include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake)
+# Import two exports, where the Depends one depends on an exported target from the Required one:
+include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibRequired/testLibRequiredConfig.cmake)
+include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibDepends/testLibDependsConfig.cmake)
+
# Try referencing an executable imported from the install tree.
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/exp_generated.c