You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmake/Tests/RunCMake/foreach/foreach-all-test.cmake

68 lines
1.7 KiB

message(STATUS "foreach(RANGE):")
list(APPEND CMAKE_MESSAGE_INDENT " ")
message(STATUS "[0..1]/1")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i RANGE 1)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "[1..1]/1")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i RANGE 1 1)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "[0..10]/2")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i RANGE 0 10 2)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "[-10..0]/3")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i RANGE -10 0 3)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "[0..-10]/-5")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i RANGE 0 -10 -5)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "foreach(IN ITEMS):")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i IN ITEMS one two three)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "foreach(IN LISTS):")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
list(APPEND count satu dua tiga)
foreach(i IN LISTS count)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "foreach(IN LISTS and ITEMS):")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i IN LISTS count ITEMS one two three)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(STATUS "foreach(IN ITEMS and LISTS):")
list(APPEND CMAKE_MESSAGE_INDENT " < ")
foreach(i IN ITEMS one two three LISTS count)
message(STATUS ${i})
endforeach()
list(POP_BACK CMAKE_MESSAGE_INDENT)