summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-28 20:40:35 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-28 20:40:35 (GMT)
commit9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a (patch)
tree62bbc9236a49a4f235b010bd433745a7a7870f68 /Source/cmAddCustomCommandCommand.cxx
parent7d2de52c1a617a8a559e5c749ce5e6abd3739f01 (diff)
downloadCMake-9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a.zip
CMake-9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a.tar.gz
CMake-9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a.tar.bz2
BUG: Fix/cleanup custom commands and custom targets. Make empty comment strings work. Fix ZERO_CHECK target always out of date for debugging. Fix Makefile driving of custom commands in a custom target. Fix dependencies on custom targets not in ALL in VS generators.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 3c37d4b..3f0dd26 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -32,8 +32,9 @@ bool cmAddCustomCommandCommand::InitialPass(
return false;
}
- std::string source, target, comment, main_dependency,
- working;
+ std::string source, target, main_dependency, working;
+ std::string comment_buffer;
+ const char* comment = 0;
std::vector<std::string> depends, outputs, output;
bool verbatim = false;
@@ -178,7 +179,8 @@ bool cmAddCustomCommandCommand::InitialPass(
outputs.push_back(filename);
break;
case doing_comment:
- comment = copy;
+ comment_buffer = copy;
+ comment = comment_buffer.c_str();
break;
default:
this->SetError("Wrong syntax. Unknown type of argument.");
@@ -223,7 +225,7 @@ bool cmAddCustomCommandCommand::InitialPass(
std::vector<std::string> no_depends;
this->Makefile->AddCustomCommandToTarget(target.c_str(), no_depends,
commandLines, cctype,
- comment.c_str(), working.c_str(),
+ comment, working.c_str(),
escapeOldStyle);
}
else if(target.empty())
@@ -231,7 +233,7 @@ bool cmAddCustomCommandCommand::InitialPass(
// Target is empty, use the output.
this->Makefile->AddCustomCommandToOutput(output, depends,
main_dependency.c_str(),
- commandLines, comment.c_str(),
+ commandLines, comment,
working.c_str(), false,
escapeOldStyle);
}
@@ -240,7 +242,7 @@ bool cmAddCustomCommandCommand::InitialPass(
// Use the old-style mode for backward compatibility.
this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, depends,
source.c_str(), commandLines,
- comment.c_str());
+ comment);
}
return true;
}