[Cmake] Extracting values from files

Stefan Schmidt Stefan . Schmidt at sophia . inria . fr
Wed, 25 Jun 2003 10:42:50 +0200


Hi John,

> LibImage = 1 0 0 1
>
> and I want CMake to open the file and extract the version I should be
> linking against for each of the libs in question. Are there any useful
> functions available for doing that. Reading KVP's (Key value pairs) or
> rudimentary parsing.
>
> I'm wondering if the file in question was stored as a cmake cache file I
> could LOAD_CACHE(...) and get the values as variables directly.

If you could have the file have CMake syntax (using the SET command), you can 
read it in using the INCLUDE() command in your CMakeLists.txt. Thats what I 
did to get some external information into CMake.

Regards,
Stefan