[CMAKE] Fix invalid usage of list()

list() functions expects numerical indices for modification operations
and silently converts everything else to a number (old behaviour).

CMake 3.21 now checks this and throws a warning
This commit is contained in:
Victor Perevertkin 2021-09-13 20:13:40 +03:00
parent 8e1fa03456
commit 4e389a992d
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -287,10 +287,10 @@ function(add_cd_file)
endif()
# do we add it to all CDs?
list(FIND _CD_FOR all __cd)
list(FIND _CD_FOR "all" __cd)
if(NOT __cd EQUAL -1)
list(REMOVE_AT _CD_FOR __cd)
list(INSERT _CD_FOR __cd "bootcd;livecd;regtest")
list(REMOVE_ITEM _CD_FOR "all")
list(APPEND _CD_FOR "bootcd;livecd;regtest")
endif()
# do we add it to bootcd?