[CMake] escaping!

Brandon Van Every bvanevery at gmail.com
Wed Dec 12 16:03:34 EST 2007


On Dec 12, 2007 10:09 AM, Javier Gonzalez <javierggt at yahoo.com> wrote:
> Hi,
>
> Well, these don't answer much. The first message (from Andrew) mentions
> an option I have considered: writing everything on a script and calling
> the script.
>
> However, I thought it would be possible with cmake.

"It" probably is.  But you know, these quoting and escape issues
are... really really boring.

> The wiki just says:
> "You may need \\ instead of \ due to CMake argument processing. \" works
> fine in SET statements, but you may need \\\" in some CMake functions.
> It can get hairy. This section needs elaboration."

Yeah, I wrote that on the wiki.  Nobody paid me to do it.  I figured
it was better than the complete absence of information on the wiki
that previously existed.

> And that explains absolutely nothing.

You're absolutely right.  My comment on the wiki says so.  It's a placeholder.

The usual way to deal with such things is to pore over the mailing
list archives and hack, hack, hack until you come up with an answer.
Then, if your labor yields a clear solution, and you still have energy
left over, you can improve the wiki documentation for the next poor
slob who happens by.  But nobody's paying anyone to do that, so
there's always this tradeoff of whether you're going to pay attention
to other people's needs, or your own needs.  I've got my own needs to
worry about right now.  Such is the nature of open source.  Call me
jaded, but part of my expectation in open source is that when $0 is
changing hands, people will do some of the explaining and hacking
themselves.

I've reiterated / harped on the need for "Chapter oriented"
documentation for a long time.  That's how you'd properly reposit
information about quoting, escape, and VERBATIM behavior, so that
other people can find and utilize it.  But we don't have the
infrastructure for that at present.  Nothing's stopping anyone from
overhauling the wiki and making it chapter oriented, except for the
fact that it's a ton of work that nobody wants to do for $0.

The CMake 2.6 documentation in CVS is a significant improvement over
the 2.4.7 documentation.  It has web hyperlinks for commands, it
breaks Modules into their own section, and CMake variables are
actually getting documented.  These are big improvements.  But there's
still nothing chapter oriented, so finding certain kinds of
information will continue to be problematic.  I'm really glad there's
as much improvement as there is though.  The documentation is clearly
moving forwards.

> That is precisely the problem I
> have and I tried many diferent things but none seemed to work.
>
> Now, on a note... this problem appeared after I had been trying to do
> something that I think can't be done with cmake. I will ask that
> question but I would like to know how to solve this one.

Through hacking, one finds the bleeding edge of CMake.  When I've
found the bleeding edge, I try to obtain 1 of 2 results:

- an approach that works.  If it's hairy, I may file a feature request.
- a bug that's reproducible.  In which case, I file a bug report.


Cheers,
Brandon Van Every


More information about the CMake mailing list