On Monday 17 December 2007, Brandon Van Every wrote: > I propose the addition of a BOOL type to the CMake language. > > bool(variable [value]) > > would declare a variable of type BOOL, with an optional value > supplied. Any SET commands performed on the variable in its scope > would be subject to boolean type constraint. A BOOL can take on the > following values. Any other assignment is an error. > > "TRUE" class - TRUE, 1, Y, Yes, YES, y, yes, ON > "FALSE" class - FALSE, 0, N, n, No, NO, OFF, <empty>
Attached is a patch which removes "Y" and "N" from the recognized values for true/false. This patch may break stuff. I don't know if there are many people who rely on "N" and "Y". Alex
Index: cmSystemTools.cxx =================================================================== RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v retrieving revision 1.356 diff -b -u -p -r1.356 cmSystemTools.cxx --- cmSystemTools.cxx 13 Dec 2007 22:56:49 -0000 1.356 +++ cmSystemTools.cxx 17 Dec 2007 20:19:46 -0000 @@ -352,7 +352,7 @@ bool cmSystemTools::IsOn(const char* val { *c = toupper(*c); } - return (v == "ON" || v == "1" || v == "YES" || v == "TRUE" || v == "Y"); + return (v == "ON" || v == "1" || v == "YES" || v == "TRUE"); } bool cmSystemTools::IsNOTFOUND(const char* val) @@ -386,7 +386,7 @@ bool cmSystemTools::IsOff(const char* va *c = toupper(*c); } return (v == "OFF" || v == "0" || v == "NO" || v == "FALSE" || - v == "N" || cmSystemTools::IsNOTFOUND(v.c_str()) || v == "IGNORE"); + cmSystemTools::IsNOTFOUND(v.c_str()) || v == "IGNORE"); } //----------------------------------------------------------------------------
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake