cmake-file-api(7) — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpWhen CMake generates the buildsystem in that build tree it will read the query files and write reply files for the client to read. The file-based API uses a <build>/.cmake/api/ directory at the top of a build tree. The API is versioned to support changes to the layout of files within the API directory.
file — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpfile (READ <filename> <variable> [OFFSET <offset>] [LIMIT <max-in>] [HEX]) Read content from a file called <filename> and store it in a <variable>. Optionally start from the given <offset> and read at most <max-in> bytes. The HEX option causes data to be converted to a hexadecimal representation (useful for binary data).
[CMake] reading in a file and splitting by line
cmake.org › pipermail › cmakeMay 23, 2007 · This "works" with just cmake: FILE(READ "${file}" contents) # Convert file contents into a CMake list (where each element in the list # is one line of the file) # STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}") STRING(REGEX REPLACE " " ";" contents "${contents}") The reason I say "works" (in quotes) is that there are two caveats wherein it does not work: (1) It puts each line of the ...