summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-06-21 10:50:11 -0400
committerBrad King <brad.king@kitware.com>2010-06-21 10:50:11 -0400
commit0a7c551bf61310859e47ebcce95e176a96db76bb (patch)
tree67e3197b3706eea2b6b98a396c59209f5c95d6c5
parente45a600a0fae6d8fe0de6bba10e3a6fab5204bb4 (diff)
downloadcmake-0a7c551bf61310859e47ebcce95e176a96db76bb.tar.gz
Preserve ENV{MAKEFLAGS} in CMake script mode
Commit 02f7cfbc (Need to remove the MAKEFLAGS when cmake starts, 2003-05-13) removed the MAKEFLAGS environment variable when CMake starts to prevent try_compile() from inheriting "make -i". This is unnecessary in script mode (cmake -P). Instead remove the variable only when configuring a project.
-rw-r--r--Source/cmake.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f766d47328..c009db9b32 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -162,16 +162,6 @@ cmake::cmake()
}
#endif
- // If MAKEFLAGS are given in the environment, remove the environment
- // variable. This will prevent try-compile from succeeding when it
- // should fail (if "-i" is an option). We cannot simply test
- // whether "-i" is given and remove it because some make programs
- // encode the MAKEFLAGS variable in a strange way.
- if(getenv("MAKEFLAGS"))
- {
- cmSystemTools::PutEnv("MAKEFLAGS=");
- }
-
this->Verbose = false;
this->InTryCompile = false;
this->CacheManager = new cmCacheManager(this);
@@ -2231,6 +2221,16 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
}
}
+ // If MAKEFLAGS are given in the environment, remove the environment
+ // variable. This will prevent try-compile from succeeding when it
+ // should fail (if "-i" is an option). We cannot simply test
+ // whether "-i" is given and remove it because some make programs
+ // encode the MAKEFLAGS variable in a strange way.
+ if(getenv("MAKEFLAGS"))
+ {
+ cmSystemTools::PutEnv("MAKEFLAGS=");
+ }
+
this->PreLoadCMakeFiles();
std::string systemFile = this->GetHomeOutputDirectory();