[CMake] Need a configure_string() command

Robert Dailey rcdailey at gmail.com
Fri Jan 20 11:09:01 EST 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120120/59526d66/attachment-0001.htm>


More information about the CMake mailing list