[cmake-developers] Configure File and #cmakedefine

Andy Cedilnik andy.cedilnik at kitware.com
Wed Jan 31 11:23:22 EST 2007


Hello,

There is a code in cmMakefile.cxx:

      if(!cmSystemTools::IsOff(def))
        {
        cmSystemTools::ReplaceString(line, "#cmakedefine", "#define");
        output += line;
        }
      else
        {
        cmSystemTools::ReplaceString(line, "#cmakedefine", "#undef");
        output += "/* ";
        output += line;
        output += " */";
        }

This code handles the following cases:

#cmakedefine
  #cmakedefine

but not:

# cmakedefine

Unfortunately to properly handle the last one, we would need to
replace with regular expression or some manual parsing. This would
slow down the configure file.

Maybe we could check if the line contains cmakedefine and then parse.

Comments?

-- 
-------------------------------------------
Andy Cedilnik
Kitware Inc.
http://www.kitware.com
Phone: +1 518 371 3971 x110



More information about the cmake-developers mailing list