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).
file — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpfile (STRINGS myfile.txt myfile) stores a list in the variable myfile in which each item is a line from the input file. file (<HASH> <filename> <variable>) Compute a cryptographic hash of the content of <filename> and store it in a <variable>. The supported <HASH> algorithm names are those listed by the string (<HASH>) command.
string — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpTransform a <string> like configure_file () transforms a file. string (MAKE_C_IDENTIFIER <string> <output_variable>) Convert each non-alphanumeric character in the input <string> to an underscore and store the result in the <output_variable>. If the first character of the <string> is a digit, an underscore will also be prepended to the result.
Writing CMakeLists Files — Mastering CMake
cmake.org › cmake › helpAll CMake variables are stored internally as strings although they may sometimes be interpreted as other types. Use the set command to set variable values. In its simplest form, the first argument to set is the name of the variable and the rest of the arguments are the values.