diff options
author | Brad King <brad.king@kitware.com> | 2008-01-24 12:37:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-24 12:37:08 (GMT) |
commit | 7213408287971b395bee21f9aeb59d1e393dc6a9 (patch) | |
tree | 883bb5b4ead553de734507e629eedf897bc99799 /Source/cmMakefile.cxx | |
parent | f5d86035f285816f174de6d0b14833f5b48d048b (diff) | |
download | CMake-7213408287971b395bee21f9aeb59d1e393dc6a9.zip CMake-7213408287971b395bee21f9aeb59d1e393dc6a9.tar.gz CMake-7213408287971b395bee21f9aeb59d1e393dc6a9.tar.bz2 |
ENH: Added cmMakefile::NeedCacheCompatibility method and support for it in cmCacheManager. This will allow commands to modify their behavior when running with a cache loaded from an earlier CMake version.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 151ad5e..d75e9eb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -145,32 +145,18 @@ void cmMakefile::Initialize() unsigned int cmMakefile::GetCacheMajorVersion() { - if(const char* vstr = - this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) - { - unsigned int v=0; - if(sscanf(vstr, "%u", &v) == 1) - { - return v; - } - } - return 0; + return this->GetCacheManager()->GetCacheMajorVersion(); } unsigned int cmMakefile::GetCacheMinorVersion() { - if(const char* vstr = - this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MINOR_VERSION")) - { - unsigned int v=0; - if(sscanf(vstr, "%u", &v) == 1) - { - return v; - } - } - return 0; + return this->GetCacheManager()->GetCacheMinorVersion(); } +bool cmMakefile::NeedCacheCompatibility(int major, int minor) +{ + return this->GetCacheManager()->NeedCacheCompatibility(major, minor); +} cmMakefile::~cmMakefile() { |