summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-23 16:07:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-24 12:02:49 (GMT)
commitcbe7e8fae48b3663e784bb37d5f66bf8b3eb0546 (patch)
tree910046c109660f4533f0ec6ceec1de485e3032d2 /Tests/RunCMake
parente73d1ad003c50730a8141db757462574c0c2dddc (diff)
downloadCMake-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/RunCMake')
-rw-r--r--Tests/RunCMake/export/AppendExport-result.txt1
-rw-r--r--Tests/RunCMake/export/AppendExport-stderr.txt4
-rw-r--r--Tests/RunCMake/export/AppendExport.cmake8
-rw-r--r--Tests/RunCMake/export/NoExportSet-result.txt1
-rw-r--r--Tests/RunCMake/export/NoExportSet-stderr.txt4
-rw-r--r--Tests/RunCMake/export/NoExportSet.cmake2
-rw-r--r--Tests/RunCMake/export/OldIface-result.txt1
-rw-r--r--Tests/RunCMake/export/OldIface-stderr.txt5
-rw-r--r--Tests/RunCMake/export/OldIface.cmake10
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake3
10 files changed, 39 insertions, 0 deletions
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)