[CMake] file(READ) issue?

David Cole david.cole at kitware.com
Wed Mar 25 10:27:48 EDT 2009


";" is the CMake list element separator character. The ";" are still there
in the variable, you probably just can't see them with your processing code
that comes after reading in the file...

You can replace semi-colons like this with escaped semi-colons:
  STRING(REGEX REPLACE ";" "\\\\;" ZCONF_H "${ZCONF_H}")

Then CMake will treat the variable ZCONF_H as one large string that has
embedded (escaped) semi-colons in it.


HTH,
David


On Sun, Mar 22, 2009 at 6:07 AM, Steven Van Ingelgem
<steven at vaningelgem.be>wrote:

> Hi,
>
>
> I'm trying to read in a C-header file with "file(READ)":
>   file(READ "zconf.in.h" ZCONF_H)
>
> !! But this variable contains no ";" whatsoever?
>
> How can I ask to read it in completely?
>
>
> Thanks,
> Steven
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090325/7369f36e/attachment.htm>


More information about the CMake mailing list