From 2aea6d528e5e310078d270bca9736f9e7d993b1a Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 12 Sep 2002 11:08:06 -0400 Subject: [PATCH] added a flag if a cmake is in try compile --- Source/cmMakefile.cxx | 1 + Source/cmake.cxx | 1 + Source/cmake.h | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e945b17bd..4c4cd6be2 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 955602cb0..643024eb8 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 da5d32969..60bde266d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -175,6 +175,12 @@ class cmake ///! Parse command line arguments void SetArgs(const std::vector&); + ///! 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 RegisteredCommandsMap; RegisteredCommandsMap m_Commands; @@ -204,5 +210,6 @@ protected: private: bool m_Verbose; bool m_Local; + bool m_InTryCompile; };