summaryrefslogtreecommitdiffstats
path: root/Source/cmTryRunCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-25 15:25:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-25 15:26:24 (GMT)
commitebe436eb97bf81704a1d0b074b3da4ac817f37d3 (patch)
treeae29917c18a9ef90b62da4f616fbf2e8e702fb68 /Source/cmTryRunCommand.cxx
parent53305ce5b067c4feaa91ffe0cc82b740af525b3f (diff)
parent5962db438939ef2754509b8578af1f845ec07dc8 (diff)
downloadCMake-ebe436eb97bf81704a1d0b074b3da4ac817f37d3.zip
CMake-ebe436eb97bf81704a1d0b074b3da4ac817f37d3.tar.gz
CMake-ebe436eb97bf81704a1d0b074b3da4ac817f37d3.tar.bz2
Merge topic 'cxx11-nullptr'
5962db43 Use C++11 nullptr Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1175
Diffstat (limited to 'Source/cmTryRunCommand.cxx')
-rw-r--r--Source/cmTryRunCommand.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 07e20e6..cc93b03 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -125,9 +125,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
std::string runOutputContents;
if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") &&
!this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) {
- this->DoNotRunExecutable(runArgs, argv[3], captureRunOutput
- ? &runOutputContents
- : CM_NULLPTR);
+ this->DoNotRunExecutable(
+ runArgs, argv[3], captureRunOutput ? &runOutputContents : nullptr);
} else {
this->RunExecutable(runArgs, &runOutputContents);
}
@@ -189,7 +188,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
}
int timeout = 0;
bool worked = cmSystemTools::RunSingleCommand(
- finalCommand.c_str(), out, out, &retVal, CM_NULLPTR,
+ finalCommand.c_str(), out, out, &retVal, nullptr,
cmSystemTools::OUTPUT_NONE, timeout);
// set the run var
char retChar[1000];
@@ -233,7 +232,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
this->RunResultVariable + "__TRYRUN_OUTPUT";
bool error = false;
- if (this->Makefile->GetDefinition(this->RunResultVariable) == CM_NULLPTR) {
+ if (this->Makefile->GetDefinition(this->RunResultVariable) == nullptr) {
// if the variables doesn't exist, create it with a helpful error text
// and mark it as advanced
std::string comment;
@@ -255,8 +254,8 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
}
// is the output from the executable used ?
- if (out != CM_NULLPTR) {
- if (this->Makefile->GetDefinition(internalRunOutputName) == CM_NULLPTR) {
+ if (out != nullptr) {
+ if (this->Makefile->GetDefinition(internalRunOutputName) == nullptr) {
// if the variables doesn't exist, create it with a helpful error text
// and mark it as advanced
std::string comment;
@@ -304,7 +303,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
comment += " to\n"
" the exit code (in many cases 0 for success), otherwise "
"enter \"FAILED_TO_RUN\".\n";
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
comment += internalRunOutputName;
comment +=
"\n contains the text the executable "
@@ -335,7 +334,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
<< this->Makefile->GetDefinition(this->RunResultVariable)
<< "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n";
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
file << "set( " << internalRunOutputName << " \n \""
<< this->Makefile->GetDefinition(internalRunOutputName)
<< "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n";
@@ -348,7 +347,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
"please set the following cache variables "
"appropriately:\n";
errorMessage += " " + this->RunResultVariable + " (advanced)\n";
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
errorMessage += " " + internalRunOutputName + " (advanced)\n";
}
errorMessage += detailsString;
@@ -356,7 +355,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
return;
}
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
(*out) = this->Makefile->GetDefinition(internalRunOutputName);
}
}