cmake/Tests/RunCMake/list/PREPEND.cmake
2019-11-11 23:01:05 +01:00

34 lines
627 B
CMake

list(PREPEND test)
if(test)
message(FATAL_ERROR "failed")
endif()
list(PREPEND test satu)
if(NOT test STREQUAL "satu")
message(FATAL_ERROR "failed")
endif()
list(PREPEND test dua)
if(NOT test STREQUAL "dua;satu")
message(FATAL_ERROR "failed")
endif()
list(PREPEND test tiga)
if(NOT test STREQUAL "tiga;dua;satu")
message(FATAL_ERROR "failed")
endif()
# Scope test
function(foo)
list(PREPEND test empat)
if(NOT test STREQUAL "empat;tiga;dua;satu")
message(FATAL_ERROR "failed")
endif()
endfunction()
foo()
if(NOT test STREQUAL "tiga;dua;satu")
message(FATAL_ERROR "failed")
endif()