summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/get_property/target_properties.cmake
blob: 9ff833a678872fdf2e25979115d2228e179ec2aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function (check_target_property target prop)
  get_target_property(gtp_val "${target}" "${prop}")
  get_property(gp_val
    TARGET "${target}"
    PROPERTY "${prop}")

  message("get_target_property: -->${gtp_val}<--")
  message("get_property: -->${gp_val}<--")
endfunction ()

add_custom_target(tgt)
set_target_properties(tgt PROPERTIES empty "" custom value)

check_target_property(tgt empty)
check_target_property(tgt custom)
check_target_property(tgt noexist)
check_target_property(tgt SOURCE_DIR)
check_target_property(tgt BINARY_DIR)