Merge topic 'clang-tidy-fixes'
3fab1fef
cmNinjaNormalTargetGenerator: make sure comments match parameter names7b94a7ad
cmCommandArgumentsHelper: simplify boolean expression782fcbb9
Use CM_NULLPTR809ca6c8
Use braces around statements516f8edb
Avoid else after returnd9f5d3c5
Remove redundant get() call on smart pointer3fda1094
Mark overridden functions with CM_OVERRIDE
This commit is contained in:
commit
995d6be128
|
@ -42,9 +42,9 @@ bool cmCMakeHostSystemInformationCommand::InitialPass(
|
||||||
result_list += ";";
|
result_list += ";";
|
||||||
}
|
}
|
||||||
std::string value;
|
std::string value;
|
||||||
if (!this->GetValue(info, key, value))
|
if (!this->GetValue(info, key, value)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
result_list += value;
|
result_list += value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,23 +24,27 @@ bool cmCMakePolicyCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
|
|
||||||
if (args[0] == "SET") {
|
if (args[0] == "SET") {
|
||||||
return this->HandleSetMode(args);
|
return this->HandleSetMode(args);
|
||||||
} else if (args[0] == "GET") {
|
}
|
||||||
|
if (args[0] == "GET") {
|
||||||
return this->HandleGetMode(args);
|
return this->HandleGetMode(args);
|
||||||
} else if (args[0] == "PUSH") {
|
}
|
||||||
|
if (args[0] == "PUSH") {
|
||||||
if (args.size() > 1) {
|
if (args.size() > 1) {
|
||||||
this->SetError("PUSH may not be given additional arguments.");
|
this->SetError("PUSH may not be given additional arguments.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this->Makefile->PushPolicy();
|
this->Makefile->PushPolicy();
|
||||||
return true;
|
return true;
|
||||||
} else if (args[0] == "POP") {
|
}
|
||||||
|
if (args[0] == "POP") {
|
||||||
if (args.size() > 1) {
|
if (args.size() > 1) {
|
||||||
this->SetError("POP may not be given additional arguments.");
|
this->SetError("POP may not be given additional arguments.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this->Makefile->PopPolicy();
|
this->Makefile->PopPolicy();
|
||||||
return true;
|
return true;
|
||||||
} else if (args[0] == "VERSION") {
|
}
|
||||||
|
if (args[0] == "VERSION") {
|
||||||
return this->HandleVersionMode(args);
|
return this->HandleVersionMode(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +152,8 @@ bool cmCMakePolicyCommand::HandleVersionMode(
|
||||||
if (args.size() <= 1) {
|
if (args.size() <= 1) {
|
||||||
this->SetError("VERSION not given an argument");
|
this->SetError("VERSION not given an argument");
|
||||||
return false;
|
return false;
|
||||||
} else if (args.size() >= 3) {
|
}
|
||||||
|
if (args.size() >= 3) {
|
||||||
this->SetError("VERSION given too many arguments");
|
this->SetError("VERSION given too many arguments");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -524,9 +524,8 @@ void CCONV* cmGetSource(void* arg, const char* name)
|
||||||
i = cmCPluginAPISourceFiles.insert(entry).first;
|
i = cmCPluginAPISourceFiles.insert(entry).first;
|
||||||
}
|
}
|
||||||
return (void*)i->second;
|
return (void*)i->second;
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* CCONV cmAddSource(void* arg, void* arg2)
|
void* CCONV cmAddSource(void* arg, void* arg2)
|
||||||
|
@ -574,12 +573,11 @@ const char* CCONV cmSourceFileGetProperty(void* arg, const char* prop)
|
||||||
cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
|
cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
|
||||||
if (cmSourceFile* rsf = sf->RealSourceFile) {
|
if (cmSourceFile* rsf = sf->RealSourceFile) {
|
||||||
return rsf->GetProperty(prop);
|
return rsf->GetProperty(prop);
|
||||||
} else {
|
|
||||||
if (!strcmp(prop, "LOCATION")) {
|
|
||||||
return sf->FullPath.c_str();
|
|
||||||
}
|
|
||||||
return sf->Properties.GetPropertyValue(prop);
|
|
||||||
}
|
}
|
||||||
|
if (!strcmp(prop, "LOCATION")) {
|
||||||
|
return sf->FullPath.c_str();
|
||||||
|
}
|
||||||
|
return sf->Properties.GetPropertyValue(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
|
int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
|
||||||
|
@ -587,9 +585,8 @@ int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
|
||||||
cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
|
cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
|
||||||
if (cmSourceFile* rsf = sf->RealSourceFile) {
|
if (cmSourceFile* rsf = sf->RealSourceFile) {
|
||||||
return rsf->GetPropertyAsBool(prop) ? 1 : 0;
|
return rsf->GetPropertyAsBool(prop) ? 1 : 0;
|
||||||
} else {
|
|
||||||
return cmSystemTools::IsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
|
|
||||||
}
|
}
|
||||||
|
return cmSystemTools::IsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
|
void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
|
||||||
|
|
|
@ -57,14 +57,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const
|
||||||
if (this->ArgumentsBeforeEmpty) {
|
if (this->ArgumentsBeforeEmpty) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return this->ArgumentsBefore.find(current) != this->ArgumentsBefore.end();
|
||||||
std::set<const cmCommandArgument*>::const_iterator argIt =
|
|
||||||
this->ArgumentsBefore.find(current);
|
|
||||||
if (argIt != this->ArgumentsBefore.end()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCommandArgument::KeyMatches(const std::string& key) const
|
bool cmCommandArgument::KeyMatches(const std::string& key) const
|
||||||
|
|
|
@ -249,20 +249,19 @@ bool cmConditionEvaluator::GetBooleanValueOld(
|
||||||
// Old IsTrue behavior for single argument.
|
// Old IsTrue behavior for single argument.
|
||||||
if (arg == "0") {
|
if (arg == "0") {
|
||||||
return false;
|
return false;
|
||||||
} else if (arg == "1") {
|
}
|
||||||
|
if (arg == "1") {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
const char* def = this->GetDefinitionIfUnquoted(arg);
|
|
||||||
return !cmSystemTools::IsOff(def);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Old GetVariableOrNumber behavior.
|
|
||||||
const char* def = this->GetDefinitionIfUnquoted(arg);
|
const char* def = this->GetDefinitionIfUnquoted(arg);
|
||||||
if (!def && atoi(arg.c_str())) {
|
|
||||||
def = arg.c_str();
|
|
||||||
}
|
|
||||||
return !cmSystemTools::IsOff(def);
|
return !cmSystemTools::IsOff(def);
|
||||||
}
|
}
|
||||||
|
// Old GetVariableOrNumber behavior.
|
||||||
|
const char* def = this->GetDefinitionIfUnquoted(arg);
|
||||||
|
if (!def && atoi(arg.c_str())) {
|
||||||
|
def = arg.c_str();
|
||||||
|
}
|
||||||
|
return !cmSystemTools::IsOff(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -274,7 +273,8 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
|
||||||
// Use the policy if it is set.
|
// Use the policy if it is set.
|
||||||
if (this->Policy12Status == cmPolicies::NEW) {
|
if (this->Policy12Status == cmPolicies::NEW) {
|
||||||
return GetBooleanValue(newArg);
|
return GetBooleanValue(newArg);
|
||||||
} else if (this->Policy12Status == cmPolicies::OLD) {
|
}
|
||||||
|
if (this->Policy12Status == cmPolicies::OLD) {
|
||||||
return GetBooleanValueOld(newArg, oneArg);
|
return GetBooleanValueOld(newArg, oneArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,9 +565,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
|
||||||
if (copyFileError.empty()) {
|
if (copyFileError.empty()) {
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, emsg.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, emsg.str());
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
copyFileErrorMessage = emsg.str();
|
|
||||||
}
|
}
|
||||||
|
copyFileErrorMessage = emsg.str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,10 +159,9 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
if (cmds[i].empty()) {
|
if (cmds[i].empty()) {
|
||||||
this->SetError(" given COMMAND argument with no value.");
|
this->SetError(" given COMMAND argument with no value.");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
// Add the null terminating pointer to the command argument list.
|
|
||||||
cmds[i].push_back(CM_NULLPTR);
|
|
||||||
}
|
}
|
||||||
|
// Add the null terminating pointer to the command argument list.
|
||||||
|
cmds[i].push_back(CM_NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the timeout string.
|
// Parse the timeout string.
|
||||||
|
|
|
@ -45,24 +45,25 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Implement virtual methods from the superclass.
|
// Implement virtual methods from the superclass.
|
||||||
virtual void GeneratePolicyHeaderCode(std::ostream&) {}
|
void GeneratePolicyHeaderCode(std::ostream&) CM_OVERRIDE {}
|
||||||
virtual void GeneratePolicyFooterCode(std::ostream&) {}
|
void GeneratePolicyFooterCode(std::ostream&) CM_OVERRIDE {}
|
||||||
virtual void GenerateImportHeaderCode(std::ostream& os,
|
void GenerateImportHeaderCode(std::ostream& os,
|
||||||
const std::string& config = "");
|
const std::string& config = "") CM_OVERRIDE;
|
||||||
virtual void GenerateImportFooterCode(std::ostream& os);
|
void GenerateImportFooterCode(std::ostream& os) CM_OVERRIDE;
|
||||||
virtual void GenerateImportTargetCode(std::ostream& os,
|
void GenerateImportTargetCode(std::ostream& os,
|
||||||
const cmGeneratorTarget* target);
|
const cmGeneratorTarget* target) CM_OVERRIDE;
|
||||||
virtual void GenerateExpectedTargetsCode(std::ostream& os,
|
void GenerateExpectedTargetsCode(
|
||||||
const std::string& expectedTargets);
|
std::ostream& os, const std::string& expectedTargets) CM_OVERRIDE;
|
||||||
virtual void GenerateImportPropertyCode(std::ostream& os,
|
void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
|
||||||
const std::string& config,
|
cmGeneratorTarget const* target,
|
||||||
cmGeneratorTarget const* target,
|
ImportPropertyMap const& properties)
|
||||||
ImportPropertyMap const& properties);
|
CM_OVERRIDE;
|
||||||
virtual void GenerateMissingTargetsCheckCode(
|
void GenerateMissingTargetsCheckCode(
|
||||||
std::ostream& os, const std::vector<std::string>& missingTargets);
|
std::ostream& os,
|
||||||
virtual void GenerateInterfaceProperties(
|
const std::vector<std::string>& missingTargets) CM_OVERRIDE;
|
||||||
|
void GenerateInterfaceProperties(
|
||||||
cmGeneratorTarget const* target, std::ostream& os,
|
cmGeneratorTarget const* target, std::ostream& os,
|
||||||
const ImportPropertyMap& properties);
|
const ImportPropertyMap& properties) CM_OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -51,7 +51,8 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
|
|
||||||
if (args[0] == "PACKAGE") {
|
if (args[0] == "PACKAGE") {
|
||||||
return this->HandlePackage(args);
|
return this->HandlePackage(args);
|
||||||
} else if (args[0] == "EXPORT") {
|
}
|
||||||
|
if (args[0] == "EXPORT") {
|
||||||
this->ExportSetName.Follows(CM_NULLPTR);
|
this->ExportSetName.Follows(CM_NULLPTR);
|
||||||
this->ArgumentGroup.Follows(&this->ExportSetName);
|
this->ArgumentGroup.Follows(&this->ExportSetName);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -37,36 +37,37 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Implement virtual methods from the superclass.
|
// Implement virtual methods from the superclass.
|
||||||
virtual void GeneratePolicyHeaderCode(std::ostream&) {}
|
void GeneratePolicyHeaderCode(std::ostream&) CM_OVERRIDE {}
|
||||||
virtual void GeneratePolicyFooterCode(std::ostream&) {}
|
void GeneratePolicyFooterCode(std::ostream&) CM_OVERRIDE {}
|
||||||
virtual void GenerateImportHeaderCode(std::ostream& os,
|
void GenerateImportHeaderCode(std::ostream& os,
|
||||||
const std::string& config = "");
|
const std::string& config = "") CM_OVERRIDE;
|
||||||
virtual void GenerateImportFooterCode(std::ostream& os);
|
void GenerateImportFooterCode(std::ostream& os) CM_OVERRIDE;
|
||||||
virtual void GenerateImportTargetCode(std::ostream& os,
|
void GenerateImportTargetCode(std::ostream& os,
|
||||||
const cmGeneratorTarget* target);
|
const cmGeneratorTarget* target) CM_OVERRIDE;
|
||||||
virtual void GenerateExpectedTargetsCode(std::ostream& os,
|
void GenerateExpectedTargetsCode(
|
||||||
const std::string& expectedTargets);
|
std::ostream& os, const std::string& expectedTargets) CM_OVERRIDE;
|
||||||
virtual void GenerateImportPropertyCode(std::ostream& os,
|
void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
|
||||||
const std::string& config,
|
cmGeneratorTarget const* target,
|
||||||
cmGeneratorTarget const* target,
|
ImportPropertyMap const& properties)
|
||||||
ImportPropertyMap const& properties);
|
CM_OVERRIDE;
|
||||||
virtual void GenerateMissingTargetsCheckCode(
|
void GenerateMissingTargetsCheckCode(
|
||||||
std::ostream& os, const std::vector<std::string>& missingTargets);
|
std::ostream& os,
|
||||||
virtual void GenerateInterfaceProperties(
|
const std::vector<std::string>& missingTargets) CM_OVERRIDE;
|
||||||
|
void GenerateInterfaceProperties(
|
||||||
cmGeneratorTarget const* target, std::ostream& os,
|
cmGeneratorTarget const* target, std::ostream& os,
|
||||||
const ImportPropertyMap& properties);
|
const ImportPropertyMap& properties) CM_OVERRIDE;
|
||||||
virtual void GenerateImportPrefix(std::ostream& os);
|
void GenerateImportPrefix(std::ostream& os) CM_OVERRIDE;
|
||||||
virtual void LoadConfigFiles(std::ostream&);
|
void LoadConfigFiles(std::ostream&) CM_OVERRIDE;
|
||||||
virtual void GenerateRequiredCMakeVersion(std::ostream& os,
|
void GenerateRequiredCMakeVersion(std::ostream& os,
|
||||||
const char* versionString);
|
const char* versionString) CM_OVERRIDE;
|
||||||
virtual void CleanupTemporaryVariables(std::ostream&);
|
void CleanupTemporaryVariables(std::ostream&) CM_OVERRIDE;
|
||||||
virtual void GenerateImportedFileCheckLoop(std::ostream& os);
|
void GenerateImportedFileCheckLoop(std::ostream& os) CM_OVERRIDE;
|
||||||
virtual void GenerateImportedFileChecksCode(
|
void GenerateImportedFileChecksCode(
|
||||||
std::ostream& os, cmGeneratorTarget* target,
|
std::ostream& os, cmGeneratorTarget* target,
|
||||||
ImportPropertyMap const& properties,
|
ImportPropertyMap const& properties,
|
||||||
const std::set<std::string>& importedLocations);
|
const std::set<std::string>& importedLocations) CM_OVERRIDE;
|
||||||
virtual bool GenerateImportFileConfig(const std::string& config,
|
bool GenerateImportFileConfig(const std::string& config,
|
||||||
std::vector<std::string>&);
|
std::vector<std::string>&) CM_OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -64,7 +64,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
|
||||||
ap->SetCopyIfDifferent(true);
|
ap->SetCopyIfDifferent(true);
|
||||||
foutPtr = ap;
|
foutPtr = ap;
|
||||||
}
|
}
|
||||||
std::ostream& fout = *foutPtr.get();
|
std::ostream& fout = *foutPtr;
|
||||||
|
|
||||||
if (!fout) {
|
if (!fout) {
|
||||||
cmSystemTools::Error("Error Writing ", this->Filename.c_str());
|
cmSystemTools::Error("Error Writing ", this->Filename.c_str());
|
||||||
|
|
|
@ -108,7 +108,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
cmExternalMakefileProjectGenerator* CreateExternalMakefileProjectGenerator()
|
cmExternalMakefileProjectGenerator* CreateExternalMakefileProjectGenerator()
|
||||||
const
|
const CM_OVERRIDE
|
||||||
{
|
{
|
||||||
T* p = new T;
|
T* p = new T;
|
||||||
p->SetName(GetName());
|
p->SetName(GetName());
|
||||||
|
|
|
@ -104,19 +104,25 @@ bool cmFileCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
std::string subCommand = args[0];
|
std::string subCommand = args[0];
|
||||||
if (subCommand == "WRITE") {
|
if (subCommand == "WRITE") {
|
||||||
return this->HandleWriteCommand(args, false);
|
return this->HandleWriteCommand(args, false);
|
||||||
} else if (subCommand == "APPEND") {
|
}
|
||||||
|
if (subCommand == "APPEND") {
|
||||||
return this->HandleWriteCommand(args, true);
|
return this->HandleWriteCommand(args, true);
|
||||||
} else if (subCommand == "DOWNLOAD") {
|
}
|
||||||
|
if (subCommand == "DOWNLOAD") {
|
||||||
return this->HandleDownloadCommand(args);
|
return this->HandleDownloadCommand(args);
|
||||||
} else if (subCommand == "UPLOAD") {
|
}
|
||||||
|
if (subCommand == "UPLOAD") {
|
||||||
return this->HandleUploadCommand(args);
|
return this->HandleUploadCommand(args);
|
||||||
} else if (subCommand == "READ") {
|
}
|
||||||
|
if (subCommand == "READ") {
|
||||||
return this->HandleReadCommand(args);
|
return this->HandleReadCommand(args);
|
||||||
} else if (subCommand == "MD5" || subCommand == "SHA1" ||
|
}
|
||||||
subCommand == "SHA224" || subCommand == "SHA256" ||
|
if (subCommand == "MD5" || subCommand == "SHA1" || subCommand == "SHA224" ||
|
||||||
subCommand == "SHA384" || subCommand == "SHA512") {
|
subCommand == "SHA256" || subCommand == "SHA384" ||
|
||||||
|
subCommand == "SHA512") {
|
||||||
return this->HandleHashCommand(args);
|
return this->HandleHashCommand(args);
|
||||||
} else if (subCommand == "STRINGS") {
|
}
|
||||||
|
if (subCommand == "STRINGS") {
|
||||||
return this->HandleStringsCommand(args);
|
return this->HandleStringsCommand(args);
|
||||||
} else if (subCommand == "GLOB") {
|
} else if (subCommand == "GLOB") {
|
||||||
return this->HandleGlobCommand(args, false);
|
return this->HandleGlobCommand(args, false);
|
||||||
|
@ -594,8 +600,9 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
|
||||||
// how many octets are there?
|
// how many octets are there?
|
||||||
unsigned int num_utf8_bytes = 0;
|
unsigned int num_utf8_bytes = 0;
|
||||||
for (unsigned int j = 0; num_utf8_bytes == 0 && j < 3; j++) {
|
for (unsigned int j = 0; num_utf8_bytes == 0 && j < 3; j++) {
|
||||||
if ((c & utf8_check_table[j][0]) == utf8_check_table[j][1])
|
if ((c & utf8_check_table[j][0]) == utf8_check_table[j][1]) {
|
||||||
num_utf8_bytes = j + 2;
|
num_utf8_bytes = j + 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get subsequent octets and check that they are valid
|
// get subsequent octets and check that they are valid
|
||||||
|
@ -1408,11 +1415,14 @@ bool cmFileCopier::Install(const char* fromFile, const char* toFile)
|
||||||
|
|
||||||
if (cmSystemTools::SameFile(fromFile, toFile)) {
|
if (cmSystemTools::SameFile(fromFile, toFile)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (cmSystemTools::FileIsSymlink(fromFile)) {
|
}
|
||||||
|
if (cmSystemTools::FileIsSymlink(fromFile)) {
|
||||||
return this->InstallSymlink(fromFile, toFile);
|
return this->InstallSymlink(fromFile, toFile);
|
||||||
} else if (cmSystemTools::FileIsDirectory(fromFile)) {
|
}
|
||||||
|
if (cmSystemTools::FileIsDirectory(fromFile)) {
|
||||||
return this->InstallDirectory(fromFile, toFile, match_properties);
|
return this->InstallDirectory(fromFile, toFile, match_properties);
|
||||||
} else if (cmSystemTools::FileExists(fromFile)) {
|
}
|
||||||
|
if (cmSystemTools::FileExists(fromFile)) {
|
||||||
return this->InstallFile(fromFile, toFile, match_properties);
|
return this->InstallFile(fromFile, toFile, match_properties);
|
||||||
}
|
}
|
||||||
return this->ReportMissing(fromFile);
|
return this->ReportMissing(fromFile);
|
||||||
|
@ -3129,20 +3139,20 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
|
||||||
if (i >= args.size()) {
|
if (i >= args.size()) {
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, merr);
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, merr);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
if (args[i] == "FUNCTION") {
|
|
||||||
guard = GUARD_FUNCTION;
|
|
||||||
} else if (args[i] == "FILE") {
|
|
||||||
guard = GUARD_FILE;
|
|
||||||
} else if (args[i] == "PROCESS") {
|
|
||||||
guard = GUARD_PROCESS;
|
|
||||||
} else {
|
|
||||||
std::ostringstream e;
|
|
||||||
e << merr << ", but got:\n \"" << args[i] << "\".";
|
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (args[i] == "FUNCTION") {
|
||||||
|
guard = GUARD_FUNCTION;
|
||||||
|
} else if (args[i] == "FILE") {
|
||||||
|
guard = GUARD_FILE;
|
||||||
|
} else if (args[i] == "PROCESS") {
|
||||||
|
guard = GUARD_PROCESS;
|
||||||
|
} else {
|
||||||
|
std::ostringstream e;
|
||||||
|
e << merr << ", but got:\n \"" << args[i] << "\".";
|
||||||
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (args[i] == "RESULT_VARIABLE") {
|
} else if (args[i] == "RESULT_VARIABLE") {
|
||||||
++i;
|
++i;
|
||||||
if (i >= args.size()) {
|
if (i >= args.size()) {
|
||||||
|
@ -3259,7 +3269,8 @@ bool cmFileCommand::HandleTimestampCommand(
|
||||||
if (args.size() < 3) {
|
if (args.size() < 3) {
|
||||||
this->SetError("sub-command TIMESTAMP requires at least two arguments.");
|
this->SetError("sub-command TIMESTAMP requires at least two arguments.");
|
||||||
return false;
|
return false;
|
||||||
} else if (args.size() > 5) {
|
}
|
||||||
|
if (args.size() > 5) {
|
||||||
this->SetError("sub-command TIMESTAMP takes at most four arguments.");
|
this->SetError("sub-command TIMESTAMP takes at most four arguments.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,8 @@ cmFileLockResult cmFileLock::Release()
|
||||||
|
|
||||||
if (lockResult == 0) {
|
if (lockResult == 0) {
|
||||||
return cmFileLockResult::MakeOk();
|
return cmFileLockResult::MakeOk();
|
||||||
} else {
|
|
||||||
return cmFileLockResult::MakeSystem();
|
|
||||||
}
|
}
|
||||||
|
return cmFileLockResult::MakeSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmFileLockResult cmFileLock::OpenFile()
|
cmFileLockResult cmFileLock::OpenFile()
|
||||||
|
@ -47,18 +46,16 @@ cmFileLockResult cmFileLock::OpenFile()
|
||||||
this->File = ::open(this->Filename.c_str(), O_RDWR);
|
this->File = ::open(this->Filename.c_str(), O_RDWR);
|
||||||
if (this->File == -1) {
|
if (this->File == -1) {
|
||||||
return cmFileLockResult::MakeSystem();
|
return cmFileLockResult::MakeSystem();
|
||||||
} else {
|
|
||||||
return cmFileLockResult::MakeOk();
|
|
||||||
}
|
}
|
||||||
|
return cmFileLockResult::MakeOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmFileLockResult cmFileLock::LockWithoutTimeout()
|
cmFileLockResult cmFileLock::LockWithoutTimeout()
|
||||||
{
|
{
|
||||||
if (this->LockFile(F_SETLKW, F_WRLCK) == -1) {
|
if (this->LockFile(F_SETLKW, F_WRLCK) == -1) {
|
||||||
return cmFileLockResult::MakeSystem();
|
return cmFileLockResult::MakeSystem();
|
||||||
} else {
|
|
||||||
return cmFileLockResult::MakeOk();
|
|
||||||
}
|
}
|
||||||
|
return cmFileLockResult::MakeOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmFileLockResult cmFileLock::LockWithTimeout(unsigned long seconds)
|
cmFileLockResult cmFileLock::LockWithTimeout(unsigned long seconds)
|
||||||
|
|
|
@ -321,7 +321,8 @@ bool cmFindBase::CheckForVariableInCache()
|
||||||
this->AlreadyInCacheWithoutMetaInfo = true;
|
this->AlreadyInCacheWithoutMetaInfo = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (cached) {
|
}
|
||||||
|
if (cached) {
|
||||||
const char* hs =
|
const char* hs =
|
||||||
state->GetCacheEntryProperty(this->VariableName, "HELPSTRING");
|
state->GetCacheEntryProperty(this->VariableName, "HELPSTRING");
|
||||||
this->VariableDocumentation = hs ? hs : "(none)";
|
this->VariableDocumentation = hs ? hs : "(none)";
|
||||||
|
|
|
@ -378,9 +378,8 @@ std::string cmFindLibraryCommand::FindNormalLibrary()
|
||||||
{
|
{
|
||||||
if (this->NamesPerDir) {
|
if (this->NamesPerDir) {
|
||||||
return this->FindNormalLibraryNamesPerDir();
|
return this->FindNormalLibraryNamesPerDir();
|
||||||
} else {
|
|
||||||
return this->FindNormalLibraryDirsPerName();
|
|
||||||
}
|
}
|
||||||
|
return this->FindNormalLibraryDirsPerName();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir()
|
std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir()
|
||||||
|
@ -428,9 +427,8 @@ std::string cmFindLibraryCommand::FindFrameworkLibrary()
|
||||||
{
|
{
|
||||||
if (this->NamesPerDir) {
|
if (this->NamesPerDir) {
|
||||||
return this->FindFrameworkLibraryNamesPerDir();
|
return this->FindFrameworkLibraryNamesPerDir();
|
||||||
} else {
|
|
||||||
return this->FindFrameworkLibraryDirsPerName();
|
|
||||||
}
|
}
|
||||||
|
return this->FindFrameworkLibraryDirsPerName();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmFindLibraryCommand::FindFrameworkLibraryNamesPerDir()
|
std::string cmFindLibraryCommand::FindFrameworkLibraryNamesPerDir()
|
||||||
|
|
|
@ -1308,18 +1308,16 @@ bool cmFindPackageCommand::CheckPackageRegistryEntry(const std::string& fname,
|
||||||
outPaths.AddPath(fname);
|
outPaths.AddPath(fname);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// The path does not exist. Assume the stream content is
|
|
||||||
// associated with an old package that no longer exists, and
|
|
||||||
// delete it to keep the package registry clean.
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
// The path does not exist. Assume the stream content is
|
||||||
// The first line in the stream is not the full path to a file or
|
// associated with an old package that no longer exists, and
|
||||||
// directory. Assume the stream content was created by a future
|
// delete it to keep the package registry clean.
|
||||||
// version of CMake that uses a different format, and leave it.
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
// The first line in the stream is not the full path to a file or
|
||||||
|
// directory. Assume the stream content was created by a future
|
||||||
|
// version of CMake that uses a different format, and leave it.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmFindPackageCommand::FillPrefixesCMakeSystemVariable()
|
void cmFindPackageCommand::FillPrefixesCMakeSystemVariable()
|
||||||
|
@ -1628,9 +1626,8 @@ private:
|
||||||
{
|
{
|
||||||
if (this->UseSuffixes) {
|
if (this->UseSuffixes) {
|
||||||
return this->FPC->SearchDirectory(fullPath);
|
return this->FPC->SearchDirectory(fullPath);
|
||||||
} else {
|
|
||||||
return this->FPC->CheckDirectory(fullPath);
|
|
||||||
}
|
}
|
||||||
|
return this->FPC->CheckDirectory(fullPath);
|
||||||
}
|
}
|
||||||
cmFindPackageCommand* FPC;
|
cmFindPackageCommand* FPC;
|
||||||
bool UseSuffixes;
|
bool UseSuffixes;
|
||||||
|
@ -1653,9 +1650,8 @@ bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
|
||||||
{
|
{
|
||||||
if (this->Next.get()) {
|
if (this->Next.get()) {
|
||||||
return this->Next->Search(fullPath + "/", listing);
|
return this->Next->Search(fullPath + "/", listing);
|
||||||
} else {
|
|
||||||
return listing.Visit(fullPath + "/");
|
|
||||||
}
|
}
|
||||||
|
return listing.Visit(fullPath + "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
class cmFileListGeneratorFixed : public cmFileListGeneratorBase
|
class cmFileListGeneratorFixed : public cmFileListGeneratorBase
|
||||||
|
|
|
@ -136,9 +136,8 @@ std::string cmFindPathCommand::FindNormalHeader()
|
||||||
if (cmSystemTools::FileExists(tryPath.c_str())) {
|
if (cmSystemTools::FileExists(tryPath.c_str())) {
|
||||||
if (this->IncludeFileInPath) {
|
if (this->IncludeFileInPath) {
|
||||||
return tryPath;
|
return tryPath;
|
||||||
} else {
|
|
||||||
return *p;
|
|
||||||
}
|
}
|
||||||
|
return *p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,9 +140,8 @@ std::string cmFindProgramCommand::FindNormalProgram()
|
||||||
{
|
{
|
||||||
if (this->NamesPerDir) {
|
if (this->NamesPerDir) {
|
||||||
return this->FindNormalProgramNamesPerDir();
|
return this->FindNormalProgramNamesPerDir();
|
||||||
} else {
|
|
||||||
return this->FindNormalProgramDirsPerName();
|
|
||||||
}
|
}
|
||||||
|
return this->FindNormalProgramDirsPerName();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmFindProgramCommand::FindNormalProgramNamesPerDir()
|
std::string cmFindProgramCommand::FindNormalProgramNamesPerDir()
|
||||||
|
|
|
@ -81,10 +81,9 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
|
||||||
// restore the variable to its prior value
|
// restore the variable to its prior value
|
||||||
mf.AddDefinition(this->Args[0], oldDef.c_str());
|
mf.AddDefinition(this->Args[0], oldDef.c_str());
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// close out a nested foreach
|
|
||||||
this->Depth--;
|
|
||||||
}
|
}
|
||||||
|
// close out a nested foreach
|
||||||
|
this->Depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// record the command
|
// record the command
|
||||||
|
|
|
@ -169,10 +169,9 @@ bool cmFunctionFunctionBlocker::IsFunctionBlocked(
|
||||||
// remove the function blocker now that the function is defined
|
// remove the function blocker now that the function is defined
|
||||||
mf.RemoveFunctionBlocker(this, lff);
|
mf.RemoveFunctionBlocker(this, lff);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// decrement for each nested function that ends
|
|
||||||
this->Depth--;
|
|
||||||
}
|
}
|
||||||
|
// decrement for each nested function that ends
|
||||||
|
this->Depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it wasn't an endfunction and we are not executing then we must be
|
// if it wasn't an endfunction and we are not executing then we must be
|
||||||
|
|
|
@ -252,19 +252,17 @@ bool cmGetPropertyCommand::HandleTargetMode()
|
||||||
if (this->PropertyName == "ALIASED_TARGET") {
|
if (this->PropertyName == "ALIASED_TARGET") {
|
||||||
if (this->Makefile->IsAlias(this->Name)) {
|
if (this->Makefile->IsAlias(this->Name)) {
|
||||||
return this->StoreResult(target->GetName().c_str());
|
return this->StoreResult(target->GetName().c_str());
|
||||||
} else {
|
|
||||||
return this->StoreResult(NULL);
|
|
||||||
}
|
}
|
||||||
|
return this->StoreResult(CM_NULLPTR);
|
||||||
}
|
}
|
||||||
return this->StoreResult(
|
return this->StoreResult(
|
||||||
target->GetProperty(this->PropertyName, this->Makefile));
|
target->GetProperty(this->PropertyName, this->Makefile));
|
||||||
} else {
|
|
||||||
std::ostringstream e;
|
|
||||||
e << "could not find TARGET " << this->Name
|
|
||||||
<< ". Perhaps it has not yet been created.";
|
|
||||||
this->SetError(e.str());
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
std::ostringstream e;
|
||||||
|
e << "could not find TARGET " << this->Name
|
||||||
|
<< ". Perhaps it has not yet been created.";
|
||||||
|
this->SetError(e.str());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmGetPropertyCommand::HandleSourceMode()
|
bool cmGetPropertyCommand::HandleSourceMode()
|
||||||
|
@ -277,13 +275,11 @@ bool cmGetPropertyCommand::HandleSourceMode()
|
||||||
// Get the source file.
|
// Get the source file.
|
||||||
if (cmSourceFile* sf = this->Makefile->GetOrCreateSource(this->Name)) {
|
if (cmSourceFile* sf = this->Makefile->GetOrCreateSource(this->Name)) {
|
||||||
return this->StoreResult(sf->GetPropertyForUser(this->PropertyName));
|
return this->StoreResult(sf->GetPropertyForUser(this->PropertyName));
|
||||||
} else {
|
|
||||||
std::ostringstream e;
|
|
||||||
e << "given SOURCE name that could not be found or created: "
|
|
||||||
<< this->Name;
|
|
||||||
this->SetError(e.str());
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
std::ostringstream e;
|
||||||
|
e << "given SOURCE name that could not be found or created: " << this->Name;
|
||||||
|
this->SetError(e.str());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmGetPropertyCommand::HandleTestMode()
|
bool cmGetPropertyCommand::HandleTestMode()
|
||||||
|
@ -347,11 +343,9 @@ bool cmGetPropertyCommand::HandleInstallMode()
|
||||||
bool isSet = file->GetProperty(this->PropertyName, value);
|
bool isSet = file->GetProperty(this->PropertyName, value);
|
||||||
|
|
||||||
return this->StoreResult(isSet ? value.c_str() : CM_NULLPTR);
|
return this->StoreResult(isSet ? value.c_str() : CM_NULLPTR);
|
||||||
} else {
|
|
||||||
std::ostringstream e;
|
|
||||||
e << "given INSTALL name that could not be found or created: "
|
|
||||||
<< this->Name;
|
|
||||||
this->SetError(e.str());
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
std::ostringstream e;
|
||||||
|
e << "given INSTALL name that could not be found or created: " << this->Name;
|
||||||
|
this->SetError(e.str());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,8 @@ static bool ConvertMotorolaSrecLine(const char* buf, FILE* outFile)
|
||||||
if ((buf[1] == '5') || (buf[1] == '7') || (buf[1] == '8') ||
|
if ((buf[1] == '5') || (buf[1] == '7') || (buf[1] == '8') ||
|
||||||
(buf[1] == '9')) {
|
(buf[1] == '9')) {
|
||||||
return true;
|
return true;
|
||||||
} else if (buf[1] == '1') {
|
}
|
||||||
|
if (buf[1] == '1') {
|
||||||
dataStart = 8;
|
dataStart = 8;
|
||||||
} else if (buf[1] == '2') {
|
} else if (buf[1] == '2') {
|
||||||
dataStart = 10;
|
dataStart = 10;
|
||||||
|
|
|
@ -190,9 +190,8 @@ bool cmIfCommand::InvokeInitialPass(
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, err);
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, err);
|
||||||
cmSystemTools::SetFatalErrorOccured();
|
cmSystemTools::SetFatalErrorOccured();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
this->Makefile->IssueMessage(status, err);
|
|
||||||
}
|
}
|
||||||
|
this->Makefile->IssueMessage(status, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmIfFunctionBlocker* f = new cmIfFunctionBlocker();
|
cmIfFunctionBlocker* f = new cmIfFunctionBlocker();
|
||||||
|
|
|
@ -71,19 +71,26 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
// Switch among the command modes.
|
// Switch among the command modes.
|
||||||
if (args[0] == "SCRIPT") {
|
if (args[0] == "SCRIPT") {
|
||||||
return this->HandleScriptMode(args);
|
return this->HandleScriptMode(args);
|
||||||
} else if (args[0] == "CODE") {
|
}
|
||||||
|
if (args[0] == "CODE") {
|
||||||
return this->HandleScriptMode(args);
|
return this->HandleScriptMode(args);
|
||||||
} else if (args[0] == "TARGETS") {
|
}
|
||||||
|
if (args[0] == "TARGETS") {
|
||||||
return this->HandleTargetsMode(args);
|
return this->HandleTargetsMode(args);
|
||||||
} else if (args[0] == "FILES") {
|
}
|
||||||
|
if (args[0] == "FILES") {
|
||||||
return this->HandleFilesMode(args);
|
return this->HandleFilesMode(args);
|
||||||
} else if (args[0] == "PROGRAMS") {
|
}
|
||||||
|
if (args[0] == "PROGRAMS") {
|
||||||
return this->HandleFilesMode(args);
|
return this->HandleFilesMode(args);
|
||||||
} else if (args[0] == "DIRECTORY") {
|
}
|
||||||
|
if (args[0] == "DIRECTORY") {
|
||||||
return this->HandleDirectoryMode(args);
|
return this->HandleDirectoryMode(args);
|
||||||
} else if (args[0] == "EXPORT") {
|
}
|
||||||
|
if (args[0] == "EXPORT") {
|
||||||
return this->HandleExportMode(args);
|
return this->HandleExportMode(args);
|
||||||
} else if (args[0] == "EXPORT_ANDROID_MK") {
|
}
|
||||||
|
if (args[0] == "EXPORT_ANDROID_MK") {
|
||||||
return this->HandleExportAndroidMKMode(args);
|
return this->HandleExportAndroidMKMode(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +347,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
|
||||||
<< "\" which is not an executable, library, or module.";
|
<< "\" which is not an executable, library, or module.";
|
||||||
this->SetError(e.str());
|
this->SetError(e.str());
|
||||||
return false;
|
return false;
|
||||||
} else if (target->GetType() == cmState::OBJECT_LIBRARY) {
|
}
|
||||||
|
if (target->GetType() == cmState::OBJECT_LIBRARY) {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "TARGETS given OBJECT library \"" << (*targetIt)
|
e << "TARGETS given OBJECT library \"" << (*targetIt)
|
||||||
<< "\" which may not be installed.";
|
<< "\" which may not be installed.";
|
||||||
|
@ -1110,7 +1118,7 @@ bool cmInstallCommand::HandleExportAndroidMKMode(
|
||||||
cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES",
|
cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES",
|
||||||
&ica.ArgumentGroup);
|
&ica.ArgumentGroup);
|
||||||
cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup);
|
cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup);
|
||||||
exp.Follows(0);
|
exp.Follows(CM_NULLPTR);
|
||||||
|
|
||||||
ica.ArgumentGroup.Follows(&exp);
|
ica.ArgumentGroup.Follows(&exp);
|
||||||
std::vector<std::string> unknownArgs;
|
std::vector<std::string> unknownArgs;
|
||||||
|
|
|
@ -143,12 +143,12 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const
|
||||||
if (cmSystemTools::FileExists(tb.c_str())) {
|
if (cmSystemTools::FileExists(tb.c_str())) {
|
||||||
// The file exists in the binary tree. Use it.
|
// The file exists in the binary tree. Use it.
|
||||||
return tb;
|
return tb;
|
||||||
} else if (cmSystemTools::FileExists(ts.c_str())) {
|
}
|
||||||
|
if (cmSystemTools::FileExists(ts.c_str())) {
|
||||||
// The file exists in the source tree. Use it.
|
// The file exists in the source tree. Use it.
|
||||||
return ts;
|
return ts;
|
||||||
} else {
|
|
||||||
// The file doesn't exist. Assume it will be present in the
|
|
||||||
// binary tree when the install occurs.
|
|
||||||
return tb;
|
|
||||||
}
|
}
|
||||||
|
// The file doesn't exist. Assume it will be present in the
|
||||||
|
// binary tree when the install occurs.
|
||||||
|
return tb;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,12 +113,12 @@ std::string cmInstallProgramsCommand::FindInstallSource(const char* name) const
|
||||||
if (cmSystemTools::FileExists(tb.c_str())) {
|
if (cmSystemTools::FileExists(tb.c_str())) {
|
||||||
// The file exists in the binary tree. Use it.
|
// The file exists in the binary tree. Use it.
|
||||||
return tb;
|
return tb;
|
||||||
} else if (cmSystemTools::FileExists(ts.c_str())) {
|
}
|
||||||
|
if (cmSystemTools::FileExists(ts.c_str())) {
|
||||||
// The file exists in the source tree. Use it.
|
// The file exists in the source tree. Use it.
|
||||||
return ts;
|
return ts;
|
||||||
} else {
|
|
||||||
// The file doesn't exist. Assume it will be present in the
|
|
||||||
// binary tree when the install occurs.
|
|
||||||
return tb;
|
|
||||||
}
|
}
|
||||||
|
// The file doesn't exist. Assume it will be present in the
|
||||||
|
// binary tree when the install occurs.
|
||||||
|
return tb;
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,10 +203,9 @@ bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
|
||||||
// remove the function blocker now that the macro is defined
|
// remove the function blocker now that the macro is defined
|
||||||
mf.RemoveFunctionBlocker(this, lff);
|
mf.RemoveFunctionBlocker(this, lff);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// decrement for each nested macro that ends
|
|
||||||
this->Depth--;
|
|
||||||
}
|
}
|
||||||
|
// decrement for each nested macro that ends
|
||||||
|
this->Depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it wasn't an endmacro and we are not executing then we must be
|
// if it wasn't an endmacro and we are not executing then we must be
|
||||||
|
|
|
@ -336,7 +336,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
|
||||||
std::string targetOutputReal =
|
std::string targetOutputReal =
|
||||||
this->ConvertToNinjaPath(gt.GetFullPath(cfgName,
|
this->ConvertToNinjaPath(gt.GetFullPath(cfgName,
|
||||||
/*implib=*/false,
|
/*implib=*/false,
|
||||||
/*realpath=*/true));
|
/*realname=*/true));
|
||||||
cmakeCommand += targetOutputReal;
|
cmakeCommand += targetOutputReal;
|
||||||
cmakeCommand += " || true";
|
cmakeCommand += " || true";
|
||||||
linkCmds.push_back(cmakeCommand);
|
linkCmds.push_back(cmakeCommand);
|
||||||
|
@ -414,7 +414,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
||||||
std::string targetOutputReal =
|
std::string targetOutputReal =
|
||||||
ConvertToNinjaPath(gt.GetFullPath(cfgName,
|
ConvertToNinjaPath(gt.GetFullPath(cfgName,
|
||||||
/*implib=*/false,
|
/*implib=*/false,
|
||||||
/*realpath=*/true));
|
/*realname=*/true));
|
||||||
std::string targetOutputImplib =
|
std::string targetOutputImplib =
|
||||||
ConvertToNinjaPath(gt.GetFullPath(cfgName,
|
ConvertToNinjaPath(gt.GetFullPath(cfgName,
|
||||||
/*implib=*/true));
|
/*implib=*/true));
|
||||||
|
|
|
@ -307,10 +307,10 @@ protected:
|
||||||
// If dependencies are already done, stop now.
|
// If dependencies are already done, stop now.
|
||||||
if (info->DependDone) {
|
if (info->DependDone) {
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
// Make sure we don't visit the same file more than once.
|
|
||||||
info->DependDone = true;
|
|
||||||
}
|
}
|
||||||
|
// Make sure we don't visit the same file more than once.
|
||||||
|
info->DependDone = true;
|
||||||
|
|
||||||
const char* path = info->FullPath.c_str();
|
const char* path = info->FullPath.c_str();
|
||||||
if (!path) {
|
if (!path) {
|
||||||
cmSystemTools::Error(
|
cmSystemTools::Error(
|
||||||
|
@ -405,15 +405,14 @@ protected:
|
||||||
if (result != this->DependInformationMap.end()) {
|
if (result != this->DependInformationMap.end()) {
|
||||||
// Found an instance, return it.
|
// Found an instance, return it.
|
||||||
return result->second;
|
return result->second;
|
||||||
} else {
|
|
||||||
// Didn't find an instance. Create a new one and save it.
|
|
||||||
cmDependInformation* info = new cmDependInformation;
|
|
||||||
info->FullPath = fullPath;
|
|
||||||
info->PathOnly = cmSystemTools::GetFilenamePath(fullPath);
|
|
||||||
info->IncludeName = file;
|
|
||||||
this->DependInformationMap[fullPath] = info;
|
|
||||||
return info;
|
|
||||||
}
|
}
|
||||||
|
// Didn't find an instance. Create a new one and save it.
|
||||||
|
cmDependInformation* info = new cmDependInformation;
|
||||||
|
info->FullPath = fullPath;
|
||||||
|
info->PathOnly = cmSystemTools::GetFilenamePath(fullPath);
|
||||||
|
info->IncludeName = file;
|
||||||
|
this->DependInformationMap[fullPath] = info;
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -124,9 +124,8 @@ static std::string cmSearchPathStripBin(std::string const& s)
|
||||||
// If the path is a PREFIX/bin case then add its parent instead.
|
// If the path is a PREFIX/bin case then add its parent instead.
|
||||||
if ((cmHasLiteralSuffix(s, "/bin")) || (cmHasLiteralSuffix(s, "/sbin"))) {
|
if ((cmHasLiteralSuffix(s, "/bin")) || (cmHasLiteralSuffix(s, "/sbin"))) {
|
||||||
return cmSystemTools::GetFilenamePath(s);
|
return cmSystemTools::GetFilenamePath(s);
|
||||||
} else {
|
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmSearchPath::AddEnvPrefixPath(const std::string& variable, bool stripBin)
|
void cmSearchPath::AddEnvPrefixPath(const std::string& variable, bool stripBin)
|
||||||
|
|
|
@ -59,7 +59,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
}
|
}
|
||||||
// SET (VAR PARENT_SCOPE) // Removes the definition of VAR
|
// SET (VAR PARENT_SCOPE) // Removes the definition of VAR
|
||||||
// in the parent scope.
|
// in the parent scope.
|
||||||
else if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") {
|
if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") {
|
||||||
this->Makefile->RaiseScope(variable, CM_NULLPTR);
|
this->Makefile->RaiseScope(variable, CM_NULLPTR);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,8 @@ bool cmSetDirectoryPropertiesCommand::RunCommand(
|
||||||
if (prop == "VARIABLES") {
|
if (prop == "VARIABLES") {
|
||||||
errors = "Variables and cache variables should be set using SET command";
|
errors = "Variables and cache variables should be set using SET command";
|
||||||
return false;
|
return false;
|
||||||
} else if (prop == "MACROS") {
|
}
|
||||||
|
if (prop == "MACROS") {
|
||||||
errors = "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
|
errors = "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,43 +34,61 @@ bool cmStringCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
const std::string& subCommand = args[0];
|
const std::string& subCommand = args[0];
|
||||||
if (subCommand == "REGEX") {
|
if (subCommand == "REGEX") {
|
||||||
return this->HandleRegexCommand(args);
|
return this->HandleRegexCommand(args);
|
||||||
} else if (subCommand == "REPLACE") {
|
}
|
||||||
|
if (subCommand == "REPLACE") {
|
||||||
return this->HandleReplaceCommand(args);
|
return this->HandleReplaceCommand(args);
|
||||||
} else if (subCommand == "MD5" || subCommand == "SHA1" ||
|
}
|
||||||
subCommand == "SHA224" || subCommand == "SHA256" ||
|
if (subCommand == "MD5" || subCommand == "SHA1" || subCommand == "SHA224" ||
|
||||||
subCommand == "SHA384" || subCommand == "SHA512") {
|
subCommand == "SHA256" || subCommand == "SHA384" ||
|
||||||
|
subCommand == "SHA512") {
|
||||||
return this->HandleHashCommand(args);
|
return this->HandleHashCommand(args);
|
||||||
} else if (subCommand == "TOLOWER") {
|
}
|
||||||
|
if (subCommand == "TOLOWER") {
|
||||||
return this->HandleToUpperLowerCommand(args, false);
|
return this->HandleToUpperLowerCommand(args, false);
|
||||||
} else if (subCommand == "TOUPPER") {
|
}
|
||||||
|
if (subCommand == "TOUPPER") {
|
||||||
return this->HandleToUpperLowerCommand(args, true);
|
return this->HandleToUpperLowerCommand(args, true);
|
||||||
} else if (subCommand == "COMPARE") {
|
}
|
||||||
|
if (subCommand == "COMPARE") {
|
||||||
return this->HandleCompareCommand(args);
|
return this->HandleCompareCommand(args);
|
||||||
} else if (subCommand == "ASCII") {
|
}
|
||||||
|
if (subCommand == "ASCII") {
|
||||||
return this->HandleAsciiCommand(args);
|
return this->HandleAsciiCommand(args);
|
||||||
} else if (subCommand == "CONFIGURE") {
|
}
|
||||||
|
if (subCommand == "CONFIGURE") {
|
||||||
return this->HandleConfigureCommand(args);
|
return this->HandleConfigureCommand(args);
|
||||||
} else if (subCommand == "LENGTH") {
|
}
|
||||||
|
if (subCommand == "LENGTH") {
|
||||||
return this->HandleLengthCommand(args);
|
return this->HandleLengthCommand(args);
|
||||||
} else if (subCommand == "APPEND") {
|
}
|
||||||
|
if (subCommand == "APPEND") {
|
||||||
return this->HandleAppendCommand(args);
|
return this->HandleAppendCommand(args);
|
||||||
} else if (subCommand == "CONCAT") {
|
}
|
||||||
|
if (subCommand == "CONCAT") {
|
||||||
return this->HandleConcatCommand(args);
|
return this->HandleConcatCommand(args);
|
||||||
} else if (subCommand == "SUBSTRING") {
|
}
|
||||||
|
if (subCommand == "SUBSTRING") {
|
||||||
return this->HandleSubstringCommand(args);
|
return this->HandleSubstringCommand(args);
|
||||||
} else if (subCommand == "STRIP") {
|
}
|
||||||
|
if (subCommand == "STRIP") {
|
||||||
return this->HandleStripCommand(args);
|
return this->HandleStripCommand(args);
|
||||||
} else if (subCommand == "RANDOM") {
|
}
|
||||||
|
if (subCommand == "RANDOM") {
|
||||||
return this->HandleRandomCommand(args);
|
return this->HandleRandomCommand(args);
|
||||||
} else if (subCommand == "FIND") {
|
}
|
||||||
|
if (subCommand == "FIND") {
|
||||||
return this->HandleFindCommand(args);
|
return this->HandleFindCommand(args);
|
||||||
} else if (subCommand == "TIMESTAMP") {
|
}
|
||||||
|
if (subCommand == "TIMESTAMP") {
|
||||||
return this->HandleTimestampCommand(args);
|
return this->HandleTimestampCommand(args);
|
||||||
} else if (subCommand == "MAKE_C_IDENTIFIER") {
|
}
|
||||||
|
if (subCommand == "MAKE_C_IDENTIFIER") {
|
||||||
return this->HandleMakeCIdentifierCommand(args);
|
return this->HandleMakeCIdentifierCommand(args);
|
||||||
} else if (subCommand == "GENEX_STRIP") {
|
}
|
||||||
|
if (subCommand == "GENEX_STRIP") {
|
||||||
return this->HandleGenexStripCommand(args);
|
return this->HandleGenexStripCommand(args);
|
||||||
} else if (subCommand == "UUID") {
|
}
|
||||||
|
if (subCommand == "UUID") {
|
||||||
return this->HandleUuidCommand(args);
|
return this->HandleUuidCommand(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +176,8 @@ bool cmStringCommand::HandleConfigureCommand(
|
||||||
if (args.size() < 2) {
|
if (args.size() < 2) {
|
||||||
this->SetError("No input string specified.");
|
this->SetError("No input string specified.");
|
||||||
return false;
|
return false;
|
||||||
} else if (args.size() < 3) {
|
}
|
||||||
|
if (args.size() < 3) {
|
||||||
this->SetError("No output variable specified.");
|
this->SetError("No output variable specified.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -203,14 +222,16 @@ bool cmStringCommand::HandleRegexCommand(std::vector<std::string> const& args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return this->RegexMatch(args);
|
return this->RegexMatch(args);
|
||||||
} else if (mode == "MATCHALL") {
|
}
|
||||||
|
if (mode == "MATCHALL") {
|
||||||
if (args.size() < 5) {
|
if (args.size() < 5) {
|
||||||
this->SetError("sub-command REGEX, mode MATCHALL needs "
|
this->SetError("sub-command REGEX, mode MATCHALL needs "
|
||||||
"at least 5 arguments total to command.");
|
"at least 5 arguments total to command.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return this->RegexMatchAll(args);
|
return this->RegexMatchAll(args);
|
||||||
} else if (mode == "REPLACE") {
|
}
|
||||||
|
if (mode == "REPLACE") {
|
||||||
if (args.size() < 6) {
|
if (args.size() < 6) {
|
||||||
this->SetError("sub-command REGEX, mode REPLACE needs "
|
this->SetError("sub-command REGEX, mode REPLACE needs "
|
||||||
"at least 6 arguments total to command.");
|
"at least 6 arguments total to command.");
|
||||||
|
@ -785,7 +806,8 @@ bool cmStringCommand::HandleTimestampCommand(
|
||||||
if (args.size() < 2) {
|
if (args.size() < 2) {
|
||||||
this->SetError("sub-command TIMESTAMP requires at least one argument.");
|
this->SetError("sub-command TIMESTAMP requires at least one argument.");
|
||||||
return false;
|
return false;
|
||||||
} else if (args.size() > 4) {
|
}
|
||||||
|
if (args.size() > 4) {
|
||||||
this->SetError("sub-command TIMESTAMP takes at most three arguments.");
|
this->SetError("sub-command TIMESTAMP takes at most three arguments.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,10 +353,9 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
|
||||||
"INTERFACE_LINK_LIBRARIES",
|
"INTERFACE_LINK_LIBRARIES",
|
||||||
this->Target->GetDebugGeneratorExpressions(lib, llt).c_str());
|
this->Target->GetDebugGeneratorExpressions(lib, llt).c_str());
|
||||||
return true;
|
return true;
|
||||||
} else if (this->CurrentProcessingState !=
|
}
|
||||||
ProcessingKeywordPublicInterface &&
|
if (this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
|
||||||
this->CurrentProcessingState !=
|
this->CurrentProcessingState != ProcessingPlainPublicInterface) {
|
||||||
ProcessingPlainPublicInterface) {
|
|
||||||
if (this->Target->GetType() == cmState::STATIC_LIBRARY) {
|
if (this->Target->GetType() == cmState::STATIC_LIBRARY) {
|
||||||
std::string configLib =
|
std::string configLib =
|
||||||
this->Target->GetDebugGeneratorExpressions(lib, llt);
|
this->Target->GetDebugGeneratorExpressions(lib, llt);
|
||||||
|
|
|
@ -36,23 +36,21 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// unset(VAR)
|
// unset(VAR)
|
||||||
else if (args.size() == 1) {
|
if (args.size() == 1) {
|
||||||
this->Makefile->RemoveDefinition(variable);
|
this->Makefile->RemoveDefinition(variable);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// unset(VAR CACHE)
|
// unset(VAR CACHE)
|
||||||
else if ((args.size() == 2) && (args[1] == "CACHE")) {
|
if ((args.size() == 2) && (args[1] == "CACHE")) {
|
||||||
this->Makefile->RemoveCacheDefinition(variable);
|
this->Makefile->RemoveCacheDefinition(variable);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// unset(VAR PARENT_SCOPE)
|
// unset(VAR PARENT_SCOPE)
|
||||||
else if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) {
|
if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) {
|
||||||
this->Makefile->RaiseScope(variable, CM_NULLPTR);
|
this->Makefile->RaiseScope(variable, CM_NULLPTR);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// ERROR: second argument isn't CACHE or PARENT_SCOPE
|
// ERROR: second argument isn't CACHE or PARENT_SCOPE
|
||||||
else {
|
this->SetError("called with an invalid second argument");
|
||||||
this->SetError("called with an invalid second argument");
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,10 +104,9 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
|
||||||
messageType);
|
messageType);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// decrement for each nested while that ends
|
|
||||||
this->Depth--;
|
|
||||||
}
|
}
|
||||||
|
// decrement for each nested while that ends
|
||||||
|
this->Depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// record the command
|
// record the command
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#ifndef CM_AUTO_PTR_HXX
|
#ifndef CM_AUTO_PTR_HXX
|
||||||
#define CM_AUTO_PTR_HXX
|
#define CM_AUTO_PTR_HXX
|
||||||
|
|
||||||
#include <cmsys/Configure.hxx>
|
#include <cmConfigure.h>
|
||||||
|
|
||||||
// FIXME: Use std::auto_ptr on compilers that do not warn about it.
|
// FIXME: Use std::auto_ptr on compilers that do not warn about it.
|
||||||
#define CM_AUTO_PTR cm::auto_ptr
|
#define CM_AUTO_PTR cm::auto_ptr
|
||||||
|
@ -115,7 +115,7 @@ public:
|
||||||
*
|
*
|
||||||
* auto_ptr<X> ptr(new X());
|
* auto_ptr<X> ptr(new X());
|
||||||
*/
|
*/
|
||||||
explicit auto_ptr(X* p = 0) throw()
|
explicit auto_ptr(X* p = CM_NULLPTR) throw()
|
||||||
: x_(p)
|
: x_(p)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ public:
|
||||||
X* release() throw()
|
X* release() throw()
|
||||||
{
|
{
|
||||||
X* x = this->x_;
|
X* x = this->x_;
|
||||||
this->x_ = 0;
|
this->x_ = CM_NULLPTR;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue