[Cmake] Extracting values from files

Andy Cedilnik andy . cedilnik at kitware . com
25 Jun 2003 07:10:13 -0400


Hi John,

I am working on FILE command for CMake. It will be able to read file.
Then you can use STRING command to extract values.

			Andy

On Tue, 2003-06-24 at 12:13, John Biddiscombe wrote:
> On the subject of version information
> 
> suppose I have a simple text file which says
> 
> Project MyTest
> LibCore = 1 0 0 1
> LibMath = 1 0 0 2
> 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.
> 
> Any other ways to do it?