https://github.com/Kitware/CMake
Raw File
Tip revision: 78ae759e01a736d212c97d4ecc00215648513329 authored by Brad King on 04 March 2022, 15:52:43 UTC
CMake 3.21.6
Tip revision: 78ae759
WhileTest.cmake.in
set(NUMBERS "")
set(COUNT 0)

while(COUNT LESS 200)
    string(APPEND NUMBERS " ${COUNT}")
    set(COUNT "2${COUNT}")

    set(NCOUNT 3)
    while(NCOUNT LESS 31)
        string(APPEND NUMBERS " ${NCOUNT}")
        string(APPEND NCOUNT "0")
    endwhile()
endwhile()

if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30")
    message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'")
endif()
back to top