[CMake] if(string MATCHES regex) question

Eric Noulard eric.noulard at gmail.com
Fri Jul 3 03:37:49 EDT 2009


2009/7/2 Marcel Loose <loose at astron.nl>:
> Hi Eric,

>> The variable your are testing may contain "un-evaluated" var
>> or some special regex character( *, ?, ...)
>>
>> See attached example, you may test it with
>> $ cmake -P matches.cmake
>> MATCHES -- MYVAR = A good var
>> Look that one = double-dollar = blah / single-dollar = MYVAR2
>> NO MATCHES ** MYVAR = MYVAR2
>> $
>>
>> However I have no such usage currently :-)
>
> If I understand your script correctly, then the trick of this construct is to
> check whether the variable MYVAR is defined in terms of one (or more) other
> variables. Correct?

This is not the only NO MATCHES case, if the variable value contains
special regex character you get NO MATCHES too.

> If so, I still don't quite get the usage pattern in, e.g.,
> CheckIncludeFile.cmake. What are they trying to check?

Better ask the author of this file :-)

CVS commit on the file were done by
king --> Brad King
martink --> ??
hoffman --> Bill Hoffman
andy --> ??

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list