cmake Tutorial => Strings and Lists
riptutorial.com › cmake › exampleIt's important to know how CMake distinguishes between lists and plain strings. When you write: set (VAR "a b c") you create a string with the value "a b c". But when you write this line without quotes: set (VAR a b c) You create a list of three items instead: "a", "b" and "c". Non-list variables are actually lists too (of a single element).
[CMake] Checking for empty list
cmake.org › pipermail › cmakeNov 25, 2011 · [CMake] Checking for empty list Michael Wild themiwi at gmail.com Fri Nov 25 09:32:29 EST 2011. Previous message: [CMake] Checking for empty list Next message: [CMake] steps to add support for new (D) language into CMake? Messages sorted by:
Initialize empty list - Usage - CMake Discourse
discourse.cmake.org › t › initialize-empty-listOct 25, 2020 · Since a list is represented as a string, an empty list is an empty string: set (mylist "") craig.scott (Craig Scott) October 25, 2020, 9:38pm #3. If you want to be absolutely sure that the variable will evaluate to an empty list (or empty string), use set (mylist ""). The reason is that unsetting a regular variable can unmask a cache variable of the same name.
list — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helpA list in cmake is a ; separated group of strings. To create a list the set command can be used. For example, set (var a b c d e) creates a list with a;b;c;d;e, and set (var "a b c d e") creates a string or a list with one item in it. (Note macro arguments are not variables, and therefore cannot be used in LIST commands.)
list — CMake 3.23.0-rc4 Documentation
https://cmake.org/cmake/help/latest/command/list.htmlIntroduction ¶. The list subcommands APPEND, INSERT, FILTER, PREPEND , POP_BACK, POP_FRONT, REMOVE_AT, REMOVE_ITEM , REMOVE_DUPLICATES, REVERSE and SORT may create new values for the list within the current CMake variable scope. Similar to the set () command, the LIST command creates new variable values in the current scope, even if the list ...
CMake Lists - Jeremi Mucha
https://jeremimucha.com/2021/03/cmake-lists15.03.2021 · But let’s move on before we get too philosophical. CMake takes a different approach. A concrete definition could be formulated as follows: A CMake list is a semicolon-separated sequence of elements. And since everything in CMake is a string, this means that a list is a semicolon-separated sequence of strings, making itself a string.