summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GenEx-LIST/LENGTH.cmake.in
blob: 0840e1111685c97b0f476c7b84d94840a4ab0fef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)

set(listvar a b c d)

list(LENGTH listvar reference)
set (output "$<LIST:LENGTH,a;b;c;d>")
if (NOT output EQUAL reference)
  list (APPEND errors "returns bad value: ${output}")
endif()

set(listvar "")

list(LENGTH listvar reference)
set (output "$<LIST:LENGTH,>")
if (NOT output EQUAL reference)
  list (APPEND errors "returns bad value: ${output}")
endif()

unset(listvar)

list(LENGTH listvar reference)
set (output "$<LIST:LENGTH,>")
if (NOT output EQUAL reference)
  list (APPEND errors "returns bad value: ${output}")
endif()


check_errors("LIST:LENGTH..." ${errors})