[cmake-developers] Unique compile definitions

Brad King brad.king at kitware.com
Mon Aug 20 08:00:48 EDT 2012


On 08/19/2012 04:17 PM, Stephen Kelly wrote:
> maybe the comment I pointed out should be 
> removed or made more clear. It doesn't seem to relate to what the code is 
> actually about. What do you think?

This is the code in question:

  // Make the definition appear properly on the command line.  Use
  // -DNAME="value" instead of -D"NAME=value" to help VS6 parser.
  std::string::size_type eq = di->find("=");
  defines += di->substr(0, eq);
  if(eq != di->npos)
    {
    defines += "=";
    defines += this->EscapeForShell(di->c_str() + eq + 1, true);
    }

The comment is explaining why we start with '-DNAME=' and send
the 'value' part to EscapeForShell instead of just creating
'-DNAME=value' and sending it all to EscapeForShell.  If you have
better wording to explain the same thing please propose it.

-Brad



More information about the cmake-developers mailing list