summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-10 12:34:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-10 13:36:58 (GMT)
commitb5212c68def0395642fc51dcfd499557eb9481d9 (patch)
treec5d390892ad8059fcda4318feb40ed65cae0942c /Source
parent95b0d761a75fd2da041eacc9ee22b89043ae301f (diff)
downloadCMake-b5212c68def0395642fc51dcfd499557eb9481d9.zip
CMake-b5212c68def0395642fc51dcfd499557eb9481d9.tar.gz
CMake-b5212c68def0395642fc51dcfd499557eb9481d9.tar.bz2
cmState: Add API for cache version.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCPluginAPI.cxx8
-rw-r--r--Source/cmState.cxx10
-rw-r--r--Source/cmState.h3
-rw-r--r--Source/cmUtilitySourceCommand.cxx10
4 files changed, 21 insertions, 10 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 7da334e..6fa4ebb 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -51,14 +51,14 @@ void CCONV cmSetError(void *info, const char *err)
unsigned int CCONV cmGetCacheMajorVersion(void *arg)
{
cmMakefile *mf = static_cast<cmMakefile *>(arg);
- cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager();
- return manager->GetCacheMajorVersion();
+ cmState *state = mf->GetState();
+ return state->GetCacheMajorVersion();
}
unsigned int CCONV cmGetCacheMinorVersion(void *arg)
{
cmMakefile *mf = static_cast<cmMakefile *>(arg);
- cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager();
- return manager->GetCacheMinorVersion();
+ cmState *state = mf->GetState();
+ return state->GetCacheMinorVersion();
}
unsigned int CCONV cmGetMajorVersion(void *)
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 9628265..3aad7f5 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -677,6 +677,16 @@ bool cmState::UseMSYSShell() const
return this->MSYSShell;
}
+unsigned int cmState::GetCacheMajorVersion() const
+{
+ return this->CMakeInstance->GetCacheManager()->GetCacheMajorVersion();
+}
+
+unsigned int cmState::GetCacheMinorVersion() const
+{
+ return this->CMakeInstance->GetCacheManager()->GetCacheMinorVersion();
+}
+
const char* cmState::GetBinaryDirectory() const
{
return this->BinaryDirectory.c_str();
diff --git a/Source/cmState.h b/Source/cmState.h
index e71668f..4c32831 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -302,6 +302,9 @@ public:
void SetMSYSShell(bool mSYSShell);
bool UseMSYSShell() const;
+ unsigned int GetCacheMajorVersion() const;
+ unsigned int GetCacheMinorVersion() const;
+
private:
friend class cmake;
void AddCacheEntry(const std::string& key, const char* value,
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 486328f..3f1e333 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -11,8 +11,6 @@
============================================================================*/
#include "cmUtilitySourceCommand.h"
-#include "cmCacheManager.h"
-
// cmUtilitySourceCommand
bool cmUtilitySourceCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
@@ -54,13 +52,13 @@ bool cmUtilitySourceCommand
}
else
{
- cmCacheManager *manager =
- this->Makefile->GetCMakeInstance()->GetCacheManager();
+ cmState *state =
+ this->Makefile->GetState();
haveCacheValue = (cacheValue &&
(strstr(cacheValue, "(IntDir)") == 0 ||
(intDir && strcmp(intDir, "$(IntDir)") == 0)) &&
- (manager->GetCacheMajorVersion() != 0 &&
- manager->GetCacheMinorVersion() != 0 ));
+ (state->GetCacheMajorVersion() != 0 &&
+ state->GetCacheMinorVersion() != 0 ));
}
if(haveCacheValue)