[Cmake] Extracting values from files

John Biddiscombe john . biddiscombe at mirada-solutions . com
Wed, 25 Jun 2003 11:18:54 +0100


Stefan

Yes. I'd like to do it that way. Unfortunately, I have to import the =
values from someone else's format. I suspect I'll end up making a small =
exe which parses the project setup file and spits out a new file in =
cmake form, I can then make a dependency on the relevant files and add a =
custom rule. it ought to work, but it'd be much nicer to do it without =
leaving cmake - if you will.

thanks

JB

> -----Original Message-----
> From: Stefan Schmidt [mailto:Stefan . Schmidt at sophia . inria . fr]
> Sent: 25 June 2003 09:43
> To: John Biddiscombe; CMake (E-mail)
> Subject: Re: [Cmake] Extracting values from files
>=20
>=20
> Hi John,
>=20
> > LibImage =3D 1 0 0 1
> >
> > and I want CMake to open the file and extract the version I=20
> should be
> > linking against for each of the libs in question. Are there=20
> any useful
> > functions available for doing that. Reading KVP's (Key=20
> value pairs) or
> > rudimentary parsing.
> >
> > I'm wondering if the file in question was stored as a cmake=20
> cache file I
> > could LOAD_CACHE(...) and get the values as variables directly.
>=20
> If you could have the file have CMake syntax (using the SET=20
> command), you can=20
> read it in using the INCLUDE() command in your=20
> CMakeLists.txt. Thats what I=20
> did to get some external information into CMake.
>=20
> Regards,
> Stefan
>=20
>=20
>=20