summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0022
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-04 14:47:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-07-08 20:39:57 (GMT)
commit574fec97fd011ea2899abdd05d97ea66f0faa063 (patch)
tree82de4bacc4771ff4f6ce085cccec04d99b28d35b /Tests/RunCMake/CMP0022
parentd0a76ea07cfc2a73900a9539e940e1e60dbba120 (diff)
downloadCMake-574fec97fd011ea2899abdd05d97ea66f0faa063.zip
CMake-574fec97fd011ea2899abdd05d97ea66f0faa063.tar.gz
CMake-574fec97fd011ea2899abdd05d97ea66f0faa063.tar.bz2
Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
This property is generated only for targets which have recorded policy CMP0022 as NEW, and a compatibility mode is added to additionally export the old interfaces in that case too. If the old interfaces are not exported, the generated export files require CMake 2.8.12. Because the unit tests use a version which is not yet called 2.8.12, temporarily require a lower version.
Diffstat (limited to 'Tests/RunCMake/CMP0022')
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-export-result.txt1
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-export.cmake11
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt1
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-install-export.cmake12
-rw-r--r--Tests/RunCMake/CMP0022/RunCMakeTest.cmake2
7 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-result.txt b/Tests/RunCMake/CMP0022/CMP0022-export-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt
new file mode 100644
index 0000000..6c29057
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CMP0022-export.cmake:11 \(export\):
+ Target "cmp0022NEW" has policy CMP0022 enabled, but also has old-style
+ INTERFACE_LINK_LIBRARIES properties populated, but it was exported without
+ the EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-export.cmake
new file mode 100644
index 0000000..06147f3
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export.cmake
@@ -0,0 +1,11 @@
+
+project(cmp0022NEW)
+
+cmake_policy(SET CMP0022 NEW)
+
+add_library(cmp0022NEW SHARED empty_vs6_1.cpp)
+add_library(testLib SHARED empty_vs6_2.cpp)
+
+set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib)
+
+export(TARGETS cmp0022NEW testLib FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NEW.cmake")
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt b/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt
new file mode 100644
index 0000000..3425e8e
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error in CMakeLists.txt:
+ Target "cmp0022NEW" has policy CMP0022 enabled, but also has old-style
+ INTERFACE_LINK_LIBRARIES properties populated, but it was exported without
+ the EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
new file mode 100644
index 0000000..171febe
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
@@ -0,0 +1,12 @@
+
+project(cmp0022NEW)
+
+cmake_policy(SET CMP0022 NEW)
+
+add_library(cmp0022NEW SHARED empty_vs6_1.cpp)
+add_library(testLib SHARED empty_vs6_2.cpp)
+
+set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib)
+
+install(TARGETS cmp0022NEW testLib EXPORT exp DESTINATION lib)
+install(EXPORT exp FILE expTargets.cmake DESTINATION lib/cmake/exp)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
index 2e74f17..616d664 100644
--- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -3,3 +3,5 @@ include(RunCMake)
run_cmake(CMP0022-WARN)
run_cmake(CMP0022-WARN-static)
run_cmake(CMP0022-NOWARN-static)
+run_cmake(CMP0022-export)
+run_cmake(CMP0022-install-export)