summaryrefslogtreecommitdiffstats
path: root/Source/cmTryRunCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTryRunCommand.cxx')
-rw-r--r--Source/cmTryRunCommand.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 19837a7..7b19048 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -124,8 +124,9 @@ 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 : 0);
+ this->DoNotRunExecutable(runArgs, argv[3], captureRunOutput
+ ? &runOutputContents
+ : CM_NULLPTR);
} else {
this->RunExecutable(runArgs, &runOutputContents);
}
@@ -186,9 +187,9 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
finalCommand += runArgs;
}
int timeout = 0;
- bool worked =
- cmSystemTools::RunSingleCommand(finalCommand.c_str(), out, out, &retVal, 0,
- cmSystemTools::OUTPUT_NONE, timeout);
+ bool worked = cmSystemTools::RunSingleCommand(
+ finalCommand.c_str(), out, out, &retVal, CM_NULLPTR,
+ cmSystemTools::OUTPUT_NONE, timeout);
// set the run var
char retChar[1000];
if (worked) {
@@ -230,7 +231,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
this->RunResultVariable + "__TRYRUN_OUTPUT";
bool error = false;
- if (this->Makefile->GetDefinition(this->RunResultVariable) == 0) {
+ if (this->Makefile->GetDefinition(this->RunResultVariable) == CM_NULLPTR) {
// if the variables doesn't exist, create it with a helpful error text
// and mark it as advanced
std::string comment;
@@ -252,8 +253,8 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
}
// is the output from the executable used ?
- if (out != 0) {
- if (this->Makefile->GetDefinition(internalRunOutputName) == 0) {
+ if (out != CM_NULLPTR) {
+ if (this->Makefile->GetDefinition(internalRunOutputName) == CM_NULLPTR) {
// if the variables doesn't exist, create it with a helpful error text
// and mark it as advanced
std::string comment;
@@ -301,7 +302,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 != 0) {
+ if (out != CM_NULLPTR) {
comment += internalRunOutputName;
comment +=
"\n contains the text the executable "
@@ -332,7 +333,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 != 0) {
+ if (out != CM_NULLPTR) {
file << "set( " << internalRunOutputName << " \n \""
<< this->Makefile->GetDefinition(internalRunOutputName)
<< "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n";
@@ -345,7 +346,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
"please set the following cache variables "
"appropriately:\n";
errorMessage += " " + this->RunResultVariable + " (advanced)\n";
- if (out != 0) {
+ if (out != CM_NULLPTR) {
errorMessage += " " + internalRunOutputName + " (advanced)\n";
}
errorMessage += detailsString;
@@ -353,7 +354,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
return;
}
- if (out != 0) {
+ if (out != CM_NULLPTR) {
(*out) = this->Makefile->GetDefinition(internalRunOutputName);
}
}