summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-09-12 15:08:06 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-09-12 15:08:06 (GMT)
commit2aea6d528e5e310078d270bca9736f9e7d993b1a (patch)
treef1c8fb0ec307ecb8b4875d25b706a7b78b180f2f
parent895f8c42c0608703dff076eb195092a96a7c9f45 (diff)
downloadCMake-2aea6d528e5e310078d270bca9736f9e7d993b1a.zip
CMake-2aea6d528e5e310078d270bca9736f9e7d993b1a.tar.gz
CMake-2aea6d528e5e310078d270bca9736f9e7d993b1a.tar.bz2
added a flag if a cmake is in try compile
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Source/cmake.cxx1
-rw-r--r--Source/cmake.h7
3 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e945b17..4c4cd6b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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)
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 955602c..643024e 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -37,6 +37,7 @@
cmake::cmake()
{
m_Verbose = false;
+ m_InTryCompile = false;
m_CacheManager = new cmCacheManager;
m_GlobalGenerator = 0;
this->AddDefaultCommands();
diff --git a/Source/cmake.h b/Source/cmake.h
index da5d329..60bde26 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -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;
};