summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.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/cmFileCommand.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/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5a1238b..835b118 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1609,8 +1609,10 @@ struct cmFileInstaller : public cmFileCopier
// Installation does not use source permissions by default.
this->UseSourcePermissions = false;
// Check whether to copy files always or only if they have changed.
- this->Always =
- cmSystemTools::IsOn(cmSystemTools::GetEnv("CMAKE_INSTALL_ALWAYS"));
+ std::string install_always;
+ if (cmSystemTools::GetEnv("CMAKE_INSTALL_ALWAYS", install_always)) {
+ this->Always = cmSystemTools::IsOn(install_always.c_str());
+ }
// Get the current manifest.
this->Manifest =
this->Makefile->GetSafeDefinition("CMAKE_INSTALL_MANIFEST_FILES");
@@ -1869,9 +1871,8 @@ bool cmFileInstaller::HandleInstallDestination()
return false;
}
- const char* destdir = cmSystemTools::GetEnv("DESTDIR");
- if (destdir && *destdir) {
- std::string sdestdir = destdir;
+ std::string sdestdir;
+ if (cmSystemTools::GetEnv("DESTDIR", sdestdir) && !sdestdir.empty()) {
cmSystemTools::ConvertToUnixSlashes(sdestdir);
char ch1 = destination[0];
char ch2 = destination[1];