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
|
// be run that way but the cmake object requires a vailid path
|
||||||
std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND");
|
std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND");
|
||||||
cmake cm;
|
cmake cm;
|
||||||
|
cm.SetIsInTryCompile(true);
|
||||||
cmGlobalGenerator *gg =
|
cmGlobalGenerator *gg =
|
||||||
cm.CreateGlobalGenerator(this->m_LocalGenerator->GetGlobalGenerator()->GetName());
|
cm.CreateGlobalGenerator(this->m_LocalGenerator->GetGlobalGenerator()->GetName());
|
||||||
if (!gg)
|
if (!gg)
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
cmake::cmake()
|
cmake::cmake()
|
||||||
{
|
{
|
||||||
m_Verbose = false;
|
m_Verbose = false;
|
||||||
|
m_InTryCompile = false;
|
||||||
m_CacheManager = new cmCacheManager;
|
m_CacheManager = new cmCacheManager;
|
||||||
m_GlobalGenerator = 0;
|
m_GlobalGenerator = 0;
|
||||||
this->AddDefaultCommands();
|
this->AddDefaultCommands();
|
||||||
|
|
|
@ -175,6 +175,12 @@ class cmake
|
||||||
///! Parse command line arguments
|
///! Parse command line arguments
|
||||||
void SetArgs(const std::vector<std::string>&);
|
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:
|
protected:
|
||||||
typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
|
typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
|
||||||
RegisteredCommandsMap m_Commands;
|
RegisteredCommandsMap m_Commands;
|
||||||
|
@ -204,5 +210,6 @@ protected:
|
||||||
private:
|
private:
|
||||||
bool m_Verbose;
|
bool m_Verbose;
|
||||||
bool m_Local;
|
bool m_Local;
|
||||||
|
bool m_InTryCompile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue