summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake
blob: 4ae1c0dd70782676766e1ef490afaeb5ce4fe182 (plain)
1
2
3
4
5
6
7
8
9
10
11
# Test that target_compile_definitions works on UNKNOWN IMPORTED target
add_library(imported UNKNOWN IMPORTED)
target_compile_definitions(imported INTERFACE FOO)

get_target_property(IMPORTED_INTERFACE_CDS imported INTERFACE_COMPILE_DEFINITIONS)

if (NOT FOO IN_LIST IMPORTED_INTERFACE_CDS)
  message(
    FATAL_ERROR "FOO should be in INTERFACE_COMPILE_DEFINITIONS.\n"
    "Actual INTERFACE_COMPILE_DEFINITIONS: " ${IMPORTED_INTERFACE_CDS})
endif()