[CMake] Need a configure_string() command

Robert Dailey rcdailey at gmail.com
Fri Jan 20 11:18:21 EST 2012


Thanks! I wouldn't call CMake confusing, but it sure is unpredictable in
how things are laid out :P

---------
Robert Dailey


On Fri, Jan 20, 2012 at 10:14 AM, David Cole <david.cole at kitware.com> wrote:

> See the docs for:
>
> string(CONFIGURE ...)
>
>  http://cmake.org/cmake/help/cmake-2-8-docs.html#command:string
>
> That should help... :-)
>
>
> David
>
>
> On Fri, Jan 20, 2012 at 11:09 AM, Robert Dailey <rcdailey at gmail.com>
> wrote:
> > I'm trying to develop some scripts that will take a portion of the
> > vcproj.user file, specifically the <Configuration> portion, which is
> located
> > in a separate file, and append it (N) number of times to a file, where N
> > equals the number of configurations we have.
> >
> > Ideally I will start by using file() to read the entire contents of the
> > file. After that, I need to configure the string to replace this:
> >
> > Name="${configuration}|Win32"
> >
> > so that it looks like so (for the debug configuration):
> >
> > Name="Debug|Win32"
> >
> > After that, I need to append the contents of this string to another file,
> > which will be the final vcproj.user file.
> >
> > I can't use a file to configure this because of the way I'll be appending
> > the contents, and I can't replace on the final file itself because there
> > will be multiple ${configuration} variables, but they will each need to
> be
> > assigned a different value.
> >
> > The only solution I see for this is to have a configure_string()
> function,
> > which behaves exactly like configure_file() except input & output are
> string
> > variables instead of files.
> >
> > Any thoughts on this? Workarounds?
> >
> > ---------
> > Robert Dailey
> >
> > --
> >
> > 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/20120120/a5daa041/attachment.htm>


More information about the CMake mailing list