diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-09-23 17:19:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-30 14:27:02 (GMT) |
commit | 955b96629e05bf2ddb6c94fa7a130e2b5b744782 (patch) | |
tree | 4279d02e1feacb66739e028f7aeedabb136f5177 /Tests/ExportImport/Export | |
parent | 6f50a04cc1c4584472f850e06daad7ae20af45c4 (diff) | |
download | CMake-955b96629e05bf2ddb6c94fa7a130e2b5b744782.zip CMake-955b96629e05bf2ddb6c94fa7a130e2b5b744782.tar.gz CMake-955b96629e05bf2ddb6c94fa7a130e2b5b744782.tar.bz2 |
exports: add a test for exporting dependent targets
The test exports two libraries into two separate exports,
and then include()s the generated export files. This must not fail.
Alex
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/ExportImport/Export/testLibDepends.c | 4 | ||||
-rw-r--r-- | Tests/ExportImport/Export/testLibRequired.c | 1 |
3 files changed, 17 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; } |