summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorDāvis Mosāns <davispuh@gmail.com>2016-07-07 21:54:05 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-18 13:51:01 (GMT)
commitb1f87a50b3aee129d420b8d789ebec55068e4ec5 (patch)
treee9223617c45d01c60a4c89c5d60dc0121a75a989 /Source/cmake.cxx
parent03407040d4d7d89fbb45e941a9dfb4257003a8a8 (diff)
downloadCMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.zip
CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.tar.gz
CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.tar.bz2
Use better KWSys SystemTools::GetEnv and HasEnv signatures
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx21
1 files changed, 6 insertions, 15 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index fceec16..cdc1284 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -22,6 +22,7 @@
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmTest.h"
+#include "cmUtils.hxx"
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include "cmGraphVizWriter.h"
@@ -957,16 +958,10 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator* gg)
cmSystemTools::SetForceUnixPaths(this->GlobalGenerator->GetForceUnixPaths());
// Save the environment variables CXX and CC
- const char* cxx = getenv("CXX");
- const char* cc = getenv("CC");
- if (cxx) {
- this->CXXEnvironment = cxx;
- } else {
+ if (!cmSystemTools::GetEnv("CXX", this->CXXEnvironment)) {
this->CXXEnvironment = "";
}
- if (cc) {
- this->CCEnvironment = cc;
- } else {
+ if (!cmSystemTools::GetEnv("CC", this->CCEnvironment)) {
this->CCEnvironment = "";
}
}
@@ -1431,7 +1426,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
// 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")) {
+ if (cmSystemTools::HasEnv("MAKEFLAGS")) {
cmSystemTools::PutEnv("MAKEFLAGS=");
}
@@ -1706,12 +1701,8 @@ void cmake::UpdateConversionPathTable()
int cmake::CheckBuildSystem()
{
- // We do not need to rerun CMake. Check dependency integrity. Use
- // the make system's VERBOSE environment variable to enable verbose
- // output. This can be skipped by setting CMAKE_NO_VERBOSE (which is set
- // by the Eclipse and KDevelop generators).
- bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != CM_NULLPTR) &&
- (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == CM_NULLPTR));
+ // We do not need to rerun CMake. Check dependency integrity.
+ const bool verbose = isCMakeVerbose();
// This method will check the integrity of the build system if the
// option was given on the command line. It reads the given file to