diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-27 08:43:44 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-01-27 08:59:26 (GMT) |
commit | 34d1ade048a87953c089d730f0126eecb6685968 (patch) | |
tree | f9d3ac9c7f5829ef8e1d881f8ab80583243f9644 /Tests | |
parent | 3a1719793fa4eb4024e2e36e17196832551d469c (diff) | |
download | CMake-34d1ade048a87953c089d730f0126eecb6685968.zip CMake-34d1ade048a87953c089d730f0126eecb6685968.tar.gz CMake-34d1ade048a87953c089d730f0126eecb6685968.tar.bz2 |
Add the INSTALL_PREFIX genex.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/GeneratorExpression/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/GeneratorExpression/check-part2.cmake | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index eecfd6a..cfcd9fa 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -113,9 +113,16 @@ macro(add_include_lib _libName) add_library(${_libName} "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_libName}") set_property(TARGET ${_libName} APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/${_libName}") + INTERFACE_INCLUDE_DIRECTORIES + "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${_libName}>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/${_libName}>" + ) if (NOT "${ARGV1}" STREQUAL "NO_HEADER") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" "// no content\n") + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" + DESTINATION include/${_libName} + ) endif() endmacro() @@ -129,6 +136,10 @@ add_include_lib(testLibIncludeRequired3 NO_HEADER) # but we are testing that the INSTALL_INTERFACE causes it not to be used # at build time. file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired3/testLibIncludeRequired4.h" "#error Should not be included\n") +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired3/testLibIncludeRequired4.h" + DESTINATION include/testLibIncludeRequired3 +) add_include_lib(testLibIncludeRequired4) add_include_lib(testLibIncludeRequired5 NO_HEADER) # Generate testLibIncludeRequired6 in the testLibIncludeRequired5 directory @@ -139,6 +150,10 @@ add_include_lib(testLibIncludeRequired5 NO_HEADER) # the Import side of this unit test, the '6' include from the '5' directory # will not be used because it is in the BUILD_INTERFACE only. file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired5/testLibIncludeRequired6.h" "#error Should not be included\n") +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired5/testLibIncludeRequired6.h" + DESTINATION include/testLibIncludeRequired5 +) add_include_lib(testLibIncludeRequired6) set_property(TARGET testLibRequired APPEND PROPERTY diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index ecbbedf..a40a541 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -89,6 +89,7 @@ add_custom_target(check-part2 ALL -Dtest_install_interface=$<INSTALL_INTERFACE:install> -Dtest_target_name_1=$<TARGET_NAME:tgt,ok> -Dtest_target_name_2=$<TARGET_NAME:tgt:ok> + -Dtest_install_prefix=$<INSTALL_PREFIX> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 2)" VERBATIM diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake index 8855a97..0b50204 100644 --- a/Tests/GeneratorExpression/check-part2.cmake +++ b/Tests/GeneratorExpression/check-part2.cmake @@ -26,3 +26,4 @@ check(test_build_interface "build") check(test_install_interface "") check(test_target_name_1 "tgt,ok") check(test_target_name_2 "tgt:ok") +check(test_install_prefix "") |