[CMake] Re: dangerous regex in CHECK_C_SOURCE_COMPILES

David Cole david.cole at kitware.com
Tue Nov 13 15:27:24 EST 2007


The intent is to use a construct that works even with older CMake versions
such that the code enclosed in the construct only gets run on the first
configure.

I'm pretty sure it's only dangerous with variables that have dangerous names
in the first place.

Do you have a concrete example that is giving you problems?

On 11/13/07, Brandon Van Every <bvanevery at gmail.com> wrote:
>
> I see the same construct in CHECK_INCLUDE_FILES.  What is the intent?
> This is not safe.
>
> Cheers,
> Brandon Van Every
>
>
> On Nov 7, 2007 11:38 AM, Brandon Van Every <bvanevery at gmail.com> wrote:
> > It begins with:
> >
> > MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
> >   IF("${VAR}" MATCHES "^${VAR}$")
> >
> > What is the intent here?  If ${VAR} contains regex special characters
> > you're going to get all kinds of weird and nasty behavior.
> >
> >
> > Cheers,
> > Brandon Van Every
> >
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071113/7fa2cd77/attachment-0001.html


More information about the CMake mailing list