Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Hoffman
CMake
Commits
b5212c68
Commit
b5212c68
authored
Oct 10, 2015
by
Stephen Kelly
Browse files
cmState: Add API for cache version.
parent
95b0d761
Changes
4
Hide whitespace changes
Inline
Side-by-side
Source/cmCPluginAPI.cxx
View file @
b5212c68
...
...
@@ -51,14 +51,14 @@ void CCONV cmSetError(void *info, const char *err)
unsigned
int
CCONV
cmGetCacheMajorVersion
(
void
*
arg
)
{
cmMakefile
*
mf
=
static_cast
<
cmMakefile
*>
(
arg
);
cm
CacheManager
*
manager
=
mf
->
GetCMakeInstance
()
->
GetCacheManager
();
return
manager
->
GetCacheMajorVersion
();
cm
State
*
state
=
mf
->
GetState
();
return
state
->
GetCacheMajorVersion
();
}
unsigned
int
CCONV
cmGetCacheMinorVersion
(
void
*
arg
)
{
cmMakefile
*
mf
=
static_cast
<
cmMakefile
*>
(
arg
);
cm
CacheManager
*
manager
=
mf
->
GetCMakeInstance
()
->
GetCacheManager
();
return
manager
->
GetCacheMinorVersion
();
cm
State
*
state
=
mf
->
GetState
();
return
state
->
GetCacheMinorVersion
();
}
unsigned
int
CCONV
cmGetMajorVersion
(
void
*
)
...
...
Source/cmState.cxx
View file @
b5212c68
...
...
@@ -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
();
...
...
Source/cmState.h
View file @
b5212c68
...
...
@@ -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
,
...
...
Source/cmUtilitySourceCommand.cxx
View file @
b5212c68
...
...
@@ -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
{
cm
CacheManager
*
manager
=
this
->
Makefile
->
Get
CMakeInstance
()
->
GetCacheManager
();
cm
State
*
state
=
this
->
Makefile
->
Get
State
();
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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment