diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-12-23 16:07:26 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-12-24 12:02:49 (GMT) |
commit | cbe7e8fae48b3663e784bb37d5f66bf8b3eb0546 (patch) | |
tree | 910046c109660f4533f0ec6ceec1de485e3032d2 /Tests | |
parent | e73d1ad003c50730a8141db757462574c0c2dddc (diff) | |
download | CMake-cbe7e8fae48b3663e784bb37d5f66bf8b3eb0546.zip CMake-cbe7e8fae48b3663e784bb37d5f66bf8b3eb0546.tar.gz CMake-cbe7e8fae48b3663e784bb37d5f66bf8b3eb0546.tar.bz2 |
export: Implement EXPORT subcommand (#9822)
Teach the export command to handle export sets defined by invocations
of install(TARGETS ... EXPORT foo). This makes maintenance of targets
exported to both the build tree and install tree trivial.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ExportImport/Export/Interface/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/RunCMake/export/AppendExport-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/export/AppendExport-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/export/AppendExport.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/export/NoExportSet-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/export/NoExportSet-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/export/NoExportSet.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/export/OldIface-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/export/OldIface-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/export/OldIface.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/export/RunCMakeTest.cmake | 3 |
11 files changed, 44 insertions, 5 deletions
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index b713262..f400f13 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -23,11 +23,6 @@ set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_ add_library(sharediface INTERFACE) target_link_libraries(sharediface INTERFACE sharedlib) -export(TARGETS sharediface sharedlib headeronly - NAMESPACE bld:: - FILE ../ExportInterfaceBuildTree.cmake -) - install(TARGETS headeronly sharediface sharedlib EXPORT expInterface RUNTIME DESTINATION bin @@ -47,3 +42,8 @@ install(FILES ) install(EXPORT expInterface NAMESPACE exp:: DESTINATION lib/exp) + +export(EXPORT expInterface + NAMESPACE bld:: + FILE ../ExportInterfaceBuildTree.cmake +) diff --git a/Tests/RunCMake/export/AppendExport-result.txt b/Tests/RunCMake/export/AppendExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/AppendExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/AppendExport-stderr.txt b/Tests/RunCMake/export/AppendExport-stderr.txt new file mode 100644 index 0000000..6e385d4 --- /dev/null +++ b/Tests/RunCMake/export/AppendExport-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at AppendExport.cmake:8 \(export\): + export EXPORT signature does not recognise the APPEND option. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/AppendExport.cmake b/Tests/RunCMake/export/AppendExport.cmake new file mode 100644 index 0000000..f36010b --- /dev/null +++ b/Tests/RunCMake/export/AppendExport.cmake @@ -0,0 +1,8 @@ +add_library(foo empty.cpp) +export(TARGETS foo FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") +install(TARGETS foo EXPORT fooExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +export(EXPORT fooExport APPEND FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") diff --git a/Tests/RunCMake/export/NoExportSet-result.txt b/Tests/RunCMake/export/NoExportSet-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/NoExportSet-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/NoExportSet-stderr.txt b/Tests/RunCMake/export/NoExportSet-stderr.txt new file mode 100644 index 0000000..9d27805 --- /dev/null +++ b/Tests/RunCMake/export/NoExportSet-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoExportSet.cmake:2 \(export\): + export Export set "fooExport" not found. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/NoExportSet.cmake b/Tests/RunCMake/export/NoExportSet.cmake new file mode 100644 index 0000000..72390e8 --- /dev/null +++ b/Tests/RunCMake/export/NoExportSet.cmake @@ -0,0 +1,2 @@ + +export(EXPORT fooExport) diff --git a/Tests/RunCMake/export/OldIface-result.txt b/Tests/RunCMake/export/OldIface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/OldIface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/OldIface-stderr.txt b/Tests/RunCMake/export/OldIface-stderr.txt new file mode 100644 index 0000000..afb4ae3 --- /dev/null +++ b/Tests/RunCMake/export/OldIface-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at OldIface.cmake:8 \(export\): + export EXPORT signature does not recognise the + EXPORT_LINK_INTERFACE_LIBRARIES option. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/OldIface.cmake b/Tests/RunCMake/export/OldIface.cmake new file mode 100644 index 0000000..5fb8e25 --- /dev/null +++ b/Tests/RunCMake/export/OldIface.cmake @@ -0,0 +1,10 @@ +add_library(foo empty.cpp) +export(TARGETS foo FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") +install(TARGETS foo EXPORT fooExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +export(EXPORT fooExport + EXPORT_LINK_INTERFACE_LIBRARIES +) diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake index b8d3f27..4b04f18 100644 --- a/Tests/RunCMake/export/RunCMakeTest.cmake +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -1,3 +1,6 @@ include(RunCMake) run_cmake(TargetNotFound) +run_cmake(AppendExport) +run_cmake(OldIface) +run_cmake(NoExportSet) |