added a flag if a cmake is in try compile

This commit is contained in:
Ken Martin 2002-09-12 11:08:06 -04:00
parent 895f8c42c0
commit 2aea6d528e
3 changed files with 9 additions and 0 deletions

View File

@ -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)

View File

@ -37,6 +37,7 @@
cmake::cmake()
{
m_Verbose = false;
m_InTryCompile = false;
m_CacheManager = new cmCacheManager;
m_GlobalGenerator = 0;
this->AddDefaultCommands();

View File

@ -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;
};