[Cmake-commits] [cmake-commits] king committed cmOptionCommand.cxx 1.25 1.26

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 11 10:04:03 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv20729/Source

Modified Files:
	cmOptionCommand.cxx 
Log Message:
Fix option() interpretation of non-boolean values

The commit "Remove barely-used cmMakefile::AddCacheDefinition" broke
option() calls that pass a non-boolean default value.  We restore the
old behavior by always coercing the value to 'ON' or 'OFF'.


Index: cmOptionCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmOptionCommand.cxx,v
retrieving revision 1.25
retrieving revision 1.26
diff -C 2 -d -r1.25 -r1.26
*** cmOptionCommand.cxx	10 Sep 2009 20:59:44 -0000	1.25
--- cmOptionCommand.cxx	11 Sep 2009 14:03:59 -0000	1.26
***************
*** 71,75 ****
      initialValue = args[2];
      }
!   this->Makefile->AddCacheDefinition(args[0].c_str(), initialValue.c_str(),
                                       args[1].c_str(), cmCacheManager::BOOL);
    return true;
--- 71,76 ----
      initialValue = args[2];
      }
!   bool init = cmSystemTools::IsOn(initialValue.c_str());
!   this->Makefile->AddCacheDefinition(args[0].c_str(), init? "ON":"OFF",
                                       args[1].c_str(), cmCacheManager::BOOL);
    return true;



More information about the Cmake-commits mailing list