summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-21 21:47:34 (GMT)
committerBrad King <brad.king@kitware.com>2014-02-21 22:05:26 (GMT)
commit6e89c8a5f1d5aa9bffa95be2b1add8d2c4e55026 (patch)
treecc732c0ab42e7435005ac0c51f71b765f28b828e /Tests
parentf11f7b34a8e77c3bd68578f00b57e0884cb0d872 (diff)
downloadCMake-6e89c8a5f1d5aa9bffa95be2b1add8d2c4e55026.zip
CMake-6e89c8a5f1d5aa9bffa95be2b1add8d2c4e55026.tar.gz
CMake-6e89c8a5f1d5aa9bffa95be2b1add8d2c4e55026.tar.bz2
install: Support generator expressions in FILES and PROGRAMS mode
Teach the install(FILES) and install(PROGRAMS) commands to evaluate generator expressions in the list of files. Extend the ExportImport test to cover installation cases involving generator expressions.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt16
-rw-r--r--Tests/ExportImport/Export/testLib1file1.txt1
-rw-r--r--Tests/ExportImport/Export/testLib1file2.txt1
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt6
-rw-r--r--Tests/ExportImport/Import/A/check_testLib1_genex.cmake11
5 files changed, 35 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 0e2828e..febdfe6 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -23,6 +23,22 @@ add_library(testLib1 STATIC testLib1.c)
add_library(testLib2 STATIC testLib2.c)
target_link_libraries(testLib2 testLib1)
+# Test install(FILES) with generator expressions referencing testLib1.
+add_custom_command(TARGET testLib1 POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:testLib1>
+ $<TARGET_FILE:testLib1>.genex
+ )
+install(FILES $<TARGET_FILE:testLib1>.genex
+ DESTINATION lib
+ )
+set_property(TARGET testLib1 PROPERTY MY_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/testLib1file1.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/testLib1file2.txt
+ )
+install(FILES $<TARGET_PROPERTY:testLib1,MY_FILES>
+ DESTINATION doc
+ )
+
# Test library with empty link interface. Link it to an implementation
# dependency that itself links to dependencies publicly.
add_library(testLib3ImpDep SHARED testLib3ImpDep.c)
diff --git a/Tests/ExportImport/Export/testLib1file1.txt b/Tests/ExportImport/Export/testLib1file1.txt
new file mode 100644
index 0000000..73601df
--- /dev/null
+++ b/Tests/ExportImport/Export/testLib1file1.txt
@@ -0,0 +1 @@
+testLib1file1
diff --git a/Tests/ExportImport/Export/testLib1file2.txt b/Tests/ExportImport/Export/testLib1file2.txt
new file mode 100644
index 0000000..4874ed1
--- /dev/null
+++ b/Tests/ExportImport/Export/testLib1file2.txt
@@ -0,0 +1 @@
+testLib1file2
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index ebe4af2..eb0bbf8 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -68,6 +68,12 @@ target_link_libraries(imp_testExe1b
bld_testLibCycleA
)
+add_custom_target(check_testLib1_genex ALL
+ COMMAND ${CMAKE_COMMAND} -DtestLib1=$<TARGET_FILE:exp_testLib1>
+ -Dprefix=${CMAKE_INSTALL_PREFIX}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check_testLib1_genex.cmake
+ )
+
add_executable(cmp0022OLD_test cmp0022OLD_test_vs6_1.cpp)
target_link_libraries(cmp0022OLD_test bld_cmp0022OLD)
add_executable(cmp0022NEW_test cmp0022NEW_test_vs6_1.cpp)
diff --git a/Tests/ExportImport/Import/A/check_testLib1_genex.cmake b/Tests/ExportImport/Import/A/check_testLib1_genex.cmake
new file mode 100644
index 0000000..7c02652
--- /dev/null
+++ b/Tests/ExportImport/Import/A/check_testLib1_genex.cmake
@@ -0,0 +1,11 @@
+foreach(f
+ "${testLib1}.genex"
+ "${prefix}/doc/testLib1file1.txt"
+ "${prefix}/doc/testLib1file2.txt"
+ )
+ if(EXISTS "${f}")
+ message(STATUS "'${f}' exists!")
+ else()
+ message(FATAL_ERROR "Missing file:\n ${f}")
+ endif()
+endforeach()