[Cmake] Extracting values from files

John Biddiscombe john . biddiscombe at mirada-solutions . com
Tue, 24 Jun 2003 17:13:01 +0100


On the subject of version information

suppose I have a simple text file which says

Project MyTest
LibCore =3D 1 0 0 1
LibMath =3D 1 0 0 2
LibImage =3D 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.

Any other ways to do it?

thanks

JB