Merge topic 'else-after-return'
7b6349da
CMake: don't use else after return50ad1e0a
CTest: don't use else after return7f97a6c9
CPack: don't use else after return4988b914
CursesDialog: don't use else after return
This commit is contained in:
commit
797f7ad87d
|
@ -231,10 +231,8 @@ int cmCPackArchiveGenerator::PackageFiles()
|
||||||
// There will be 1 package for each component group
|
// There will be 1 package for each component group
|
||||||
// however one may require to ignore component group and
|
// however one may require to ignore component group and
|
||||||
// in this case you'll get 1 package for each component.
|
// in this case you'll get 1 package for each component.
|
||||||
else {
|
return PackageComponents(componentPackageMethod ==
|
||||||
return PackageComponents(componentPackageMethod ==
|
ONE_PACKAGE_PER_COMPONENT);
|
||||||
ONE_PACKAGE_PER_COMPONENT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CASE 3 : NON COMPONENT package.
|
// CASE 3 : NON COMPONENT package.
|
||||||
|
|
|
@ -242,15 +242,11 @@ int cmCPackDebGenerator::PackageFiles()
|
||||||
// There will be 1 package for each component group
|
// There will be 1 package for each component group
|
||||||
// however one may require to ignore component group and
|
// however one may require to ignore component group and
|
||||||
// in this case you'll get 1 package for each component.
|
// in this case you'll get 1 package for each component.
|
||||||
else {
|
return PackageComponents(componentPackageMethod ==
|
||||||
return PackageComponents(componentPackageMethod ==
|
ONE_PACKAGE_PER_COMPONENT);
|
||||||
ONE_PACKAGE_PER_COMPONENT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// CASE 3 : NON COMPONENT package.
|
// CASE 3 : NON COMPONENT package.
|
||||||
else {
|
return PackageComponentsAllInOne("");
|
||||||
return PackageComponentsAllInOne("");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackDebGenerator::createDeb()
|
int cmCPackDebGenerator::createDeb()
|
||||||
|
@ -694,9 +690,8 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
|
||||||
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
|
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
|
||||||
if (CM_NULLPTR != GetOption(groupVar)) {
|
if (CM_NULLPTR != GetOption(groupVar)) {
|
||||||
return std::string(GetOption(groupVar));
|
return std::string(GetOption(groupVar));
|
||||||
} else {
|
|
||||||
return componentName;
|
|
||||||
}
|
}
|
||||||
|
return componentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following code is taken from OpenBSD ar:
|
// The following code is taken from OpenBSD ar:
|
||||||
|
|
|
@ -67,7 +67,8 @@ int cmCPackGenerator::PrepareNames()
|
||||||
cmCPackLog::LOG_ERROR, "CPACK_SET_DESTDIR is set to ON but the '"
|
cmCPackLog::LOG_ERROR, "CPACK_SET_DESTDIR is set to ON but the '"
|
||||||
<< Name << "' generator does NOT support it." << std::endl);
|
<< Name << "' generator does NOT support it." << std::endl);
|
||||||
return 0;
|
return 0;
|
||||||
} else if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) {
|
}
|
||||||
|
if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_WARNING,
|
cmCPackLogger(cmCPackLog::LOG_WARNING,
|
||||||
"CPACK_SET_DESTDIR is set to ON but it is "
|
"CPACK_SET_DESTDIR is set to ON but it is "
|
||||||
<< "usually a bad idea to do that with '" << Name
|
<< "usually a bad idea to do that with '" << Name
|
||||||
|
|
|
@ -215,15 +215,11 @@ int cmCPackRPMGenerator::PackageFiles()
|
||||||
// There will be 1 package for each component group
|
// There will be 1 package for each component group
|
||||||
// however one may require to ignore component group and
|
// however one may require to ignore component group and
|
||||||
// in this case you'll get 1 package for each component.
|
// in this case you'll get 1 package for each component.
|
||||||
else {
|
return PackageComponents(componentPackageMethod ==
|
||||||
return PackageComponents(componentPackageMethod ==
|
ONE_PACKAGE_PER_COMPONENT);
|
||||||
ONE_PACKAGE_PER_COMPONENT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// CASE 3 : NON COMPONENT package.
|
// CASE 3 : NON COMPONENT package.
|
||||||
else {
|
return PackageComponentsAllInOne("");
|
||||||
return PackageComponentsAllInOne("");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackRPMGenerator::SupportsComponentInstallation() const
|
bool cmCPackRPMGenerator::SupportsComponentInstallation() const
|
||||||
|
@ -247,7 +243,6 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
|
||||||
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
|
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
|
||||||
if (CM_NULLPTR != GetOption(groupVar)) {
|
if (CM_NULLPTR != GetOption(groupVar)) {
|
||||||
return std::string(GetOption(groupVar));
|
return std::string(GetOption(groupVar));
|
||||||
} else {
|
|
||||||
return componentName;
|
|
||||||
}
|
}
|
||||||
|
return componentName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,9 +532,8 @@ public:
|
||||||
if (this->FTC->FileTimeCompare(l.c_str(), r.c_str(), &result) &&
|
if (this->FTC->FileTimeCompare(l.c_str(), r.c_str(), &result) &&
|
||||||
result != 0) {
|
result != 0) {
|
||||||
return result < 0;
|
return result < 0;
|
||||||
} else {
|
|
||||||
return l < r;
|
|
||||||
}
|
}
|
||||||
|
return l < r;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -216,10 +216,9 @@ std::string cmCTestCVS::ComputeBranchFlag(std::string const& dir)
|
||||||
std::string flag = "-r";
|
std::string flag = "-r";
|
||||||
flag += tagLine.substr(1);
|
flag += tagLine.substr(1);
|
||||||
return flag;
|
return flag;
|
||||||
} else {
|
|
||||||
// Use the default branch.
|
|
||||||
return "-b";
|
|
||||||
}
|
}
|
||||||
|
// Use the default branch.
|
||||||
|
return "-b";
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
|
void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
|
||||||
|
|
|
@ -763,12 +763,11 @@ int cmCTestCoverageHandler::HandleMumpsCoverage(
|
||||||
this->Quiet);
|
this->Quiet);
|
||||||
cov.ReadCoverageFile(coverageFile.c_str());
|
cov.ReadCoverageFile(coverageFile.c_str());
|
||||||
return static_cast<int>(cont->TotalCoverage.size());
|
return static_cast<int>(cont->TotalCoverage.size());
|
||||||
} else {
|
|
||||||
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
|
||||||
" Cannot find GTM coverage file: " << coverageFile
|
|
||||||
<< std::endl,
|
|
||||||
this->Quiet);
|
|
||||||
}
|
}
|
||||||
|
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||||
|
" Cannot find GTM coverage file: " << coverageFile
|
||||||
|
<< std::endl,
|
||||||
|
this->Quiet);
|
||||||
cmParseCacheCoverage ccov(*cont, this->CTest);
|
cmParseCacheCoverage ccov(*cont, this->CTest);
|
||||||
coverageFile = this->CTest->GetBinaryDir() + "/cache_coverage.cmcov";
|
coverageFile = this->CTest->GetBinaryDir() + "/cache_coverage.cmcov";
|
||||||
if (cmSystemTools::FileExists(coverageFile.c_str())) {
|
if (cmSystemTools::FileExists(coverageFile.c_str())) {
|
||||||
|
|
|
@ -126,12 +126,11 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
|
||||||
this->HandleRealArg(this->RealArgV[i]);
|
this->HandleRealArg(this->RealArgV[i]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
this->RealArgC = 0;
|
|
||||||
this->RealArgV = CM_NULLPTR;
|
|
||||||
std::cerr << "No launch/command separator ('--') found!\n";
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
this->RealArgC = 0;
|
||||||
|
this->RealArgV = CM_NULLPTR;
|
||||||
|
std::cerr << "No launch/command separator ('--') found!\n";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestLaunch::HandleRealArg(const char* arg)
|
void cmCTestLaunch::HandleRealArg(const char* arg)
|
||||||
|
|
|
@ -638,27 +638,24 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
|
||||||
std::string& log,
|
std::string& log,
|
||||||
std::vector<int>& results)
|
std::vector<int>& results)
|
||||||
{
|
{
|
||||||
if (this->MemoryTesterStyle == cmCTestMemCheckHandler::VALGRIND) {
|
switch (this->MemoryTesterStyle) {
|
||||||
return this->ProcessMemCheckValgrindOutput(str, log, results);
|
case cmCTestMemCheckHandler::VALGRIND:
|
||||||
} else if (this->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY) {
|
return this->ProcessMemCheckValgrindOutput(str, log, results);
|
||||||
return this->ProcessMemCheckPurifyOutput(str, log, results);
|
case cmCTestMemCheckHandler::PURIFY:
|
||||||
} else if (this->MemoryTesterStyle ==
|
return this->ProcessMemCheckPurifyOutput(str, log, results);
|
||||||
cmCTestMemCheckHandler::ADDRESS_SANITIZER ||
|
case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
|
||||||
this->MemoryTesterStyle ==
|
case cmCTestMemCheckHandler::THREAD_SANITIZER:
|
||||||
cmCTestMemCheckHandler::THREAD_SANITIZER ||
|
case cmCTestMemCheckHandler::MEMORY_SANITIZER:
|
||||||
this->MemoryTesterStyle ==
|
case cmCTestMemCheckHandler::UB_SANITIZER:
|
||||||
cmCTestMemCheckHandler::MEMORY_SANITIZER ||
|
return this->ProcessMemCheckSanitizerOutput(str, log, results);
|
||||||
this->MemoryTesterStyle == cmCTestMemCheckHandler::UB_SANITIZER) {
|
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
|
||||||
return this->ProcessMemCheckSanitizerOutput(str, log, results);
|
return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
|
||||||
} else if (this->MemoryTesterStyle ==
|
default:
|
||||||
cmCTestMemCheckHandler::BOUNDS_CHECKER) {
|
log.append("\nMemory checking style used was: ");
|
||||||
return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
|
log.append("None that I know");
|
||||||
} else {
|
log = str;
|
||||||
log.append("\nMemory checking style used was: ");
|
return true;
|
||||||
log.append("None that I know");
|
|
||||||
log = str;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int>::size_type cmCTestMemCheckHandler::FindOrAddWarning(
|
std::vector<int>::size_type cmCTestMemCheckHandler::FindOrAddWarning(
|
||||||
|
|
|
@ -824,9 +824,8 @@ bool cmCTestMultiProcessHandler::CheckCycles()
|
||||||
<< this->Properties[root]->Name
|
<< this->Properties[root]->Name
|
||||||
<< "\".\nPlease fix the cycle and run ctest again.\n");
|
<< "\".\nPlease fix the cycle and run ctest again.\n");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
s.push(*d);
|
|
||||||
}
|
}
|
||||||
|
s.push(*d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,9 +373,8 @@ std::string cmCTestP4::GetWorkingRevision()
|
||||||
|
|
||||||
if (rev.empty()) {
|
if (rev.empty()) {
|
||||||
return "0";
|
return "0";
|
||||||
} else {
|
|
||||||
return rev;
|
|
||||||
}
|
}
|
||||||
|
return rev;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestP4::NoteOldRevision()
|
void cmCTestP4::NoteOldRevision()
|
||||||
|
|
|
@ -54,7 +54,8 @@ bool cmCTestRunTest::CheckOutput()
|
||||||
if (p == cmsysProcess_Pipe_None) {
|
if (p == cmsysProcess_Pipe_None) {
|
||||||
// Process has terminated and all output read.
|
// Process has terminated and all output read.
|
||||||
return false;
|
return false;
|
||||||
} else if (p == cmsysProcess_Pipe_STDOUT) {
|
}
|
||||||
|
if (p == cmsysProcess_Pipe_STDOUT) {
|
||||||
// Store this line of output.
|
// Store this line of output.
|
||||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex()
|
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex()
|
||||||
<< ": " << line << std::endl);
|
<< ": " << line << std::endl);
|
||||||
|
@ -82,8 +83,7 @@ bool cmCTestRunTest::CheckOutput()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else // if(p == cmsysProcess_Pipe_Timeout)
|
} else { // if(p == cmsysProcess_Pipe_Timeout)
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,11 +80,11 @@ static bool cmCTestSVNPathStarts(std::string const& p1, std::string const& p2)
|
||||||
// Does path p1 start with path p2?
|
// Does path p1 start with path p2?
|
||||||
if (p1.size() == p2.size()) {
|
if (p1.size() == p2.size()) {
|
||||||
return p1 == p2;
|
return p1 == p2;
|
||||||
} else if (p1.size() > p2.size() && p1[p2.size()] == '/') {
|
|
||||||
return strncmp(p1.c_str(), p2.c_str(), p2.size()) == 0;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (p1.size() > p2.size() && p1[p2.size()] == '/') {
|
||||||
|
return strncmp(p1.c_str(), p2.c_str(), p2.size()) == 0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
|
std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
|
||||||
|
@ -295,9 +295,8 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
|
||||||
|
|
||||||
if (strcmp(parameters[0], "update") == 0) {
|
if (strcmp(parameters[0], "update") == 0) {
|
||||||
return RunUpdateCommand(&args[0], out, err);
|
return RunUpdateCommand(&args[0], out, err);
|
||||||
} else {
|
|
||||||
return RunChild(&args[0], out, err);
|
|
||||||
}
|
}
|
||||||
|
return RunChild(&args[0], out, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
class cmCTestSVN::LogParser : public cmCTestVC::OutputLogger,
|
class cmCTestSVN::LogParser : public cmCTestVC::OutputLogger,
|
||||||
|
|
|
@ -284,14 +284,13 @@ inline int GetNextNumber(std::string const& in, int& val,
|
||||||
}
|
}
|
||||||
pos = pos2 + 1;
|
pos = pos2 + 1;
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
|
||||||
if (in.size() - pos == 0) {
|
|
||||||
val = -1;
|
|
||||||
} else {
|
|
||||||
val = atoi(in.substr(pos, in.size() - pos).c_str());
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
if (in.size() - pos == 0) {
|
||||||
|
val = -1;
|
||||||
|
} else {
|
||||||
|
val = atoi(in.substr(pos, in.size() - pos).c_str());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the next number in a string with numbers separated by ,
|
// get the next number in a string with numbers separated by ,
|
||||||
|
@ -311,14 +310,13 @@ inline int GetNextRealNumber(std::string const& in, double& val,
|
||||||
}
|
}
|
||||||
pos = pos2 + 1;
|
pos = pos2 + 1;
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
|
||||||
if (in.size() - pos == 0) {
|
|
||||||
val = -1;
|
|
||||||
} else {
|
|
||||||
val = atof(in.substr(pos, in.size() - pos).c_str());
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
if (in.size() - pos == 0) {
|
||||||
|
val = -1;
|
||||||
|
} else {
|
||||||
|
val = atof(in.substr(pos, in.size() - pos).c_str());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmCTestTestHandler::cmCTestTestHandler()
|
cmCTestTestHandler::cmCTestTestHandler()
|
||||||
|
|
|
@ -49,14 +49,13 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
|
||||||
if (cmSystemTools::FileExists(arg.c_str())) {
|
if (cmSystemTools::FileExists(arg.c_str())) {
|
||||||
this->Files.insert(arg);
|
this->Files.insert(arg);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
std::ostringstream e;
|
|
||||||
e << "File \"" << arg << "\" does not exist. Cannot submit "
|
|
||||||
<< "a non-existent file.";
|
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
|
||||||
this->ArgumentDoing = ArgumentDoingError;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
std::ostringstream e;
|
||||||
|
e << "File \"" << arg << "\" does not exist. Cannot submit "
|
||||||
|
<< "a non-existent file.";
|
||||||
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
|
this->ArgumentDoing = ArgumentDoingError;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for other arguments.
|
// Look for other arguments.
|
||||||
|
|
|
@ -42,9 +42,8 @@ public:
|
||||||
std::string foundFileName =
|
std::string foundFileName =
|
||||||
line.substr(begIndex + 3, endIndex - (begIndex + 4));
|
line.substr(begIndex + 3, endIndex - (begIndex + 4));
|
||||||
return foundFileName;
|
return foundFileName;
|
||||||
} else {
|
|
||||||
return line.substr(begIndex, line.npos);
|
|
||||||
}
|
}
|
||||||
|
return line.substr(begIndex, line.npos);
|
||||||
}
|
}
|
||||||
bool ParseFile(std::string const& file)
|
bool ParseFile(std::string const& file)
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,16 +128,15 @@ bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
|
||||||
if (i != this->RoutineToDirectory.end()) {
|
if (i != this->RoutineToDirectory.end()) {
|
||||||
filepath = i->second;
|
filepath = i->second;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
// try some alternate names
|
// try some alternate names
|
||||||
const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR };
|
const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR };
|
||||||
for (int k = 0; tryname[k] != CM_NULLPTR; k++) {
|
for (int k = 0; tryname[k] != CM_NULLPTR; k++) {
|
||||||
std::string routine2 = routine + tryname[k];
|
std::string routine2 = routine + tryname[k];
|
||||||
i = this->RoutineToDirectory.find(routine2);
|
i = this->RoutineToDirectory.find(routine2);
|
||||||
if (i != this->RoutineToDirectory.end()) {
|
if (i != this->RoutineToDirectory.end()) {
|
||||||
filepath = i->second;
|
filepath = i->second;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -124,10 +124,10 @@ int cmProcess::GetNextOutputLine(std::string& line, double timeout)
|
||||||
int p = cmsysProcess_WaitForData(this->Process, &data, &length, &timeout);
|
int p = cmsysProcess_WaitForData(this->Process, &data, &length, &timeout);
|
||||||
if (p == cmsysProcess_Pipe_Timeout) {
|
if (p == cmsysProcess_Pipe_Timeout) {
|
||||||
return cmsysProcess_Pipe_Timeout;
|
return cmsysProcess_Pipe_Timeout;
|
||||||
} else if (p == cmsysProcess_Pipe_STDOUT) {
|
}
|
||||||
|
if (p == cmsysProcess_Pipe_STDOUT) {
|
||||||
this->Output.insert(this->Output.end(), data, data + length);
|
this->Output.insert(this->Output.end(), data, data + length);
|
||||||
} else // p == cmsysProcess_Pipe_None
|
} else { // p == cmsysProcess_Pipe_None
|
||||||
{
|
|
||||||
// The process will provide no more data.
|
// The process will provide no more data.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,9 +40,8 @@ bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
|
||||||
touchwin(w);
|
touchwin(w);
|
||||||
wrefresh(w);
|
wrefresh(w);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCursesBoolWidget::SetValueAsBool(bool value)
|
void cmCursesBoolWidget::SetValueAsBool(bool value)
|
||||||
|
|
|
@ -110,7 +110,6 @@ const char* cmCursesCacheEntryComposite::GetValue()
|
||||||
{
|
{
|
||||||
if (this->Label) {
|
if (this->Label) {
|
||||||
return this->Label->GetValue();
|
return this->Label->GetValue();
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,7 @@
|
||||||
|
|
||||||
#include "cmCursesMainForm.h"
|
#include "cmCursesMainForm.h"
|
||||||
|
|
||||||
inline int ctrl(int z)
|
#define ctrl(z) ((z)&037)
|
||||||
{
|
|
||||||
return (z & 037);
|
|
||||||
}
|
|
||||||
|
|
||||||
cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
|
cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
|
||||||
int top)
|
int top)
|
||||||
|
@ -34,25 +31,27 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
|
||||||
bool cmCursesOptionsWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
|
bool cmCursesOptionsWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
|
||||||
WINDOW* w)
|
WINDOW* w)
|
||||||
{
|
{
|
||||||
|
switch (key) {
|
||||||
// 10 == enter
|
case 10: // 10 == enter
|
||||||
if (key == 10 || key == KEY_ENTER) {
|
case KEY_ENTER:
|
||||||
this->NextOption();
|
this->NextOption();
|
||||||
touchwin(w);
|
touchwin(w);
|
||||||
wrefresh(w);
|
wrefresh(w);
|
||||||
return true;
|
return true;
|
||||||
} else if (key == KEY_LEFT || key == ctrl('b')) {
|
case KEY_LEFT:
|
||||||
touchwin(w);
|
case ctrl('b'):
|
||||||
wrefresh(w);
|
touchwin(w);
|
||||||
this->PreviousOption();
|
wrefresh(w);
|
||||||
return true;
|
this->PreviousOption();
|
||||||
} else if (key == KEY_RIGHT || key == ctrl('f')) {
|
return true;
|
||||||
this->NextOption();
|
case KEY_RIGHT:
|
||||||
touchwin(w);
|
case ctrl('f'):
|
||||||
wrefresh(w);
|
this->NextOption();
|
||||||
return true;
|
touchwin(w);
|
||||||
} else {
|
wrefresh(w);
|
||||||
return false;
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,10 +94,9 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
|
||||||
// quit
|
// quit
|
||||||
if (key == 'q') {
|
if (key == 'q') {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
key = getch();
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
key = getch();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If resize occurred during edit, move out of edit mode
|
// If resize occurred during edit, move out of edit mode
|
||||||
|
@ -207,7 +206,6 @@ bool cmCursesStringWidget::PrintKeys()
|
||||||
curses_move(y - 3, 0);
|
curses_move(y - 3, 0);
|
||||||
printw(fmt_s, "Editing option, press [enter] to leave edit.");
|
printw(fmt_s, "Editing option, press [enter] to leave edit.");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,9 +75,8 @@ struct cmArchiveWrite::Callback
|
||||||
if (self->Stream.write(static_cast<const char*>(b),
|
if (self->Stream.write(static_cast<const char*>(b),
|
||||||
static_cast<std::streamsize>(n))) {
|
static_cast<std::streamsize>(n))) {
|
||||||
return static_cast<__LA_SSIZE_T>(n);
|
return static_cast<__LA_SSIZE_T>(n);
|
||||||
} else {
|
|
||||||
return static_cast<__LA_SSIZE_T>(-1);
|
|
||||||
}
|
}
|
||||||
|
return static_cast<__LA_SSIZE_T>(-1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -781,13 +781,12 @@ bool cmCTest::SetTest(const char* ttype, bool report)
|
||||||
if (p != PartCount) {
|
if (p != PartCount) {
|
||||||
this->Parts[p].Enable();
|
this->Parts[p].Enable();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
if (report) {
|
|
||||||
cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \""
|
|
||||||
<< ttype << "\" yet..." << std::endl);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (report) {
|
||||||
|
cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \""
|
||||||
|
<< ttype << "\" yet..." << std::endl);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTest::Finalize()
|
void cmCTest::Finalize()
|
||||||
|
|
|
@ -576,7 +576,8 @@ const char* cmCacheManager::CacheEntry::GetProperty(
|
||||||
{
|
{
|
||||||
if (prop == "TYPE") {
|
if (prop == "TYPE") {
|
||||||
return cmState::CacheEntryTypeToString(this->Type);
|
return cmState::CacheEntryTypeToString(this->Type);
|
||||||
} else if (prop == "VALUE") {
|
}
|
||||||
|
if (prop == "VALUE") {
|
||||||
return this->Value.c_str();
|
return this->Value.c_str();
|
||||||
}
|
}
|
||||||
return this->Properties.GetPropertyValue(prop);
|
return this->Properties.GetPropertyValue(prop);
|
||||||
|
|
|
@ -75,9 +75,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
|
||||||
if (cmSystemTools::GetEnv(var, str)) {
|
if (cmSystemTools::GetEnv(var, str)) {
|
||||||
if (this->EscapeQuotes) {
|
if (this->EscapeQuotes) {
|
||||||
return this->AddString(cmSystemTools::EscapeQuotes(str.c_str()));
|
return this->AddString(cmSystemTools::EscapeQuotes(str.c_str()));
|
||||||
} else {
|
|
||||||
return this->AddString(str);
|
|
||||||
}
|
}
|
||||||
|
return this->AddString(str);
|
||||||
}
|
}
|
||||||
return this->EmptyVariable;
|
return this->EmptyVariable;
|
||||||
}
|
}
|
||||||
|
@ -86,9 +85,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
|
||||||
this->Makefile->GetState()->GetInitializedCacheValue(var)) {
|
this->Makefile->GetState()->GetInitializedCacheValue(var)) {
|
||||||
if (this->EscapeQuotes) {
|
if (this->EscapeQuotes) {
|
||||||
return this->AddString(cmSystemTools::EscapeQuotes(c));
|
return this->AddString(cmSystemTools::EscapeQuotes(c));
|
||||||
} else {
|
|
||||||
return this->AddString(c);
|
|
||||||
}
|
}
|
||||||
|
return this->AddString(c);
|
||||||
}
|
}
|
||||||
return this->EmptyVariable;
|
return this->EmptyVariable;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +160,8 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
|
||||||
{
|
{
|
||||||
if (!in1) {
|
if (!in1) {
|
||||||
return in2;
|
return in2;
|
||||||
} else if (!in2) {
|
}
|
||||||
|
if (!in2) {
|
||||||
return in1;
|
return in1;
|
||||||
}
|
}
|
||||||
size_t len = strlen(in1) + strlen(in2) + 1;
|
size_t len = strlen(in1) + strlen(in2) + 1;
|
||||||
|
@ -282,10 +281,9 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen)
|
||||||
this->CurrentLine++;
|
this->CurrentLine++;
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
} else {
|
|
||||||
buf[0] = '\n';
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
buf[0] = '\n';
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCommandArgumentParserHelper::Error(const char* str)
|
void cmCommandArgumentParserHelper::Error(const char* str)
|
||||||
|
|
|
@ -19,19 +19,23 @@ CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
|
||||||
{
|
{
|
||||||
if (strcmp(algo, "MD5") == 0) {
|
if (strcmp(algo, "MD5") == 0) {
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashMD5);
|
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashMD5);
|
||||||
} else if (strcmp(algo, "SHA1") == 0) {
|
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA1);
|
|
||||||
} else if (strcmp(algo, "SHA224") == 0) {
|
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA224);
|
|
||||||
} else if (strcmp(algo, "SHA256") == 0) {
|
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA256);
|
|
||||||
} else if (strcmp(algo, "SHA384") == 0) {
|
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA384);
|
|
||||||
} else if (strcmp(algo, "SHA512") == 0) {
|
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA512);
|
|
||||||
} else {
|
|
||||||
return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
|
|
||||||
}
|
}
|
||||||
|
if (strcmp(algo, "SHA1") == 0) {
|
||||||
|
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA1);
|
||||||
|
}
|
||||||
|
if (strcmp(algo, "SHA224") == 0) {
|
||||||
|
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA224);
|
||||||
|
}
|
||||||
|
if (strcmp(algo, "SHA256") == 0) {
|
||||||
|
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA256);
|
||||||
|
}
|
||||||
|
if (strcmp(algo, "SHA384") == 0) {
|
||||||
|
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA384);
|
||||||
|
}
|
||||||
|
if (strcmp(algo, "SHA512") == 0) {
|
||||||
|
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA512);
|
||||||
|
}
|
||||||
|
return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCryptoHash::IntFromHexDigit(char input, char& output)
|
bool cmCryptoHash::IntFromHexDigit(char input, char& output)
|
||||||
|
@ -39,10 +43,12 @@ bool cmCryptoHash::IntFromHexDigit(char input, char& output)
|
||||||
if (input >= '0' && input <= '9') {
|
if (input >= '0' && input <= '9') {
|
||||||
output = char(input - '0');
|
output = char(input - '0');
|
||||||
return true;
|
return true;
|
||||||
} else if (input >= 'a' && input <= 'f') {
|
}
|
||||||
|
if (input >= 'a' && input <= 'f') {
|
||||||
output = char(input - 'a' + 0xA);
|
output = char(input - 'a' + 0xA);
|
||||||
return true;
|
return true;
|
||||||
} else if (input >= 'A' && input <= 'F') {
|
}
|
||||||
|
if (input >= 'A' && input <= 'F') {
|
||||||
output = char(input - 'A' + 0xA);
|
output = char(input - 'A' + 0xA);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -521,7 +521,8 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (cmSystemTools::FileExists(mod_lower.c_str(), true)) {
|
}
|
||||||
|
if (cmSystemTools::FileExists(mod_lower.c_str(), true)) {
|
||||||
if (cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(),
|
if (cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(),
|
||||||
compilerId.c_str())) {
|
compilerId.c_str())) {
|
||||||
if (!cmSystemTools::CopyFileAlways(mod_lower, stamp)) {
|
if (!cmSystemTools::CopyFileAlways(mod_lower, stamp)) {
|
||||||
|
|
|
@ -719,9 +719,8 @@ const char* cmDocumentation::GetNameString() const
|
||||||
{
|
{
|
||||||
if (!this->NameString.empty()) {
|
if (!this->NameString.empty()) {
|
||||||
return this->NameString.c_str();
|
return this->NameString.c_str();
|
||||||
} else {
|
|
||||||
return "CMake";
|
|
||||||
}
|
}
|
||||||
|
return "CMake";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmDocumentation::IsOption(const char* arg) const
|
bool cmDocumentation::IsOption(const char* arg) const
|
||||||
|
|
|
@ -832,45 +832,40 @@ cmELF::FileType cmELF::GetFileType() const
|
||||||
{
|
{
|
||||||
if (this->Valid()) {
|
if (this->Valid()) {
|
||||||
return this->Internal->GetFileType();
|
return this->Internal->GetFileType();
|
||||||
} else {
|
|
||||||
return FileTypeInvalid;
|
|
||||||
}
|
}
|
||||||
|
return FileTypeInvalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int cmELF::GetNumberOfSections() const
|
unsigned int cmELF::GetNumberOfSections() const
|
||||||
{
|
{
|
||||||
if (this->Valid()) {
|
if (this->Valid()) {
|
||||||
return this->Internal->GetNumberOfSections();
|
return this->Internal->GetNumberOfSections();
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int cmELF::GetDynamicEntryCount() const
|
unsigned int cmELF::GetDynamicEntryCount() const
|
||||||
{
|
{
|
||||||
if (this->Valid()) {
|
if (this->Valid()) {
|
||||||
return this->Internal->GetDynamicEntryCount();
|
return this->Internal->GetDynamicEntryCount();
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long cmELF::GetDynamicEntryPosition(int index) const
|
unsigned long cmELF::GetDynamicEntryPosition(int index) const
|
||||||
{
|
{
|
||||||
if (this->Valid()) {
|
if (this->Valid()) {
|
||||||
return this->Internal->GetDynamicEntryPosition(index);
|
return this->Internal->GetDynamicEntryPosition(index);
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmELF::ReadBytes(unsigned long pos, unsigned long size, char* buf) const
|
bool cmELF::ReadBytes(unsigned long pos, unsigned long size, char* buf) const
|
||||||
{
|
{
|
||||||
if (this->Valid()) {
|
if (this->Valid()) {
|
||||||
return this->Internal->ReadBytes(pos, size, buf);
|
return this->Internal->ReadBytes(pos, size, buf);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmELF::GetSOName(std::string& soname)
|
bool cmELF::GetSOName(std::string& soname)
|
||||||
|
@ -878,9 +873,8 @@ bool cmELF::GetSOName(std::string& soname)
|
||||||
if (StringEntry const* se = this->GetSOName()) {
|
if (StringEntry const* se = this->GetSOName()) {
|
||||||
soname = se->Value;
|
soname = se->Value;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmELF::StringEntry const* cmELF::GetSOName()
|
cmELF::StringEntry const* cmELF::GetSOName()
|
||||||
|
@ -888,9 +882,8 @@ cmELF::StringEntry const* cmELF::GetSOName()
|
||||||
if (this->Valid() &&
|
if (this->Valid() &&
|
||||||
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) {
|
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) {
|
||||||
return this->Internal->GetSOName();
|
return this->Internal->GetSOName();
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmELF::StringEntry const* cmELF::GetRPath()
|
cmELF::StringEntry const* cmELF::GetRPath()
|
||||||
|
@ -899,9 +892,8 @@ cmELF::StringEntry const* cmELF::GetRPath()
|
||||||
(this->Internal->GetFileType() == cmELF::FileTypeExecutable ||
|
(this->Internal->GetFileType() == cmELF::FileTypeExecutable ||
|
||||||
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
|
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
|
||||||
return this->Internal->GetRPath();
|
return this->Internal->GetRPath();
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmELF::StringEntry const* cmELF::GetRunPath()
|
cmELF::StringEntry const* cmELF::GetRunPath()
|
||||||
|
@ -910,9 +902,8 @@ cmELF::StringEntry const* cmELF::GetRunPath()
|
||||||
(this->Internal->GetFileType() == cmELF::FileTypeExecutable ||
|
(this->Internal->GetFileType() == cmELF::FileTypeExecutable ||
|
||||||
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
|
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
|
||||||
return this->Internal->GetRunPath();
|
return this->Internal->GetRunPath();
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmELF::PrintInfo(std::ostream& os) const
|
void cmELF::PrintInfo(std::ostream& os) const
|
||||||
|
|
|
@ -211,11 +211,10 @@ void cmExportBuildFileGenerator::HandleMissingTarget(
|
||||||
link_libs += missingTarget;
|
link_libs += missingTarget;
|
||||||
missingTargets.push_back(missingTarget);
|
missingTargets.push_back(missingTarget);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
// We are not appending, so all exported targets should be
|
|
||||||
// known here. This is probably user-error.
|
|
||||||
this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
|
|
||||||
}
|
}
|
||||||
|
// We are not appending, so all exported targets should be
|
||||||
|
// known here. This is probably user-error.
|
||||||
|
this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
|
||||||
}
|
}
|
||||||
// Assume the target will be exported by another command.
|
// Assume the target will be exported by another command.
|
||||||
// Append it with the export namespace.
|
// Append it with the export namespace.
|
||||||
|
|
|
@ -81,10 +81,9 @@ int cmExprParserHelper::LexInput(char* buf, int maxlen)
|
||||||
this->CurrentLine++;
|
this->CurrentLine++;
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
} else {
|
|
||||||
buf[0] = '\n';
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
buf[0] = '\n';
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmExprParserHelper::Error(const char* str)
|
void cmExprParserHelper::Error(const char* str)
|
||||||
|
|
|
@ -124,11 +124,10 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
|
||||||
if (start + 1 < splitted.size()) {
|
if (start + 1 < splitted.size()) {
|
||||||
it->InsertPath(splitted, start + 1, fileName);
|
it->InsertPath(splitted, start + 1, fileName);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
// last part of splitted
|
|
||||||
it->files.push_back(fileName);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
// last part of splitted
|
||||||
|
it->files.push_back(fileName);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Not found in folders, thus insert
|
// Not found in folders, thus insert
|
||||||
|
@ -138,12 +137,11 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
|
||||||
newFolder.InsertPath(splitted, start + 1, fileName);
|
newFolder.InsertPath(splitted, start + 1, fileName);
|
||||||
folders.push_back(newFolder);
|
folders.push_back(newFolder);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
// last part of splitted
|
|
||||||
newFolder.files.push_back(fileName);
|
|
||||||
folders.push_back(newFolder);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
// last part of splitted
|
||||||
|
newFolder.files.push_back(fileName);
|
||||||
|
folders.push_back(newFolder);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
|
void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
|
||||||
|
@ -717,21 +715,22 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
|
||||||
// Translate the cmake target type into the CodeBlocks target type id
|
// Translate the cmake target type into the CodeBlocks target type id
|
||||||
int cmExtraCodeBlocksGenerator::GetCBTargetType(cmGeneratorTarget* target)
|
int cmExtraCodeBlocksGenerator::GetCBTargetType(cmGeneratorTarget* target)
|
||||||
{
|
{
|
||||||
if (target->GetType() == cmState::EXECUTABLE) {
|
switch (target->GetType()) {
|
||||||
if ((target->GetPropertyAsBool("WIN32_EXECUTABLE")) ||
|
case cmState::EXECUTABLE:
|
||||||
(target->GetPropertyAsBool("MACOSX_BUNDLE"))) {
|
if ((target->GetPropertyAsBool("WIN32_EXECUTABLE")) ||
|
||||||
return 0;
|
(target->GetPropertyAsBool("MACOSX_BUNDLE"))) {
|
||||||
} else {
|
return 0;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
case cmState::STATIC_LIBRARY:
|
||||||
} else if ((target->GetType() == cmState::STATIC_LIBRARY) ||
|
case cmState::OBJECT_LIBRARY:
|
||||||
(target->GetType() == cmState::OBJECT_LIBRARY)) {
|
return 2;
|
||||||
return 2;
|
case cmState::SHARED_LIBRARY:
|
||||||
} else if ((target->GetType() == cmState::SHARED_LIBRARY) ||
|
case cmState::MODULE_LIBRARY:
|
||||||
(target->GetType() == cmState::MODULE_LIBRARY)) {
|
return 3;
|
||||||
return 3;
|
default:
|
||||||
|
return 4;
|
||||||
}
|
}
|
||||||
return 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the command line for building the given target using the selected
|
// Create the command line for building the given target using the selected
|
||||||
|
|
|
@ -140,10 +140,9 @@ cmFileLockResult cmFileLockPool::ScopePool::Lock(const std::string& filename,
|
||||||
if (result.IsOk()) {
|
if (result.IsOk()) {
|
||||||
this->Locks.push_back(lock);
|
this->Locks.push_back(lock);
|
||||||
return cmFileLockResult::MakeOk();
|
return cmFileLockResult::MakeOk();
|
||||||
} else {
|
|
||||||
delete lock;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
delete lock;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmFileLockResult cmFileLockPool::ScopePool::Release(
|
cmFileLockResult cmFileLockPool::ScopePool::Release(
|
||||||
|
|
|
@ -140,11 +140,14 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
|
||||||
// Compare using nanosecond resolution.
|
// Compare using nanosecond resolution.
|
||||||
if (s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) {
|
if (s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (s1->st_mtim.tv_sec > s2->st_mtim.tv_sec) {
|
}
|
||||||
|
if (s1->st_mtim.tv_sec > s2->st_mtim.tv_sec) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (s1->st_mtim.tv_nsec < s2->st_mtim.tv_nsec) {
|
}
|
||||||
|
if (s1->st_mtim.tv_nsec < s2->st_mtim.tv_nsec) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
|
}
|
||||||
|
if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#elif CMake_STAT_HAS_ST_MTIMESPEC
|
#elif CMake_STAT_HAS_ST_MTIMESPEC
|
||||||
|
@ -185,11 +188,11 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
|
||||||
long long t2 = s2->st_mtim.tv_sec * bil + s2->st_mtim.tv_nsec;
|
long long t2 = s2->st_mtim.tv_sec * bil + s2->st_mtim.tv_nsec;
|
||||||
if (t1 < t2) {
|
if (t1 < t2) {
|
||||||
return (t2 - t1) >= bil;
|
return (t2 - t1) >= bil;
|
||||||
} else if (t2 < t1) {
|
|
||||||
return (t1 - t2) >= bil;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (t2 < t1) {
|
||||||
|
return (t1 - t2) >= bil;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
#elif CMake_STAT_HAS_ST_MTIMESPEC
|
#elif CMake_STAT_HAS_ST_MTIMESPEC
|
||||||
// Times are integers in units of 1ns.
|
// Times are integers in units of 1ns.
|
||||||
long long bil = 1000000000;
|
long long bil = 1000000000;
|
||||||
|
@ -240,11 +243,10 @@ bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
|
||||||
// Compare the two modification times.
|
// Compare the two modification times.
|
||||||
*result = this->Compare(&s1, &s2);
|
*result = this->Compare(&s1, &s2);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// No comparison available. Default to the same time.
|
|
||||||
*result = 0;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
// No comparison available. Default to the same time.
|
||||||
|
*result = 0;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
|
bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
|
||||||
|
@ -256,8 +258,7 @@ bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
|
||||||
if (this->Stat(f1, &s1) && this->Stat(f2, &s2)) {
|
if (this->Stat(f1, &s1) && this->Stat(f2, &s2)) {
|
||||||
// Compare the two modification times.
|
// Compare the two modification times.
|
||||||
return this->TimesDiffer(&s1, &s2);
|
return this->TimesDiffer(&s1, &s2);
|
||||||
} else {
|
|
||||||
// No comparison available. Default to different times.
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
// No comparison available. Default to different times.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,29 +22,27 @@ bool cmFortranParser_s::FindIncludeFile(const char* dir,
|
||||||
if (cmSystemTools::FileIsFullPath(includeName)) {
|
if (cmSystemTools::FileIsFullPath(includeName)) {
|
||||||
fileName = includeName;
|
fileName = includeName;
|
||||||
return cmSystemTools::FileExists(fileName.c_str(), true);
|
return cmSystemTools::FileExists(fileName.c_str(), true);
|
||||||
} else {
|
}
|
||||||
// Check for the file in the directory containing the including
|
// Check for the file in the directory containing the including
|
||||||
// file.
|
// file.
|
||||||
std::string fullName = dir;
|
std::string fullName = dir;
|
||||||
|
fullName += "/";
|
||||||
|
fullName += includeName;
|
||||||
|
if (cmSystemTools::FileExists(fullName.c_str(), true)) {
|
||||||
|
fileName = fullName;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search the include path for the file.
|
||||||
|
for (std::vector<std::string>::const_iterator i = this->IncludePath.begin();
|
||||||
|
i != this->IncludePath.end(); ++i) {
|
||||||
|
fullName = *i;
|
||||||
fullName += "/";
|
fullName += "/";
|
||||||
fullName += includeName;
|
fullName += includeName;
|
||||||
if (cmSystemTools::FileExists(fullName.c_str(), true)) {
|
if (cmSystemTools::FileExists(fullName.c_str(), true)) {
|
||||||
fileName = fullName;
|
fileName = fullName;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search the include path for the file.
|
|
||||||
for (std::vector<std::string>::const_iterator i =
|
|
||||||
this->IncludePath.begin();
|
|
||||||
i != this->IncludePath.end(); ++i) {
|
|
||||||
fullName = *i;
|
|
||||||
fullName += "/";
|
|
||||||
fullName += includeName;
|
|
||||||
if (cmSystemTools::FileExists(fullName.c_str(), true)) {
|
|
||||||
fileName = fullName;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -88,9 +86,8 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
|
||||||
cmFortran_yy_switch_to_buffer(buffer, parser->Scanner);
|
cmFortran_yy_switch_to_buffer(buffer, parser->Scanner);
|
||||||
parser->FileStack.push(f);
|
parser->FileStack.push(f);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmFortranParser_FilePop(cmFortranParser* parser)
|
bool cmFortranParser_FilePop(cmFortranParser* parser)
|
||||||
|
@ -99,15 +96,14 @@ bool cmFortranParser_FilePop(cmFortranParser* parser)
|
||||||
// to the next one on the stack.
|
// to the next one on the stack.
|
||||||
if (parser->FileStack.empty()) {
|
if (parser->FileStack.empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
|
||||||
cmFortranFile f = parser->FileStack.top();
|
|
||||||
parser->FileStack.pop();
|
|
||||||
fclose(f.File);
|
|
||||||
YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner);
|
|
||||||
cmFortran_yy_delete_buffer(current, parser->Scanner);
|
|
||||||
cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
cmFortranFile f = parser->FileStack.top();
|
||||||
|
parser->FileStack.pop();
|
||||||
|
fclose(f.File);
|
||||||
|
YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner);
|
||||||
|
cmFortran_yy_delete_buffer(current, parser->Scanner);
|
||||||
|
cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmFortranParser_Input(cmFortranParser* parser, char* buffer,
|
int cmFortranParser_Input(cmFortranParser* parser, char* buffer,
|
||||||
|
|
|
@ -352,7 +352,8 @@ std::string cmGeneratorExpression::Preprocess(const std::string& input,
|
||||||
{
|
{
|
||||||
if (context == StripAllGeneratorExpressions) {
|
if (context == StripAllGeneratorExpressions) {
|
||||||
return stripAllGeneratorExpressions(input);
|
return stripAllGeneratorExpressions(input);
|
||||||
} else if (context == BuildInterface || context == InstallInterface) {
|
}
|
||||||
|
if (context == BuildInterface || context == InstallInterface) {
|
||||||
return stripExportInterface(input, context, resolveRelative);
|
return stripExportInterface(input, context, resolveRelative);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,20 +154,19 @@ std::string GeneratorExpressionContent::EvaluateParameters(
|
||||||
node, identifier, context, dagChecker, pit);
|
node, identifier, context, dagChecker, pit);
|
||||||
parameters.push_back(lastParam);
|
parameters.push_back(lastParam);
|
||||||
return std::string();
|
return std::string();
|
||||||
} else {
|
|
||||||
std::string parameter;
|
|
||||||
std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
|
|
||||||
pit->begin();
|
|
||||||
const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator
|
|
||||||
end = pit->end();
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
parameter += (*it)->Evaluate(context, dagChecker);
|
|
||||||
if (context->HadError) {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
parameters.push_back(parameter);
|
|
||||||
}
|
}
|
||||||
|
std::string parameter;
|
||||||
|
std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
|
||||||
|
pit->begin();
|
||||||
|
const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end =
|
||||||
|
pit->end();
|
||||||
|
for (; it != end; ++it) {
|
||||||
|
parameter += (*it)->Evaluate(context, dagChecker);
|
||||||
|
if (context->HadError) {
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parameters.push_back(parameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,8 @@ static const struct ZeroNode installInterfaceNode;
|
||||||
for (; it != end; ++it) { \
|
for (; it != end; ++it) { \
|
||||||
if (*it == #FAILURE_VALUE) { \
|
if (*it == #FAILURE_VALUE) { \
|
||||||
return #FAILURE_VALUE; \
|
return #FAILURE_VALUE; \
|
||||||
} else if (*it != #SUCCESS_VALUE) { \
|
} \
|
||||||
|
if (*it != #SUCCESS_VALUE) { \
|
||||||
reportError(context, content->GetOriginalExpression(), \
|
reportError(context, content->GetOriginalExpression(), \
|
||||||
"Parameters to $<" #OP \
|
"Parameters to $<" #OP \
|
||||||
"> must resolve to either '0' or '1'."); \
|
"> must resolve to either '0' or '1'."); \
|
||||||
|
@ -790,7 +791,8 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
|
||||||
"$<COMPILE_LANGUAGE:...> may not be used with Visual Studio "
|
"$<COMPILE_LANGUAGE:...> may not be used with Visual Studio "
|
||||||
"generators.");
|
"generators.");
|
||||||
return std::string();
|
return std::string();
|
||||||
} else if (genName.find("Xcode") != std::string::npos) {
|
}
|
||||||
|
if (genName.find("Xcode") != std::string::npos) {
|
||||||
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
|
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
|
||||||
dagChecker->EvaluatingIncludeDirectories())) {
|
dagChecker->EvaluatingIncludeDirectories())) {
|
||||||
reportError(
|
reportError(
|
||||||
|
|
|
@ -361,10 +361,9 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
|
||||||
if (implib) {
|
if (implib) {
|
||||||
// A DLL import library is treated as an archive target.
|
// A DLL import library is treated as an archive target.
|
||||||
return "ARCHIVE";
|
return "ARCHIVE";
|
||||||
} else {
|
|
||||||
// A DLL shared library is treated as a runtime target.
|
|
||||||
return "RUNTIME";
|
|
||||||
}
|
}
|
||||||
|
// A DLL shared library is treated as a runtime target.
|
||||||
|
return "RUNTIME";
|
||||||
} else {
|
} else {
|
||||||
// For non-DLL platforms shared libraries are treated as
|
// For non-DLL platforms shared libraries are treated as
|
||||||
// library targets.
|
// library targets.
|
||||||
|
@ -1324,26 +1323,23 @@ std::string cmGeneratorTarget::GetSOName(const std::string& config) const
|
||||||
// The imported library has no builtin soname so the name
|
// The imported library has no builtin soname so the name
|
||||||
// searched at runtime will be just the filename.
|
// searched at runtime will be just the filename.
|
||||||
return cmSystemTools::GetFilenameName(info->Location);
|
return cmSystemTools::GetFilenameName(info->Location);
|
||||||
} else {
|
|
||||||
// Use the soname given if any.
|
|
||||||
if (info->SOName.find("@rpath/") == 0) {
|
|
||||||
return info->SOName.substr(6);
|
|
||||||
}
|
|
||||||
return info->SOName;
|
|
||||||
}
|
}
|
||||||
} else {
|
// Use the soname given if any.
|
||||||
return "";
|
if (info->SOName.find("@rpath/") == 0) {
|
||||||
|
return info->SOName.substr(6);
|
||||||
|
}
|
||||||
|
return info->SOName;
|
||||||
}
|
}
|
||||||
} else {
|
return "";
|
||||||
// Compute the soname that will be built.
|
|
||||||
std::string name;
|
|
||||||
std::string soName;
|
|
||||||
std::string realName;
|
|
||||||
std::string impName;
|
|
||||||
std::string pdbName;
|
|
||||||
this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
|
|
||||||
return soName;
|
|
||||||
}
|
}
|
||||||
|
// Compute the soname that will be built.
|
||||||
|
std::string name;
|
||||||
|
std::string soName;
|
||||||
|
std::string realName;
|
||||||
|
std::string impName;
|
||||||
|
std::string pdbName;
|
||||||
|
this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
|
||||||
|
return soName;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
|
std::string cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
|
||||||
|
@ -1418,9 +1414,8 @@ std::string cmGeneratorTarget::GetFullName(const std::string& config,
|
||||||
{
|
{
|
||||||
if (this->IsImported()) {
|
if (this->IsImported()) {
|
||||||
return this->GetFullNameImported(config, implib);
|
return this->GetFullNameImported(config, implib);
|
||||||
} else {
|
|
||||||
return this->GetFullNameInternal(config, implib);
|
|
||||||
}
|
}
|
||||||
|
return this->GetFullNameInternal(config, implib);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
|
std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
|
||||||
|
@ -1444,9 +1439,8 @@ std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
|
||||||
}
|
}
|
||||||
dir += "/";
|
dir += "/";
|
||||||
return dir;
|
return dir;
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
|
std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
|
||||||
|
@ -1468,9 +1462,8 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dir;
|
return dir;
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
|
cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
|
||||||
|
@ -1516,9 +1509,8 @@ const char* cmGeneratorTarget::GetExportMacro() const
|
||||||
this->ExportMacro = cmSystemTools::MakeCidentifier(in);
|
this->ExportMacro = cmSystemTools::MakeCidentifier(in);
|
||||||
}
|
}
|
||||||
return this->ExportMacro.c_str();
|
return this->ExportMacro.c_str();
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
class cmTargetCollectLinkLanguages
|
class cmTargetCollectLinkLanguages
|
||||||
|
@ -1642,7 +1634,8 @@ public:
|
||||||
{
|
{
|
||||||
if (this->Preferred.empty()) {
|
if (this->Preferred.empty()) {
|
||||||
return "";
|
return "";
|
||||||
} else if (this->Preferred.size() > 1) {
|
}
|
||||||
|
if (this->Preferred.size() > 1) {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "Target " << this->Target->GetName()
|
e << "Target " << this->Target->GetName()
|
||||||
<< " contains multiple languages with the highest linker preference"
|
<< " contains multiple languages with the highest linker preference"
|
||||||
|
@ -2723,9 +2716,8 @@ std::string cmGeneratorTarget::GetFullPath(const std::string& config,
|
||||||
{
|
{
|
||||||
if (this->IsImported()) {
|
if (this->IsImported()) {
|
||||||
return this->Target->ImportedGetFullPath(config, implib);
|
return this->Target->ImportedGetFullPath(config, implib);
|
||||||
} else {
|
|
||||||
return this->NormalGetFullPath(config, implib, realname);
|
|
||||||
}
|
}
|
||||||
|
return this->NormalGetFullPath(config, implib, realname);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
|
std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
|
||||||
|
@ -2770,16 +2762,15 @@ std::string cmGeneratorTarget::NormalGetRealName(
|
||||||
std::string pdbName;
|
std::string pdbName;
|
||||||
this->GetExecutableNames(name, realName, impName, pdbName, config);
|
this->GetExecutableNames(name, realName, impName, pdbName, config);
|
||||||
return realName;
|
return realName;
|
||||||
} else {
|
|
||||||
// Compute the real name that will be built.
|
|
||||||
std::string name;
|
|
||||||
std::string soName;
|
|
||||||
std::string realName;
|
|
||||||
std::string impName;
|
|
||||||
std::string pdbName;
|
|
||||||
this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
|
|
||||||
return realName;
|
|
||||||
}
|
}
|
||||||
|
// Compute the real name that will be built.
|
||||||
|
std::string name;
|
||||||
|
std::string soName;
|
||||||
|
std::string realName;
|
||||||
|
std::string impName;
|
||||||
|
std::string pdbName;
|
||||||
|
this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
|
||||||
|
return realName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
|
void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
|
||||||
|
@ -3587,9 +3578,8 @@ std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
|
||||||
|
|
||||||
if (t == NumberMaxType) {
|
if (t == NumberMaxType) {
|
||||||
return std::make_pair(true, std::max(lnum, rnum) == lnum ? lhs : rhs);
|
return std::make_pair(true, std::max(lnum, rnum) == lnum ? lhs : rhs);
|
||||||
} else {
|
|
||||||
return std::make_pair(true, std::min(lnum, rnum) == lnum ? lhs : rhs);
|
|
||||||
}
|
}
|
||||||
|
return std::make_pair(true, std::min(lnum, rnum) == lnum ? lhs : rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -3906,11 +3896,11 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const
|
||||||
|
|
||||||
if (const char* fversion = this->GetProperty("FRAMEWORK_VERSION")) {
|
if (const char* fversion = this->GetProperty("FRAMEWORK_VERSION")) {
|
||||||
return fversion;
|
return fversion;
|
||||||
} else if (const char* tversion = this->GetProperty("VERSION")) {
|
|
||||||
return tversion;
|
|
||||||
} else {
|
|
||||||
return "A";
|
|
||||||
}
|
}
|
||||||
|
if (const char* tversion = this->GetProperty("VERSION")) {
|
||||||
|
return tversion;
|
||||||
|
}
|
||||||
|
return "A";
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
|
void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
|
||||||
|
@ -4169,7 +4159,8 @@ std::string cmGeneratorTarget::GetDirectory(const std::string& config,
|
||||||
// Return the directory from which the target is imported.
|
// Return the directory from which the target is imported.
|
||||||
return cmSystemTools::GetFilenamePath(
|
return cmSystemTools::GetFilenamePath(
|
||||||
this->Target->ImportedGetFullPath(config, implib));
|
this->Target->ImportedGetFullPath(config, implib));
|
||||||
} else if (OutputInfo const* info = this->GetOutputInfo(config)) {
|
}
|
||||||
|
if (OutputInfo const* info = this->GetOutputInfo(config)) {
|
||||||
// Return the directory in which the target will be built.
|
// Return the directory in which the target will be built.
|
||||||
return implib ? info->ImpDir : info->OutDir;
|
return implib ? info->ImpDir : info->OutDir;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,12 +93,11 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string& ident,
|
||||||
names << "ident" << VarNum++;
|
names << "ident" << VarNum++;
|
||||||
vars << names.str() << " = " << ident << "\n";
|
vars << names.str() << " = " << ident << "\n";
|
||||||
return "$" + names.str();
|
return "$" + names.str();
|
||||||
} else {
|
|
||||||
std::string result = ident;
|
|
||||||
cmSystemTools::ReplaceString(result, " ", "$ ");
|
|
||||||
cmSystemTools::ReplaceString(result, ":", "$:");
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
std::string result = ident;
|
||||||
|
cmSystemTools::ReplaceString(result, " ", "$ ");
|
||||||
|
cmSystemTools::ReplaceString(result, ":", "$:");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
|
std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
|
||||||
|
|
|
@ -63,9 +63,8 @@ void cmInstallExportGenerator::ComputeTempDir()
|
||||||
this->TempDir += "/Export";
|
this->TempDir += "/Export";
|
||||||
if (this->Destination.empty()) {
|
if (this->Destination.empty()) {
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
this->TempDir += "/";
|
|
||||||
}
|
}
|
||||||
|
this->TempDir += "/";
|
||||||
|
|
||||||
// Enforce a maximum length.
|
// Enforce a maximum length.
|
||||||
bool useMD5 = false;
|
bool useMD5 = false;
|
||||||
|
|
|
@ -259,10 +259,9 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
|
||||||
if (isError) {
|
if (isError) {
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str());
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cmListFileBacktrace::Entry : public cmListFileContext
|
struct cmListFileBacktrace::Entry : public cmListFileContext
|
||||||
|
@ -377,10 +376,9 @@ cmListFileContext const& cmListFileBacktrace::Top() const
|
||||||
{
|
{
|
||||||
if (this->Cur) {
|
if (this->Cur) {
|
||||||
return *this->Cur;
|
return *this->Cur;
|
||||||
} else {
|
|
||||||
static cmListFileContext const empty;
|
|
||||||
return empty;
|
|
||||||
}
|
}
|
||||||
|
static cmListFileContext const empty;
|
||||||
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmListFileBacktrace::PrintTitle(std::ostream& out) const
|
void cmListFileBacktrace::PrintTitle(std::ostream& out) const
|
||||||
|
|
|
@ -626,16 +626,14 @@ std::string cmLocalGenerator::ExpandRuleVariable(
|
||||||
if (variable == "TARGET_VERSION_MAJOR") {
|
if (variable == "TARGET_VERSION_MAJOR") {
|
||||||
if (replaceValues.TargetVersionMajor) {
|
if (replaceValues.TargetVersionMajor) {
|
||||||
return replaceValues.TargetVersionMajor;
|
return replaceValues.TargetVersionMajor;
|
||||||
} else {
|
|
||||||
return "0";
|
|
||||||
}
|
}
|
||||||
|
return "0";
|
||||||
}
|
}
|
||||||
if (variable == "TARGET_VERSION_MINOR") {
|
if (variable == "TARGET_VERSION_MINOR") {
|
||||||
if (replaceValues.TargetVersionMinor) {
|
if (replaceValues.TargetVersionMinor) {
|
||||||
return replaceValues.TargetVersionMinor;
|
return replaceValues.TargetVersionMinor;
|
||||||
} else {
|
|
||||||
return "0";
|
|
||||||
}
|
}
|
||||||
|
return "0";
|
||||||
}
|
}
|
||||||
if (replaceValues.Target) {
|
if (replaceValues.Target) {
|
||||||
if (variable == "TARGET_BASE") {
|
if (variable == "TARGET_BASE") {
|
||||||
|
@ -644,9 +642,8 @@ std::string cmLocalGenerator::ExpandRuleVariable(
|
||||||
std::string::size_type pos = targetBase.rfind('.');
|
std::string::size_type pos = targetBase.rfind('.');
|
||||||
if (pos != targetBase.npos) {
|
if (pos != targetBase.npos) {
|
||||||
return targetBase.substr(0, pos);
|
return targetBase.substr(0, pos);
|
||||||
} else {
|
|
||||||
return targetBase;
|
|
||||||
}
|
}
|
||||||
|
return targetBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -813,9 +810,8 @@ const char* cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
|
||||||
{
|
{
|
||||||
if (target) {
|
if (target) {
|
||||||
return target->GetProperty(prop);
|
return target->GetProperty(prop);
|
||||||
} else {
|
|
||||||
return this->Makefile->GetProperty(prop);
|
|
||||||
}
|
}
|
||||||
|
return this->Makefile->GetProperty(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalGenerator::InsertRuleLauncher(std::string& s,
|
void cmLocalGenerator::InsertRuleLauncher(std::string& s,
|
||||||
|
@ -2365,10 +2361,9 @@ static bool cmLocalGeneratorShortenObjectName(std::string& objName,
|
||||||
|
|
||||||
// The object name is now short enough.
|
// The object name is now short enough.
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// The object name could not be shortened enough.
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
// The object name could not be shortened enough.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmLocalGeneratorCheckObjectName(std::string& objName,
|
bool cmLocalGeneratorCheckObjectName(std::string& objName,
|
||||||
|
@ -2382,15 +2377,13 @@ bool cmLocalGeneratorCheckObjectName(std::string& objName,
|
||||||
if (objName.size() > max_obj_len) {
|
if (objName.size() > max_obj_len) {
|
||||||
// The current object file name is too long. Try to shorten it.
|
// The current object file name is too long. Try to shorten it.
|
||||||
return cmLocalGeneratorShortenObjectName(objName, max_obj_len);
|
return cmLocalGeneratorShortenObjectName(objName, max_obj_len);
|
||||||
} else {
|
|
||||||
// The object file name is short enough.
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} else {
|
// The object file name is short enough.
|
||||||
// The build directory in which the object will be stored is
|
return true;
|
||||||
// already too deep.
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
// The build directory in which the object will be stored is
|
||||||
|
// already too deep.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -813,11 +813,10 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
|
||||||
// The existing custom command is identical. Silently ignore
|
// The existing custom command is identical. Silently ignore
|
||||||
// the duplicate.
|
// the duplicate.
|
||||||
return file;
|
return file;
|
||||||
} else {
|
|
||||||
// The existing custom command is different. We need to
|
|
||||||
// generate a rule file for this new command.
|
|
||||||
file = CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
// The existing custom command is different. We need to
|
||||||
|
// generate a rule file for this new command.
|
||||||
|
file = CM_NULLPTR;
|
||||||
} else if (!file) {
|
} else if (!file) {
|
||||||
file = this->CreateSource(main_dependency);
|
file = this->CreateSource(main_dependency);
|
||||||
}
|
}
|
||||||
|
@ -2029,7 +2028,8 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
|
||||||
sg->SetGroupRegex(regex);
|
sg->SetGroupRegex(regex);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (i == -1) {
|
}
|
||||||
|
if (i == -1) {
|
||||||
// group does not exist nor belong to any existing group
|
// group does not exist nor belong to any existing group
|
||||||
// add its first component
|
// add its first component
|
||||||
this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex));
|
this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex));
|
||||||
|
@ -2817,13 +2817,12 @@ std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs,
|
||||||
cmSystemTools::ExpandListArgument(configTypes, configs);
|
cmSystemTools::ExpandListArgument(configTypes, configs);
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
} else {
|
|
||||||
const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
|
||||||
if (singleConfig && !buildType.empty()) {
|
|
||||||
configs.push_back(buildType);
|
|
||||||
}
|
|
||||||
return buildType;
|
|
||||||
}
|
}
|
||||||
|
const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
||||||
|
if (singleConfig && !buildType.empty()) {
|
||||||
|
configs.push_back(buildType);
|
||||||
|
}
|
||||||
|
return buildType;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
@ -3129,9 +3128,8 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
|
||||||
{
|
{
|
||||||
if (cmSourceFile* esf = this->GetSource(sourceName)) {
|
if (cmSourceFile* esf = this->GetSource(sourceName)) {
|
||||||
return esf;
|
return esf;
|
||||||
} else {
|
|
||||||
return this->CreateSource(sourceName, generated);
|
|
||||||
}
|
}
|
||||||
|
return this->CreateSource(sourceName, generated);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::EnableLanguage(std::vector<std::string> const& lang,
|
void cmMakefile::EnableLanguage(std::vector<std::string> const& lang,
|
||||||
|
@ -3756,69 +3754,67 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
|
||||||
<< "\" because an imported target with the same name already exists.";
|
<< "\" because an imported target with the same name already exists.";
|
||||||
msg = e.str();
|
msg = e.str();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
// target names must be globally unique
|
|
||||||
switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
|
|
||||||
case cmPolicies::WARN:
|
|
||||||
this->IssueMessage(
|
|
||||||
cmake::AUTHOR_WARNING,
|
|
||||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
|
|
||||||
case cmPolicies::OLD:
|
|
||||||
return true;
|
|
||||||
case cmPolicies::REQUIRED_IF_USED:
|
|
||||||
case cmPolicies::REQUIRED_ALWAYS:
|
|
||||||
this->IssueMessage(
|
|
||||||
cmake::FATAL_ERROR,
|
|
||||||
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0002));
|
|
||||||
return true;
|
|
||||||
case cmPolicies::NEW:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The conflict is with a non-imported target.
|
|
||||||
// Allow this if the user has requested support.
|
|
||||||
cmake* cm = this->GetCMakeInstance();
|
|
||||||
if (isCustom && existing->GetType() == cmState::UTILITY &&
|
|
||||||
this != existing->GetMakefile() &&
|
|
||||||
cm->GetState()->GetGlobalPropertyAsBool(
|
|
||||||
"ALLOW_DUPLICATE_CUSTOM_TARGETS")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Produce an error that tells the user how to work around the
|
|
||||||
// problem.
|
|
||||||
std::ostringstream e;
|
|
||||||
e << "cannot create target \"" << name
|
|
||||||
<< "\" because another target with the same name already exists. "
|
|
||||||
<< "The existing target is ";
|
|
||||||
switch (existing->GetType()) {
|
|
||||||
case cmState::EXECUTABLE:
|
|
||||||
e << "an executable ";
|
|
||||||
break;
|
|
||||||
case cmState::STATIC_LIBRARY:
|
|
||||||
e << "a static library ";
|
|
||||||
break;
|
|
||||||
case cmState::SHARED_LIBRARY:
|
|
||||||
e << "a shared library ";
|
|
||||||
break;
|
|
||||||
case cmState::MODULE_LIBRARY:
|
|
||||||
e << "a module library ";
|
|
||||||
break;
|
|
||||||
case cmState::UTILITY:
|
|
||||||
e << "a custom target ";
|
|
||||||
break;
|
|
||||||
case cmState::INTERFACE_LIBRARY:
|
|
||||||
e << "an interface library ";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
e << "created in source directory \""
|
|
||||||
<< existing->GetMakefile()->GetCurrentSourceDirectory() << "\". "
|
|
||||||
<< "See documentation for policy CMP0002 for more details.";
|
|
||||||
msg = e.str();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
// target names must be globally unique
|
||||||
|
switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
|
||||||
|
case cmPolicies::WARN:
|
||||||
|
this->IssueMessage(cmake::AUTHOR_WARNING,
|
||||||
|
cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
|
||||||
|
case cmPolicies::OLD:
|
||||||
|
return true;
|
||||||
|
case cmPolicies::REQUIRED_IF_USED:
|
||||||
|
case cmPolicies::REQUIRED_ALWAYS:
|
||||||
|
this->IssueMessage(
|
||||||
|
cmake::FATAL_ERROR,
|
||||||
|
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0002));
|
||||||
|
return true;
|
||||||
|
case cmPolicies::NEW:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The conflict is with a non-imported target.
|
||||||
|
// Allow this if the user has requested support.
|
||||||
|
cmake* cm = this->GetCMakeInstance();
|
||||||
|
if (isCustom && existing->GetType() == cmState::UTILITY &&
|
||||||
|
this != existing->GetMakefile() &&
|
||||||
|
cm->GetState()->GetGlobalPropertyAsBool(
|
||||||
|
"ALLOW_DUPLICATE_CUSTOM_TARGETS")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Produce an error that tells the user how to work around the
|
||||||
|
// problem.
|
||||||
|
std::ostringstream e;
|
||||||
|
e << "cannot create target \"" << name
|
||||||
|
<< "\" because another target with the same name already exists. "
|
||||||
|
<< "The existing target is ";
|
||||||
|
switch (existing->GetType()) {
|
||||||
|
case cmState::EXECUTABLE:
|
||||||
|
e << "an executable ";
|
||||||
|
break;
|
||||||
|
case cmState::STATIC_LIBRARY:
|
||||||
|
e << "a static library ";
|
||||||
|
break;
|
||||||
|
case cmState::SHARED_LIBRARY:
|
||||||
|
e << "a shared library ";
|
||||||
|
break;
|
||||||
|
case cmState::MODULE_LIBRARY:
|
||||||
|
e << "a module library ";
|
||||||
|
break;
|
||||||
|
case cmState::UTILITY:
|
||||||
|
e << "a custom target ";
|
||||||
|
break;
|
||||||
|
case cmState::INTERFACE_LIBRARY:
|
||||||
|
e << "an interface library ";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
e << "created in source directory \""
|
||||||
|
<< existing->GetMakefile()->GetCurrentSourceDirectory() << "\". "
|
||||||
|
<< "See documentation for policy CMP0002 for more details.";
|
||||||
|
msg = e.str();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4246,15 +4242,15 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
|
||||||
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
|
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
|
||||||
cmArrayEnd(C_STANDARDS), cmStrCmp("11"))) {
|
cmArrayEnd(C_STANDARDS), cmStrCmp("11"))) {
|
||||||
return false;
|
return false;
|
||||||
} else if (needC99 && existingCStandard &&
|
}
|
||||||
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
|
if (needC99 && existingCStandard &&
|
||||||
cmArrayEnd(C_STANDARDS),
|
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
|
||||||
cmStrCmp("99"))) {
|
cmArrayEnd(C_STANDARDS), cmStrCmp("99"))) {
|
||||||
return false;
|
return false;
|
||||||
} else if (needC90 && existingCStandard &&
|
}
|
||||||
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
|
if (needC90 && existingCStandard &&
|
||||||
cmArrayEnd(C_STANDARDS),
|
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
|
||||||
cmStrCmp("90"))) {
|
cmArrayEnd(C_STANDARDS), cmStrCmp("90"))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -4332,10 +4328,11 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
|
||||||
cmArrayEnd(CXX_STANDARDS),
|
cmArrayEnd(CXX_STANDARDS),
|
||||||
cmStrCmp("11"))) {
|
cmStrCmp("11"))) {
|
||||||
return false;
|
return false;
|
||||||
} else if (needCxx98 &&
|
}
|
||||||
existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
|
if (needCxx98 &&
|
||||||
cmArrayEnd(CXX_STANDARDS),
|
existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
|
||||||
cmStrCmp("98"))) {
|
cmArrayEnd(CXX_STANDARDS),
|
||||||
|
cmStrCmp("98"))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -34,19 +34,18 @@ bool cmNewLineStyle::ReadFromArguments(const std::vector<std::string>& args,
|
||||||
if (eol == "LF" || eol == "UNIX") {
|
if (eol == "LF" || eol == "UNIX") {
|
||||||
NewLineStyle = LF;
|
NewLineStyle = LF;
|
||||||
return true;
|
return true;
|
||||||
} else if (eol == "CRLF" || eol == "WIN32" || eol == "DOS") {
|
}
|
||||||
|
if (eol == "CRLF" || eol == "WIN32" || eol == "DOS") {
|
||||||
NewLineStyle = CRLF;
|
NewLineStyle = CRLF;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
errorString = "NEWLINE_STYLE sets an unknown style, only LF, "
|
|
||||||
"CRLF, UNIX, DOS, and WIN32 are supported";
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
errorString = "NEWLINE_STYLE sets an unknown style, only LF, "
|
||||||
errorString = "NEWLINE_STYLE must set a style: "
|
"CRLF, UNIX, DOS, and WIN32 are supported";
|
||||||
"LF, CRLF, UNIX, DOS, or WIN32";
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
errorString = "NEWLINE_STYLE must set a style: "
|
||||||
|
"LF, CRLF, UNIX, DOS, or WIN32";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -347,7 +347,8 @@ static std::string GetRccExecutable(cmGeneratorTarget const* target)
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
return qt5Rcc->ImportedGetLocation("");
|
return qt5Rcc->ImportedGetLocation("");
|
||||||
} else if (strcmp(qtVersion, "4") == 0) {
|
}
|
||||||
|
if (strcmp(qtVersion, "4") == 0) {
|
||||||
cmGeneratorTarget* qt4Rcc = lg->FindGeneratorTargetToUse("Qt4::rcc");
|
cmGeneratorTarget* qt4Rcc = lg->FindGeneratorTargetToUse("Qt4::rcc");
|
||||||
if (!qt4Rcc) {
|
if (!qt4Rcc) {
|
||||||
cmSystemTools::Error("Qt4::rcc target not found ", targetName.c_str());
|
cmSystemTools::Error("Qt4::rcc target not found ", targetName.c_str());
|
||||||
|
|
|
@ -295,9 +295,8 @@ const char* cmSourceFile::GetProperty(const std::string& prop) const
|
||||||
if (prop == "LOCATION") {
|
if (prop == "LOCATION") {
|
||||||
if (this->FullPath.empty()) {
|
if (this->FullPath.empty()) {
|
||||||
return CM_NULLPTR;
|
return CM_NULLPTR;
|
||||||
} else {
|
|
||||||
return this->FullPath.c_str();
|
|
||||||
}
|
}
|
||||||
|
return this->FullPath.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* retVal = this->Properties.GetPropertyValue(prop);
|
const char* retVal = this->Properties.GetPropertyValue(prop);
|
||||||
|
|
|
@ -1702,7 +1702,8 @@ const char* cmState::Directory::GetProperty(const std::string& prop,
|
||||||
return parent.GetDirectory().GetCurrentSource();
|
return parent.GetDirectory().GetCurrentSource();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
} else if (prop == "LISTFILE_STACK") {
|
}
|
||||||
|
if (prop == "LISTFILE_STACK") {
|
||||||
std::vector<std::string> listFiles;
|
std::vector<std::string> listFiles;
|
||||||
cmState::Snapshot snp = this->Snapshot_;
|
cmState::Snapshot snp = this->Snapshot_;
|
||||||
while (snp.IsValid()) {
|
while (snp.IsValid()) {
|
||||||
|
@ -1712,10 +1713,12 @@ const char* cmState::Directory::GetProperty(const std::string& prop,
|
||||||
std::reverse(listFiles.begin(), listFiles.end());
|
std::reverse(listFiles.begin(), listFiles.end());
|
||||||
output = cmJoin(listFiles, ";");
|
output = cmJoin(listFiles, ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == "CACHE_VARIABLES") {
|
}
|
||||||
|
if (prop == "CACHE_VARIABLES") {
|
||||||
output = cmJoin(this->Snapshot_.State->GetCacheEntryKeys(), ";");
|
output = cmJoin(this->Snapshot_.State->GetCacheEntryKeys(), ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == "VARIABLES") {
|
}
|
||||||
|
if (prop == "VARIABLES") {
|
||||||
std::vector<std::string> res = this->Snapshot_.ClosureKeys();
|
std::vector<std::string> res = this->Snapshot_.ClosureKeys();
|
||||||
std::vector<std::string> cacheKeys =
|
std::vector<std::string> cacheKeys =
|
||||||
this->Snapshot_.State->GetCacheEntryKeys();
|
this->Snapshot_.State->GetCacheEntryKeys();
|
||||||
|
@ -1723,13 +1726,16 @@ const char* cmState::Directory::GetProperty(const std::string& prop,
|
||||||
std::sort(res.begin(), res.end());
|
std::sort(res.begin(), res.end());
|
||||||
output = cmJoin(res, ";");
|
output = cmJoin(res, ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == "INCLUDE_DIRECTORIES") {
|
}
|
||||||
|
if (prop == "INCLUDE_DIRECTORIES") {
|
||||||
output = cmJoin(this->GetIncludeDirectoriesEntries(), ";");
|
output = cmJoin(this->GetIncludeDirectoriesEntries(), ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == "COMPILE_OPTIONS") {
|
}
|
||||||
|
if (prop == "COMPILE_OPTIONS") {
|
||||||
output = cmJoin(this->GetCompileOptionsEntries(), ";");
|
output = cmJoin(this->GetCompileOptionsEntries(), ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == "COMPILE_DEFINITIONS") {
|
}
|
||||||
|
if (prop == "COMPILE_DEFINITIONS") {
|
||||||
output = cmJoin(this->GetCompileDefinitionsEntries(), ";");
|
output = cmJoin(this->GetCompileDefinitionsEntries(), ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,9 +333,8 @@ void cmSystemTools::Message(const char* m1, const char* title)
|
||||||
(*s_MessageCallback)(m1, title, s_DisableMessages,
|
(*s_MessageCallback)(m1, title, s_DisableMessages,
|
||||||
s_MessageCallbackClientData);
|
s_MessageCallbackClientData);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
std::cerr << m1 << std::endl << std::flush;
|
|
||||||
}
|
}
|
||||||
|
std::cerr << m1 << std::endl << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmSystemTools::ReportLastSystemError(const char* msg)
|
void cmSystemTools::ReportLastSystemError(const char* msg)
|
||||||
|
@ -1688,7 +1687,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
|
||||||
if (pipe == cmsysProcess_Pipe_Timeout) {
|
if (pipe == cmsysProcess_Pipe_Timeout) {
|
||||||
// Timeout has been exceeded.
|
// Timeout has been exceeded.
|
||||||
return pipe;
|
return pipe;
|
||||||
} else if (pipe == cmsysProcess_Pipe_STDOUT) {
|
}
|
||||||
|
if (pipe == cmsysProcess_Pipe_STDOUT) {
|
||||||
// Append to the stdout buffer.
|
// Append to the stdout buffer.
|
||||||
std::vector<char>::size_type size = out.size();
|
std::vector<char>::size_type size = out.size();
|
||||||
out.insert(out.end(), data, data + length);
|
out.insert(out.end(), data, data + length);
|
||||||
|
@ -1704,13 +1704,13 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
|
||||||
line.append(&out[0], outiter - out.begin());
|
line.append(&out[0], outiter - out.begin());
|
||||||
out.erase(out.begin(), out.end());
|
out.erase(out.begin(), out.end());
|
||||||
return cmsysProcess_Pipe_STDOUT;
|
return cmsysProcess_Pipe_STDOUT;
|
||||||
} else if (!err.empty()) {
|
}
|
||||||
|
if (!err.empty()) {
|
||||||
line.append(&err[0], erriter - err.begin());
|
line.append(&err[0], erriter - err.begin());
|
||||||
err.erase(err.begin(), err.end());
|
err.erase(err.begin(), err.end());
|
||||||
return cmsysProcess_Pipe_STDERR;
|
return cmsysProcess_Pipe_STDERR;
|
||||||
} else {
|
|
||||||
return cmsysProcess_Pipe_None;
|
|
||||||
}
|
}
|
||||||
|
return cmsysProcess_Pipe_None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2218,13 +2218,12 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
|
||||||
// The new rpath is empty and there is no rpath anyway so it is
|
// The new rpath is empty and there is no rpath anyway so it is
|
||||||
// okay.
|
// okay.
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
if (emsg) {
|
|
||||||
*emsg = "No valid ELF RPATH or RUNPATH entry exists in the file; ";
|
|
||||||
*emsg += elf.GetErrorMessage();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (emsg) {
|
||||||
|
*emsg = "No valid ELF RPATH or RUNPATH entry exists in the file; ";
|
||||||
|
*emsg += elf.GetErrorMessage();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < se_count; ++i) {
|
for (int i = 0; i < se_count; ++i) {
|
||||||
|
@ -2382,7 +2381,8 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
|
||||||
if (lhs < rhs) {
|
if (lhs < rhs) {
|
||||||
// lhs < rhs, so true if operation is LESS
|
// lhs < rhs, so true if operation is LESS
|
||||||
return (op & cmSystemTools::OP_LESS) != 0;
|
return (op & cmSystemTools::OP_LESS) != 0;
|
||||||
} else if (lhs > rhs) {
|
}
|
||||||
|
if (lhs > rhs) {
|
||||||
// lhs > rhs, so true if operation is GREATER
|
// lhs > rhs, so true if operation is GREATER
|
||||||
return (op & cmSystemTools::OP_GREATER) != 0;
|
return (op & cmSystemTools::OP_GREATER) != 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -774,12 +774,14 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||||
<< prop << "\" is not allowed.";
|
<< prop << "\" is not allowed.";
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
return;
|
return;
|
||||||
} else if (prop == "NAME") {
|
}
|
||||||
|
if (prop == "NAME") {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "NAME property is read-only\n";
|
e << "NAME property is read-only\n";
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
return;
|
return;
|
||||||
} else if (prop == "INCLUDE_DIRECTORIES") {
|
}
|
||||||
|
if (prop == "INCLUDE_DIRECTORIES") {
|
||||||
this->Internal->IncludeDirectoriesEntries.clear();
|
this->Internal->IncludeDirectoriesEntries.clear();
|
||||||
this->Internal->IncludeDirectoriesBacktraces.clear();
|
this->Internal->IncludeDirectoriesBacktraces.clear();
|
||||||
if (value) {
|
if (value) {
|
||||||
|
@ -856,12 +858,14 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
|
||||||
<< prop << "\" is not allowed.";
|
<< prop << "\" is not allowed.";
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
return;
|
return;
|
||||||
} else if (prop == "NAME") {
|
}
|
||||||
|
if (prop == "NAME") {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "NAME property is read-only\n";
|
e << "NAME property is read-only\n";
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
return;
|
return;
|
||||||
} else if (prop == "INCLUDE_DIRECTORIES") {
|
}
|
||||||
|
if (prop == "INCLUDE_DIRECTORIES") {
|
||||||
if (value && *value) {
|
if (value && *value) {
|
||||||
this->Internal->IncludeDirectoriesEntries.push_back(value);
|
this->Internal->IncludeDirectoriesEntries.push_back(value);
|
||||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||||
|
@ -1230,9 +1234,10 @@ const char* cmTarget::GetProperty(const std::string& prop,
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
}
|
}
|
||||||
// the type property returns what type the target is
|
// the type property returns what type the target is
|
||||||
else if (prop == propTYPE) {
|
if (prop == propTYPE) {
|
||||||
return cmState::GetTargetTypeName(this->GetType());
|
return cmState::GetTargetTypeName(this->GetType());
|
||||||
} else if (prop == propINCLUDE_DIRECTORIES) {
|
}
|
||||||
|
if (prop == propINCLUDE_DIRECTORIES) {
|
||||||
if (this->Internal->IncludeDirectoriesEntries.empty()) {
|
if (this->Internal->IncludeDirectoriesEntries.empty()) {
|
||||||
return CM_NULLPTR;
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
@ -1240,7 +1245,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
|
||||||
static std::string output;
|
static std::string output;
|
||||||
output = cmJoin(this->Internal->IncludeDirectoriesEntries, ";");
|
output = cmJoin(this->Internal->IncludeDirectoriesEntries, ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == propCOMPILE_FEATURES) {
|
}
|
||||||
|
if (prop == propCOMPILE_FEATURES) {
|
||||||
if (this->Internal->CompileFeaturesEntries.empty()) {
|
if (this->Internal->CompileFeaturesEntries.empty()) {
|
||||||
return CM_NULLPTR;
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
@ -1248,7 +1254,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
|
||||||
static std::string output;
|
static std::string output;
|
||||||
output = cmJoin(this->Internal->CompileFeaturesEntries, ";");
|
output = cmJoin(this->Internal->CompileFeaturesEntries, ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == propCOMPILE_OPTIONS) {
|
}
|
||||||
|
if (prop == propCOMPILE_OPTIONS) {
|
||||||
if (this->Internal->CompileOptionsEntries.empty()) {
|
if (this->Internal->CompileOptionsEntries.empty()) {
|
||||||
return CM_NULLPTR;
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
@ -1256,7 +1263,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
|
||||||
static std::string output;
|
static std::string output;
|
||||||
output = cmJoin(this->Internal->CompileOptionsEntries, ";");
|
output = cmJoin(this->Internal->CompileOptionsEntries, ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == propCOMPILE_DEFINITIONS) {
|
}
|
||||||
|
if (prop == propCOMPILE_DEFINITIONS) {
|
||||||
if (this->Internal->CompileDefinitionsEntries.empty()) {
|
if (this->Internal->CompileDefinitionsEntries.empty()) {
|
||||||
return CM_NULLPTR;
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
@ -1264,15 +1272,20 @@ const char* cmTarget::GetProperty(const std::string& prop,
|
||||||
static std::string output;
|
static std::string output;
|
||||||
output = cmJoin(this->Internal->CompileDefinitionsEntries, ";");
|
output = cmJoin(this->Internal->CompileDefinitionsEntries, ";");
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
} else if (prop == propIMPORTED) {
|
}
|
||||||
|
if (prop == propIMPORTED) {
|
||||||
return this->IsImported() ? "TRUE" : "FALSE";
|
return this->IsImported() ? "TRUE" : "FALSE";
|
||||||
} else if (prop == propNAME) {
|
}
|
||||||
|
if (prop == propNAME) {
|
||||||
return this->GetName().c_str();
|
return this->GetName().c_str();
|
||||||
} else if (prop == propBINARY_DIR) {
|
}
|
||||||
|
if (prop == propBINARY_DIR) {
|
||||||
return this->GetMakefile()->GetCurrentBinaryDirectory();
|
return this->GetMakefile()->GetCurrentBinaryDirectory();
|
||||||
} else if (prop == propSOURCE_DIR) {
|
}
|
||||||
|
if (prop == propSOURCE_DIR) {
|
||||||
return this->GetMakefile()->GetCurrentSourceDirectory();
|
return this->GetMakefile()->GetCurrentSourceDirectory();
|
||||||
} else if (prop == propSOURCES) {
|
}
|
||||||
|
if (prop == propSOURCES) {
|
||||||
if (this->Internal->SourceEntries.empty()) {
|
if (this->Internal->SourceEntries.empty()) {
|
||||||
return CM_NULLPTR;
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,13 +180,14 @@ bool cmUuid::IntFromHexDigit(char input, char& output) const
|
||||||
if (input >= '0' && input <= '9') {
|
if (input >= '0' && input <= '9') {
|
||||||
output = char(input - '0');
|
output = char(input - '0');
|
||||||
return true;
|
return true;
|
||||||
} else if (input >= 'a' && input <= 'f') {
|
}
|
||||||
|
if (input >= 'a' && input <= 'f') {
|
||||||
output = char(input - 'a' + 0xA);
|
output = char(input - 'a' + 0xA);
|
||||||
return true;
|
return true;
|
||||||
} else if (input >= 'A' && input <= 'F') {
|
}
|
||||||
|
if (input >= 'A' && input <= 'F') {
|
||||||
output = char(input - 'A' + 0xA);
|
output = char(input - 'A' + 0xA);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1513,9 +1513,8 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
|
||||||
if (this->GetWorkingMode() != NORMAL_MODE) {
|
if (this->GetWorkingMode() != NORMAL_MODE) {
|
||||||
if (cmSystemTools::GetErrorOccuredFlag()) {
|
if (cmSystemTools::GetErrorOccuredFlag()) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If MAKEFLAGS are given in the environment, remove the environment
|
// If MAKEFLAGS are given in the environment, remove the environment
|
||||||
|
@ -2063,11 +2062,10 @@ cmInstalledFile* cmake::GetOrCreateInstalledFile(cmMakefile* mf,
|
||||||
if (i != this->InstalledFiles.end()) {
|
if (i != this->InstalledFiles.end()) {
|
||||||
cmInstalledFile& file = i->second;
|
cmInstalledFile& file = i->second;
|
||||||
return &file;
|
return &file;
|
||||||
} else {
|
|
||||||
cmInstalledFile& file = this->InstalledFiles[name];
|
|
||||||
file.SetName(mf, name);
|
|
||||||
return &file;
|
|
||||||
}
|
}
|
||||||
|
cmInstalledFile& file = this->InstalledFiles[name];
|
||||||
|
file.SetName(mf, name);
|
||||||
|
return &file;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const
|
cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const
|
||||||
|
@ -2078,9 +2076,8 @@ cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const
|
||||||
if (i != this->InstalledFiles.end()) {
|
if (i != this->InstalledFiles.end()) {
|
||||||
cmInstalledFile const& file = i->second;
|
cmInstalledFile const& file = i->second;
|
||||||
return &file;
|
return &file;
|
||||||
} else {
|
|
||||||
return CM_NULLPTR;
|
|
||||||
}
|
}
|
||||||
|
return CM_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmake::GetSystemInformation(std::vector<std::string>& args)
|
int cmake::GetSystemInformation(std::vector<std::string>& args)
|
||||||
|
@ -2253,11 +2250,10 @@ static bool cmakeCheckStampFile(const char* stampName)
|
||||||
std::cout << "CMake does not need to re-run because " << stampName
|
std::cout << "CMake does not need to re-run because " << stampName
|
||||||
<< " is up-to-date.\n";
|
<< " is up-to-date.\n";
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
cmSystemTools::RemoveFile(stampTemp);
|
|
||||||
cmSystemTools::Error("Cannot restore timestamp ", stampName);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
cmSystemTools::RemoveFile(stampTemp);
|
||||||
|
cmSystemTools::Error("Cannot restore timestamp ", stampName);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cmakeCheckStampList(const char* stampList)
|
static bool cmakeCheckStampList(const char* stampList)
|
||||||
|
|
|
@ -163,7 +163,8 @@ int main(int ac, char const* const* av)
|
||||||
if (ac > 1) {
|
if (ac > 1) {
|
||||||
if (strcmp(av[1], "--build") == 0) {
|
if (strcmp(av[1], "--build") == 0) {
|
||||||
return do_build(ac, av);
|
return do_build(ac, av);
|
||||||
} else if (strcmp(av[1], "-E") == 0) {
|
}
|
||||||
|
if (strcmp(av[1], "-E") == 0) {
|
||||||
return do_command(ac, av);
|
return do_command(ac, av);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +238,8 @@ int do_cmake(int ac, char const* const* av)
|
||||||
"Use cmake-gui or ccmake for an interactive dialog.\n";
|
"Use cmake-gui or ccmake for an interactive dialog.\n";
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(av[i], "--system-information") == 0) {
|
}
|
||||||
|
if (strcmp(av[i], "--system-information") == 0) {
|
||||||
sysinfo = true;
|
sysinfo = true;
|
||||||
} else if (strcmp(av[i], "-N") == 0) {
|
} else if (strcmp(av[i], "-N") == 0) {
|
||||||
view_only = true;
|
view_only = true;
|
||||||
|
@ -313,9 +315,8 @@ int do_cmake(int ac, char const* const* av)
|
||||||
// interpret negative return values as errors.
|
// interpret negative return values as errors.
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_build(int ac, char const* const* av)
|
static int do_build(int ac, char const* const* av)
|
||||||
|
|
|
@ -262,7 +262,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
// run include what you use command and then run the compile
|
// run include what you use command and then run the compile
|
||||||
// command. This is an internal undocumented option and should
|
// command. This is an internal undocumented option and should
|
||||||
// only be used by CMake itself when running iwyu.
|
// only be used by CMake itself when running iwyu.
|
||||||
else if (args[1] == "__run_iwyu") {
|
if (args[1] == "__run_iwyu") {
|
||||||
if (args.size() < 3) {
|
if (args.size() < 3) {
|
||||||
std::cerr << "__run_iwyu Usage: -E __run_iwyu [--iwyu=/path/iwyu]"
|
std::cerr << "__run_iwyu Usage: -E __run_iwyu [--iwyu=/path/iwyu]"
|
||||||
" [--tidy=/path/tidy] -- compile command\n";
|
" [--tidy=/path/tidy] -- compile command\n";
|
||||||
|
@ -393,13 +393,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Echo string
|
// Echo string
|
||||||
else if (args[1] == "echo") {
|
if (args[1] == "echo") {
|
||||||
std::cout << cmJoin(cmMakeRange(args).advance(2), " ") << std::endl;
|
std::cout << cmJoin(cmMakeRange(args).advance(2), " ") << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Echo string no new line
|
// Echo string no new line
|
||||||
else if (args[1] == "echo_append") {
|
if (args[1] == "echo_append") {
|
||||||
std::cout << cmJoin(cmMakeRange(args).advance(2), " ");
|
std::cout << cmJoin(cmMakeRange(args).advance(2), " ");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -851,7 +851,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
cmSystemTools::Error("Can not use compression flags with format: ",
|
cmSystemTools::Error("Can not use compression flags with format: ",
|
||||||
format.c_str());
|
format.c_str());
|
||||||
return 1;
|
return 1;
|
||||||
} else if (nCompress > 1) {
|
}
|
||||||
|
if (nCompress > 1) {
|
||||||
cmSystemTools::Error("Can only compress a tar file one way; "
|
cmSystemTools::Error("Can only compress a tar file one way; "
|
||||||
"at most one flag of z, j, or J may be used");
|
"at most one flag of z, j, or J may be used");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -995,12 +996,12 @@ static void cmcmdProgressReport(std::string const& dir, std::string const& num)
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (!progFile) {
|
if (!progFile) {
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
if (1 != fscanf(progFile, "%i", &count)) {
|
|
||||||
cmSystemTools::Message("Could not read from progress file.");
|
|
||||||
}
|
|
||||||
fclose(progFile);
|
|
||||||
}
|
}
|
||||||
|
if (1 != fscanf(progFile, "%i", &count)) {
|
||||||
|
cmSystemTools::Message("Could not read from progress file.");
|
||||||
|
}
|
||||||
|
fclose(progFile);
|
||||||
|
|
||||||
const char* last = num.c_str();
|
const char* last = num.c_str();
|
||||||
for (const char* c = last;; ++c) {
|
for (const char* c = last;; ++c) {
|
||||||
if (*c == ',' || *c == '\0') {
|
if (*c == ',' || *c == '\0') {
|
||||||
|
|
Loading…
Reference in New Issue