diff options
author | Brad King <brad.king@kitware.com> | 2013-07-24 15:02:19 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-07-24 15:02:19 (GMT) |
commit | 571d050415dce07fe2ea0062eb300af36ca2d5e1 (patch) | |
tree | b973a42093a52ce53de29bcc3144a4cc4481807c /Tests | |
parent | 6077847edc57f8104ba0c1edce16ce28178f899b (diff) | |
parent | 10a069b50468fc97737f5144a6d7790e0d972a91 (diff) | |
download | CMake-571d050415dce07fe2ea0062eb300af36ca2d5e1.zip CMake-571d050415dce07fe2ea0062eb300af36ca2d5e1.tar.gz CMake-571d050415dce07fe2ea0062eb300af36ca2d5e1.tar.bz2 |
Merge topic 'fix-mapped-config-genex'
10a069b Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/GeneratorExpression/CMakeLists.txt | 30 | ||||
-rw-r--r-- | Tests/GeneratorExpression/check-part3.cmake | 13 |
2 files changed, 43 insertions, 0 deletions
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index ab936ca..7ac6ede 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -138,6 +138,31 @@ add_custom_target(check-part2 ALL VERBATIM ) +add_library(imported1 SHARED IMPORTED) +set_property(TARGET imported1 PROPERTY IMPORTED_LOCATION_RELEASE release_loc) +set_property(TARGET imported1 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) +set_property(TARGET imported1 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG) +set_property(TARGET imported1 PROPERTY INTERFACE_INCLUDE_DIRECTORIES /imported1/include) + +add_library(imported2 SHARED IMPORTED) +set_property(TARGET imported2 PROPERTY IMPORTED_LOCATION_RELEASE release_loc) +set_property(TARGET imported2 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) +set_property(TARGET imported2 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG) +set_property(TARGET imported2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES /imported2/include) + +add_library(imported3 SHARED IMPORTED) +set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_RELEASE release_loc) +set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) +# Both Debug and Release should not be true when this is evaluated. +set_property(TARGET imported3 APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:DEBUG>:$<TARGET_PROPERTY:imported1,INTERFACE_INCLUDE_DIRECTORIES>>) +set_property(TARGET imported3 APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) + +add_library(imported4 SHARED IMPORTED) +set_property(TARGET imported4 APPEND PROPERTY + INCLUDE_DIRECTORIES $<TARGET_PROPERTY:imported3,INTERFACE_INCLUDE_DIRECTORIES>) + add_custom_target(check-part3 ALL COMMAND ${CMAKE_COMMAND} -Dtest_version_greater_1=$<VERSION_GREATER:1.0,1.1.1> @@ -146,6 +171,11 @@ add_custom_target(check-part3 ALL -Dtest_version_less_2=$<VERSION_LESS:1.0,1.1.1> -Dtest_version_equal_1=$<VERSION_EQUAL:1.0.1,1.1> -Dtest_version_equal_2=$<VERSION_EQUAL:1.1,1.1> + -Dconfig=$<CONFIGURATION> + -Dtest_imported_debug=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES> + -Dtest_imported_release=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES> + -Dtest_imported_relwithdebinfo=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES> + -Dtest_imported_minsizerel=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" VERBATIM diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 70d6571..af290a5 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -7,3 +7,16 @@ check(test_version_less_1 "0") check(test_version_less_2 "1") check(test_version_equal_1 "0") check(test_version_equal_2 "1") + +foreach(c debug release relwithdebinfo minsizerel) + if(config AND NOT config STREQUAL NoConfig) + if(NOT "${test_imported_${c}}" MATCHES "^;/imported2/include$" + AND NOT "${test_imported_${c}}" MATCHES "^/imported1/include;$") + message(SEND_ERROR "test_imported_${c} is not correct: ${test_imported_${c}}") + endif() + else() + if(NOT "${test_imported_${c}}" MATCHES "^;$") + message(SEND_ERROR "test_imported_${c} is not an empty list: ${test_imported_${c}}") + endif() + endif() +endforeach() |