diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-10-12 23:19:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-12 23:19:32 (GMT) |
commit | 446874a8a1f5db0e552e39e123bd2405b7b9cbe6 (patch) | |
tree | d92879d83eecc9da84c26262f5031b08d74627d1 /Tests | |
parent | 55fce4425f2576bb43da44a2bd3715b7dac9b4cd (diff) | |
parent | 64690f6df043b65b083c258b2c53910508336469 (diff) | |
download | CMake-446874a8a1f5db0e552e39e123bd2405b7b9cbe6.zip CMake-446874a8a1f5db0e552e39e123bd2405b7b9cbe6.tar.gz CMake-446874a8a1f5db0e552e39e123bd2405b7b9cbe6.tar.bz2 |
Merge topic 'export-namelink-only' into release-3.19
64690f6df0 export: Do not fail generation for namelink-only case
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5352
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/export/NamelinkOnlyExport.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/export/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/export/UnknownExport-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/export/UnknownExport-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/export/UnknownExport.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/install/EXPORT-NamelinkOnly.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/install/EXPORT-UnknownExport-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/EXPORT-UnknownExport-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/EXPORT-UnknownExport.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/install/RunCMakeTest.cmake | 2 |
10 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/export/NamelinkOnlyExport.cmake b/Tests/RunCMake/export/NamelinkOnlyExport.cmake new file mode 100644 index 0000000..4bdd180 --- /dev/null +++ b/Tests/RunCMake/export/NamelinkOnlyExport.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) +add_library(foo SHARED empty.cpp) +install(TARGETS foo EXPORT fooExport + RUNTIME DESTINATION bin + LIBRARY + DESTINATION lib + NAMELINK_ONLY +) +export(EXPORT fooExport FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake index 1c74762..95c8d5c 100644 --- a/Tests/RunCMake/export/RunCMakeTest.cmake +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -15,3 +15,5 @@ run_cmake(ForbiddenToExportPropertyWithGenExp) run_cmake(ExportPropertiesUndefined) run_cmake(DependOnNotExport) run_cmake(DependOnDoubleExport) +run_cmake(UnknownExport) +run_cmake(NamelinkOnlyExport) diff --git a/Tests/RunCMake/export/UnknownExport-result.txt b/Tests/RunCMake/export/UnknownExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/UnknownExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/UnknownExport-stderr.txt b/Tests/RunCMake/export/UnknownExport-stderr.txt new file mode 100644 index 0000000..a8f8453 --- /dev/null +++ b/Tests/RunCMake/export/UnknownExport-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UnknownExport\.cmake:[0-9]+ \(export\): + export Export set "fooExport" not found\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/UnknownExport.cmake b/Tests/RunCMake/export/UnknownExport.cmake new file mode 100644 index 0000000..bf82d1f --- /dev/null +++ b/Tests/RunCMake/export/UnknownExport.cmake @@ -0,0 +1,2 @@ +enable_language(CXX) +export(EXPORT fooExport FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") diff --git a/Tests/RunCMake/install/EXPORT-NamelinkOnly.cmake b/Tests/RunCMake/install/EXPORT-NamelinkOnly.cmake new file mode 100644 index 0000000..1c310d1 --- /dev/null +++ b/Tests/RunCMake/install/EXPORT-NamelinkOnly.cmake @@ -0,0 +1,12 @@ +enable_language(C) +add_library(foo SHARED empty.c) +install(TARGETS foo EXPORT fooExport + RUNTIME DESTINATION bin + LIBRARY + DESTINATION lib + NAMELINK_ONLY +) +install(EXPORT fooExport + DESTINATION "lib/cmake/" + FILE "foo.cmake" +) diff --git a/Tests/RunCMake/install/EXPORT-UnknownExport-result.txt b/Tests/RunCMake/install/EXPORT-UnknownExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/EXPORT-UnknownExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/EXPORT-UnknownExport-stderr.txt b/Tests/RunCMake/install/EXPORT-UnknownExport-stderr.txt new file mode 100644 index 0000000..bd49fa2 --- /dev/null +++ b/Tests/RunCMake/install/EXPORT-UnknownExport-stderr.txt @@ -0,0 +1 @@ +CMake Error: INSTALL\(EXPORT\) given unknown export "fooExport" diff --git a/Tests/RunCMake/install/EXPORT-UnknownExport.cmake b/Tests/RunCMake/install/EXPORT-UnknownExport.cmake new file mode 100644 index 0000000..2dbba4e --- /dev/null +++ b/Tests/RunCMake/install/EXPORT-UnknownExport.cmake @@ -0,0 +1,5 @@ +enable_language(C) +install(EXPORT fooExport + DESTINATION "lib/cmake/" + FILE "foo.cmake" +) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 3573fbd..5aab88c 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -76,6 +76,8 @@ run_cmake(DIRECTORY-DESTINATION-bad) run_cmake(FILES-DESTINATION-bad) run_cmake(TARGETS-DESTINATION-bad) run_cmake(EXPORT-OldIFace) +run_cmake(EXPORT-UnknownExport) +run_cmake(EXPORT-NamelinkOnly) run_cmake(CMP0062-OLD) run_cmake(CMP0062-NEW) run_cmake(CMP0062-WARN) |