added a flag if a cmake is in try compile
This commit is contained in:
parent
895f8c42c0
commit
2aea6d528e
|
@ -1352,6 +1352,7 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
|
|||
// be run that way but the cmake object requires a vailid path
|
||||
std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND");
|
||||
cmake cm;
|
||||
cm.SetIsInTryCompile(true);
|
||||
cmGlobalGenerator *gg =
|
||||
cm.CreateGlobalGenerator(this->m_LocalGenerator->GetGlobalGenerator()->GetName());
|
||||
if (!gg)
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
cmake::cmake()
|
||||
{
|
||||
m_Verbose = false;
|
||||
m_InTryCompile = false;
|
||||
m_CacheManager = new cmCacheManager;
|
||||
m_GlobalGenerator = 0;
|
||||
this->AddDefaultCommands();
|
||||
|
|
|
@ -175,6 +175,12 @@ class cmake
|
|||
///! Parse command line arguments
|
||||
void SetArgs(const std::vector<std::string>&);
|
||||
|
||||
///! Is this cmake running as a result of a TRY_COMPILE command
|
||||
bool GetIsInTryCompile() { return m_InTryCompile; }
|
||||
|
||||
///! Is this cmake running as a result of a TRY_COMPILE command
|
||||
void SetIsInTryCompile(bool i) { m_InTryCompile = i; }
|
||||
|
||||
protected:
|
||||
typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
|
||||
RegisteredCommandsMap m_Commands;
|
||||
|
@ -204,5 +210,6 @@ protected:
|
|||
private:
|
||||
bool m_Verbose;
|
||||
bool m_Local;
|
||||
bool m_InTryCompile;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue