[CMake] bug?

Andy andy.cedilnik at kitware.com
Tue Mar 8 15:28:32 EST 2005


Hi

What you can do is to use STRING(REGEX REPLACE to replace ";" with let 
say "--SC--" and then you replace '\n' with ';', then your FOREACH will 
work.

    Andy

John Biddiscombe wrote:

> If you save the following lines as a text file
> ----begin text file---
> This is text
> with a line with a;
> at the end
> ---end text ----
>
> and then do this
>
>  FILE(READ ${FILENAME} CONTENTS)
>
>  FOREACH(line ${CONTENTS})
>      IF( "${line}" MATCHES ";" )
>        MESSAGE("Got one")
>      ENDIF( "${line}" MATCHES ";" )
>  ENDFOREACH(line)
>
> you don't get a match for the line with the ; at the end. Is this 
> intentional. I've noticed that cmake treats ; chars as eol delimiters 
> in expressions. Its quite hard to do anything with files with ; in 
> when you need them.
>
> bug?
>
> or feature?
>
> thanks
>
> JB
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake




More information about the CMake mailing list