summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx17
-rw-r--r--Source/CPack/cmCPackGenerator.h3
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx32
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx2
-rw-r--r--Source/CTest/cmCTestGIT.cxx57
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx37
-rw-r--r--Source/CTest/cmCTestSleepCommand.h9
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestVC.cxx5
-rw-r--r--Source/CTest/cmCTestVC.h3
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx153
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h12
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx28
-rw-r--r--Source/QtDialog/QCMakeCacheView.h4
-rw-r--r--Source/cmAddCustomCommandCommand.cxx1
-rw-r--r--Source/cmCacheManager.cxx2
-rw-r--r--Source/cmCoreTryCompile.cxx37
-rw-r--r--Source/cmDepends.cxx2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx19
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h1
-rw-r--r--Source/cmFileCommand.h7
-rw-r--r--Source/cmGlobalGenerator.cxx22
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx14
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h10
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.cxx49
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.h3
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx14
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx9
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx6
-rw-r--r--Source/cmLocalVisualStudio10Generator.h4
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx14
-rw-r--r--Source/cmLocalVisualStudioGenerator.h7
-rw-r--r--Source/cmMakefile.cxx10
-rw-r--r--Source/cmMakefileTargetGenerator.cxx21
-rw-r--r--Source/cmSourceFile.cxx4
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmTarget.cxx48
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx11
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx14
-rw-r--r--Source/cmake.cxx4
-rw-r--r--Source/kwsys/CMakeLists.txt6
-rw-r--r--Source/kwsys/SystemInformation.cxx351
-rw-r--r--Source/kwsys/SystemTools.cxx6
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Source/kwsys/testSystemTools.cxx2
50 files changed, 681 insertions, 404 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index ded329d..46be99b 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -285,7 +285,7 @@ bool cmCPackArchiveGenerator::SupportsComponentInstallation() const {
// The Component installation support should only
// be activated if explicitly requested by the user
// (for backward compatibility reason)
- if (IsSet("CPACK_ARCHIVE_COMPONENT_INSTALL"))
+ if (IsOn("CPACK_ARCHIVE_COMPONENT_INSTALL"))
{
return true;
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 92e5b6a..feda52c 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -551,7 +551,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::vector<std::string> componentsVector;
bool componentInstall = false;
- if (this->SupportsComponentInstallation())
+ /*
+ * We do a component install iff
+ * - the CPack generator support component
+ * - the user did not request Monolithic install
+ * (this works at CPack time too)
+ */
+ if (this->SupportsComponentInstallation() &
+ !(this->IsSet("CPACK_MONOLITHIC_INSTALL")))
{
// Determine the installation types for this project (if provided).
std::string installTypesVar = "CPACK_"
@@ -1063,7 +1070,13 @@ bool cmCPackGenerator::IsSet(const char* name) const
}
//----------------------------------------------------------------------
-const char* cmCPackGenerator::GetOption(const char* op)
+bool cmCPackGenerator::IsOn(const char* name) const
+{
+ return cmSystemTools::IsOn(GetOption(name));
+}
+
+//----------------------------------------------------------------------
+const char* cmCPackGenerator::GetOption(const char* op) const
{
const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret)
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index c450763..f44a334 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -88,8 +88,9 @@ public:
//! Set and get the options
void SetOption(const char* op, const char* value);
void SetOptionIfNotSet(const char* op, const char* value);
- const char* GetOption(const char* op);
+ const char* GetOption(const char* op) const;
bool IsSet(const char* name) const;
+ bool IsOn(const char* name) const;
//! Set all the variables
int SetCMakeRoot();
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index d0eda81..f25866c 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -337,6 +337,7 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl);
std::vector<std::string> path;
std::string nsisPath;
+ bool gotRegValue = true;
#ifdef _WIN32
if ( !cmsys::SystemTools::ReadRegistryValue(
@@ -346,24 +347,37 @@ int cmCPackNSISGenerator::InitializeInternal()
if ( !cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
{
- cmCPackLogger
- (cmCPackLog::LOG_ERROR,
- "Cannot find NSIS registry value. This is usually caused by NSIS "
- "not being installed. Please install NSIS from "
- "http://nsis.sourceforge.net"
- << std::endl);
- return 0;
+ gotRegValue = false;
}
}
- path.push_back(nsisPath);
+
+ if (gotRegValue)
+ {
+ path.push_back(nsisPath);
+ }
#endif
+
nsisPath = cmSystemTools::FindProgram("makensis", path, false);
+
if ( nsisPath.empty() )
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find NSIS compiler"
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Cannot find NSIS compiler makensis: likely it is not installed, "
+ "or not in your PATH"
<< std::endl);
+
+ if (!gotRegValue)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Could not read NSIS registry value. This is usually caused by "
+ "NSIS not being installed. Please install NSIS from "
+ "http://nsis.sourceforge.net"
+ << std::endl);
+ }
+
return 0;
}
+
std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: "
<< nsisCmd.c_str() << std::endl);
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 34e93d3..a5db78f 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -108,7 +108,7 @@ int cmCPackRPMGenerator::PackageFiles()
bool cmCPackRPMGenerator::SupportsComponentInstallation() const
{
- if (IsSet("CPACK_RPM_COMPONENT_INSTALL"))
+ if (IsOn("CPACK_RPM_COMPONENT_INSTALL"))
{
return true;
}
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index a6f10ec..aa9e55b 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -503,28 +503,15 @@ private:
this->ParsePerson(this->Line.c_str()+7, author);
this->Rev.Author = author.Name;
this->Rev.EMail = author.EMail;
-
- // Convert the time to a human-readable format that is also easy
- // to machine-parse: "CCYY-MM-DD hh:mm:ss".
- time_t seconds = static_cast<time_t>(author.Time);
- struct tm* t = gmtime(&seconds);
- char dt[1024];
- sprintf(dt, "%04d-%02d-%02d %02d:%02d:%02d",
- t->tm_year+1900, t->tm_mon+1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec);
- this->Rev.Date = dt;
-
- // Add the time-zone field "+zone" or "-zone".
- char tz[32];
- if(author.TimeZone >= 0)
- {
- sprintf(tz, " +%04ld", author.TimeZone);
- }
- else
- {
- sprintf(tz, " -%04ld", -author.TimeZone);
- }
- this->Rev.Date += tz;
+ this->Rev.Date = this->FormatDateTime(author);
+ }
+ else if(strncmp(this->Line.c_str(), "committer ", 10) == 0)
+ {
+ Person committer;
+ this->ParsePerson(this->Line.c_str()+10, committer);
+ this->Rev.Committer = committer.Name;
+ this->Rev.CommitterEMail = committer.EMail;
+ this->Rev.CommitDate = this->FormatDateTime(committer);
}
}
@@ -537,6 +524,32 @@ private:
}
this->Rev.Log += "\n";
}
+
+ std::string FormatDateTime(Person const& person)
+ {
+ // Convert the time to a human-readable format that is also easy
+ // to machine-parse: "CCYY-MM-DD hh:mm:ss".
+ time_t seconds = static_cast<time_t>(person.Time);
+ struct tm* t = gmtime(&seconds);
+ char dt[1024];
+ sprintf(dt, "%04d-%02d-%02d %02d:%02d:%02d",
+ t->tm_year+1900, t->tm_mon+1, t->tm_mday,
+ t->tm_hour, t->tm_min, t->tm_sec);
+ std::string out = dt;
+
+ // Add the time-zone field "+zone" or "-zone".
+ char tz[32];
+ if(person.TimeZone >= 0)
+ {
+ sprintf(tz, " +%04ld", person.TimeZone);
+ }
+ else
+ {
+ sprintf(tz, " -%04ld", -person.TimeZone);
+ }
+ out += tz;
+ return out;
+ }
};
char const cmCTestGIT::CommitParser::SectionSep[SectionCount] =
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 93c2963..94614cf 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -653,32 +653,37 @@ bool cmCTestMultiProcessHandler::CheckCycles()
it != this->Tests.end(); ++it)
{
//DFS from each element to itself
+ int root = it->first;
+ std::set<int> visited;
std::stack<int> s;
- std::vector<int> visited;
-
- s.push(it->first);
-
+ s.push(root);
while(!s.empty())
{
int test = s.top();
s.pop();
-
- for(TestSet::iterator d = this->Tests[test].begin();
- d != this->Tests[test].end(); ++d)
+ if(visited.insert(test).second)
{
- if(std::find(visited.begin(), visited.end(), *d) != visited.end())
+ for(TestSet::iterator d = this->Tests[test].begin();
+ d != this->Tests[test].end(); ++d)
{
- //cycle exists
- cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
- "the test dependency graph for the test \""
- << this->Properties[it->first]->Name << "\"." << std::endl
- << "Please fix the cycle and run ctest again." << std::endl);
- return false;
+ if(*d == root)
+ {
+ //cycle exists
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Error: a cycle exists in the test dependency graph "
+ "for the test \"" << this->Properties[root]->Name <<
+ "\".\nPlease fix the cycle and run ctest again.\n");
+ return false;
+ }
+ else
+ {
+ s.push(*d);
+ }
}
- s.push(*d);
}
- visited.push_back(test);
}
}
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Checking test dependency graph end" << std::endl);
return true;
}
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index 411eb01..468cd85 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -63,11 +63,10 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " ctest_sleep( seconds )\n"
- " ctest_sleep( time1 duration time2 )\n"
- "With one argument it will sleep for a given number of seconds. "
- "With three arguments it will wait for time2 - time1 - duration "
- "seconds.";
+ " ctest_sleep(<seconds>)\n"
+ "Sleep for given number of seconds.\n"
+ " ctest_sleep(<time1> <duration> <time2>)\n"
+ "Sleep for t=(time1 + duration - time2) seconds if t > 0.";
}
cmTypeMacro(cmCTestSleepCommand, cmCTestCommand);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 6dd348d..6eec3c8 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -438,6 +438,8 @@ void cmCTestTestHandler::Initialize()
this->TestsToRun.clear();
+ this->UseIncludeLabelRegExpFlag = false;
+ this->UseExcludeLabelRegExpFlag = false;
this->UseIncludeRegExpFlag = false;
this->UseExcludeRegExpFlag = false;
this->UseExcludeRegExpFirst = false;
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index f9ad79a..fbee227 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -228,6 +228,11 @@ void cmCTestVC::WriteXMLEntry(std::ostream& xml,
<< "\t\t\t<CheckinDate>" << cmXMLSafe(rev.Date) << "</CheckinDate>\n"
<< "\t\t\t<Author>" << cmXMLSafe(rev.Author) << "</Author>\n"
<< "\t\t\t<Email>" << cmXMLSafe(rev.EMail) << "</Email>\n"
+ << "\t\t\t<Committer>" << cmXMLSafe(rev.Committer) << "</Committer>\n"
+ << "\t\t\t<CommitterEmail>" << cmXMLSafe(rev.CommitterEMail)
+ << "</CommitterEmail>\n"
+ << "\t\t\t<CommitDate>" << cmXMLSafe(rev.CommitDate)
+ << "</CommitDate>\n"
<< "\t\t\t<Log>" << cmXMLSafe(rev.Log) << "</Log>\n"
<< "\t\t\t<Revision>" << cmXMLSafe(rev.Rev) << "</Revision>\n"
<< "\t\t\t<PriorRevision>" << cmXMLSafe(prior) << "</PriorRevision>\n"
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index d36bc8f..44e1dac 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -74,6 +74,9 @@ protected:
std::string Date;
std::string Author;
std::string EMail;
+ std::string Committer;
+ std::string CommitterEMail;
+ std::string CommitDate;
std::string Log;
};
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 29fcfc0..408dbac 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -55,7 +55,7 @@ void QCMakeThread::run()
}
CMakeSetupDialog::CMakeSetupDialog()
- : ExitAfterGenerate(true), CacheModified(false), CurrentState(Interrupting)
+ : ExitAfterGenerate(true), CacheModified(false), ConfigureNeeded(true), CurrentState(Interrupting)
{
QString title = QString(tr("CMake %1"));
title = title.arg(cmVersion::GetCMakeVersion());
@@ -167,6 +167,9 @@ CMakeSetupDialog::CMakeSetupDialog()
this->CMakeThread->start();
this->enterState(ReadyConfigure);
+
+ ProgressOffset = 0.0;
+ ProgressFactor = 1.0;
}
void CMakeSetupDialog::initialize()
@@ -179,12 +182,11 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)),
this, SLOT(doConfigure()));
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(configureDone(int)),
- this, SLOT(finishConfigure(int)));
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(generateDone(int)),
- this, SLOT(finishGenerate(int)));
+
+ QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(configureDone(int)),
+ this, SLOT(exitLoop(int)));
+ QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(generateDone(int)),
+ this, SLOT(exitLoop(int)));
QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)),
this, SLOT(doGenerate()));
@@ -270,15 +272,8 @@ CMakeSetupDialog::~CMakeSetupDialog()
this->CMakeThread->wait(2000);
}
-void CMakeSetupDialog::doConfigure()
+bool CMakeSetupDialog::prepareConfigure()
{
- if(this->CurrentState == Configuring)
- {
- // stop configure
- doInterrupt();
- return;
- }
-
// make sure build directory exists
QString bindir = this->CMakeThread->cmakeInstance()->binaryDirectory();
QDir dir(bindir);
@@ -295,7 +290,7 @@ void CMakeSetupDialog::doConfigure()
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::No)
{
- return;
+ return false;
}
if(!dir.mkpath("."))
{
@@ -303,7 +298,7 @@ void CMakeSetupDialog::doConfigure()
QString(tr("Failed to create directory %1")).arg(dir.path()),
QMessageBox::Ok);
- return;
+ return false;
}
}
@@ -312,27 +307,45 @@ void CMakeSetupDialog::doConfigure()
{
if(!this->setupFirstConfigure())
{
- return;
+ return false;
}
}
// remember path
this->addBinaryPath(dir.absolutePath());
- this->enterState(Configuring);
+ return true;
+}
- this->CacheValues->selectionModel()->clear();
- QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "setProperties", Qt::QueuedConnection,
- Q_ARG(QCMakePropertyList,
- this->CacheValues->cacheModel()->properties()));
- QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "configure", Qt::QueuedConnection);
+void CMakeSetupDialog::exitLoop(int err)
+{
+ this->LocalLoop.exit(err);
}
-void CMakeSetupDialog::finishConfigure(int err)
+void CMakeSetupDialog::doConfigure()
{
- if(0 == err && !this->CacheValues->cacheModel()->newPropertyCount())
+ if(this->CurrentState == Configuring)
+ {
+ // stop configure
+ doInterrupt();
+ return;
+ }
+
+ if(!prepareConfigure())
+ {
+ return;
+ }
+
+ this->enterState(Configuring);
+
+ bool ret = doConfigureInternal();
+
+ if(ret)
+ {
+ this->ConfigureNeeded = false;
+ }
+
+ if(ret && !this->CacheValues->cacheModel()->newPropertyCount())
{
this->enterState(ReadyGenerate);
}
@@ -341,6 +354,22 @@ void CMakeSetupDialog::finishConfigure(int err)
this->enterState(ReadyConfigure);
this->CacheValues->scrollToTop();
}
+ this->ProgressBar->reset();
+}
+
+bool CMakeSetupDialog::doConfigureInternal()
+{
+ this->Output->clear();
+ this->CacheValues->selectionModel()->clear();
+
+ QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
+ "setProperties", Qt::QueuedConnection,
+ Q_ARG(QCMakePropertyList,
+ this->CacheValues->cacheModel()->properties()));
+ QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
+ "configure", Qt::QueuedConnection);
+
+ int err = this->LocalLoop.exec();
if(err != 0)
{
@@ -348,23 +377,31 @@ void CMakeSetupDialog::finishConfigure(int err)
tr("Error in configuration process, project files may be invalid"),
QMessageBox::Ok);
}
+
+ return 0 == err;
}
-void CMakeSetupDialog::finishGenerate(int err)
+void CMakeSetupDialog::doInstallForCommandLine()
{
- this->enterState(ReadyConfigure);
+ QMacInstallDialog setupdialog(0);
+ setupdialog.exec();
+}
+
+bool CMakeSetupDialog::doGenerateInternal()
+{
+ QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
+ "generate", Qt::QueuedConnection);
+
+ int err = this->LocalLoop.exec();
+
if(err != 0)
{
QMessageBox::critical(this, tr("Error"),
tr("Error in generation process, project files may be invalid"),
QMessageBox::Ok);
}
-}
-void CMakeSetupDialog::doInstallForCommandLine()
-{
- QMacInstallDialog setupdialog(0);
- setupdialog.exec();
+ return 0 == err;
}
void CMakeSetupDialog::doGenerate()
@@ -375,9 +412,43 @@ void CMakeSetupDialog::doGenerate()
doInterrupt();
return;
}
+
+ // see if we need to configure
+ // we'll need to configure if:
+ // the configure step hasn't been done yet
+ // generate was the last step done
+ if(this->ConfigureNeeded)
+ {
+ if(!prepareConfigure())
+ {
+ return;
+ }
+ }
+
this->enterState(Generating);
- QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "generate", Qt::QueuedConnection);
+
+ bool config_passed = true;
+ if(this->ConfigureNeeded)
+ {
+ this->CacheValues->cacheModel()->setShowNewProperties(false);
+ this->ProgressFactor = 0.5;
+ config_passed = doConfigureInternal();
+ this->ProgressOffset = 0.5;
+ }
+
+ if(config_passed)
+ {
+ doGenerateInternal();
+ }
+
+ this->ProgressOffset = 0.0;
+ this->ProgressFactor = 1.0;
+ this->CacheValues->cacheModel()->setShowNewProperties(true);
+
+ this->enterState(ReadyConfigure);
+ this->ProgressBar->reset();
+
+ this->ConfigureNeeded = true;
}
void CMakeSetupDialog::closeEvent(QCloseEvent* e)
@@ -542,6 +613,7 @@ void CMakeSetupDialog::setSourceDirectory(const QString& dir)
void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
+ percent = (percent * ProgressFactor) + ProgressOffset;
this->ProgressBar->setValue(qRound(percent * 100));
}
@@ -883,7 +955,6 @@ void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
}
else if(s == Configuring)
{
- this->Output->clear();
this->setEnabledState(false);
this->GenerateButton->setEnabled(false);
this->GenerateAction->setEnabled(false);
@@ -899,17 +970,15 @@ void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
}
else if(s == ReadyConfigure)
{
- this->ProgressBar->reset();
this->setEnabledState(true);
- this->GenerateButton->setEnabled(false);
- this->GenerateAction->setEnabled(false);
+ this->GenerateButton->setEnabled(true);
+ this->GenerateAction->setEnabled(true);
this->ConfigureButton->setEnabled(true);
this->ConfigureButton->setText(tr("&Configure"));
this->GenerateButton->setText(tr("&Generate"));
}
else if(s == ReadyGenerate)
{
- this->ProgressBar->reset();
this->setEnabledState(true);
this->GenerateButton->setEnabled(true);
this->GenerateAction->setEnabled(true);
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 0e3caec..1934795 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -16,6 +16,7 @@
#include "QCMake.h"
#include <QMainWindow>
#include <QThread>
+#include <QEventLoop>
#include "ui_CMakeSetupDialog.h"
class QCMakeThread;
@@ -43,8 +44,6 @@ protected slots:
void doHelp();
void doAbout();
void doInterrupt();
- void finishConfigure(int error);
- void finishGenerate(int error);
void error(const QString& message);
void message(const QString& message);
@@ -74,6 +73,10 @@ protected slots:
void setGroupedView(bool);
void showUserChanges();
void setSearchFilter(const QString& str);
+ bool prepareConfigure();
+ bool doConfigureInternal();
+ bool doGenerateInternal();
+ void exitLoop(int);
protected:
@@ -87,6 +90,7 @@ protected:
QCMakeThread* CMakeThread;
bool ExitAfterGenerate;
bool CacheModified;
+ bool ConfigureNeeded;
QAction* ReloadCacheAction;
QAction* DeleteCacheAction;
QAction* ExitAction;
@@ -99,6 +103,10 @@ protected:
QTextCharFormat ErrorFormat;
QTextCharFormat MessageFormat;
+ QEventLoop LocalLoop;
+
+ float ProgressOffset;
+ float ProgressFactor;
};
// QCMake instance on a thread
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index d90307a..562396d 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -200,6 +200,7 @@ QCMakeCacheModel::QCMakeCacheModel(QObject* p)
NewPropertyCount(0),
View(FlatView)
{
+ this->ShowNewProperties = true;
QStringList labels;
labels << tr("Name") << tr("Value");
this->setHorizontalHeaderLabels(labels);
@@ -214,6 +215,11 @@ static uint qHash(const QCMakeProperty& p)
return qHash(p.Key);
}
+void QCMakeCacheModel::setShowNewProperties(bool f)
+{
+ this->ShowNewProperties = f;
+}
+
void QCMakeCacheModel::clear()
{
this->QStandardItemModel::clear();
@@ -226,13 +232,21 @@ void QCMakeCacheModel::clear()
void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
{
- QSet<QCMakeProperty> newProps = props.toSet();
- QSet<QCMakeProperty> newProps2 = newProps;
- QSet<QCMakeProperty> oldProps = this->properties().toSet();
-
- oldProps.intersect(newProps);
- newProps.subtract(oldProps);
- newProps2.subtract(newProps);
+ QSet<QCMakeProperty> newProps, newProps2;
+
+ if(this->ShowNewProperties)
+ {
+ newProps = props.toSet();
+ newProps2 = newProps;
+ QSet<QCMakeProperty> oldProps = this->properties().toSet();
+ oldProps.intersect(newProps);
+ newProps.subtract(oldProps);
+ newProps2.subtract(newProps);
+ }
+ else
+ {
+ newProps2 = props.toSet();
+ }
bool b = this->blockSignals(true);
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 401e07e..58bbd2d 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -78,6 +78,9 @@ public slots:
// become new properties and be marked red.
void setProperties(const QCMakePropertyList& props);
+ // set whether to show new properties in red
+ void setShowNewProperties(bool);
+
// clear everything from the model
void clear();
@@ -115,6 +118,7 @@ public:
protected:
bool EditEnabled;
int NewPropertyCount;
+ bool ShowNewProperties;
ViewType View;
// set the data in the model for this property
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index f6b3234..7af6ec8 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -161,6 +161,7 @@ bool cmAddCustomCommandCommand
filename += "/";
}
filename += copy;
+ cmSystemTools::ConvertToUnixSlashes(filename);
break;
case doing_source:
// We do not want to convert the argument to SOURCE because
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 2baacbf..c8374db 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -341,7 +341,7 @@ bool cmCacheManager::LoadCache(const char* path,
std::string("The current CMakeCache.txt directory ") +
currentcwd + std::string(" is different than the directory ") +
std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
- std::string(" where CMackeCache.txt was created. This may result "
+ std::string(" where CMakeCache.txt was created. This may result "
"in binaries being created in the wrong place. If you "
"are not sure, reedit the CMakeCache.txt");
cmSystemTools::Error(message.c_str());
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index b8a0c95..0fe64ad 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -169,8 +169,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
- fprintf(fout, "cmake_minimum_required(VERSION %u.%u)\n",
- cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion());
+ fprintf(fout, "cmake_minimum_required(VERSION %u.%u.%u.%u)\n",
+ cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion(),
+ cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion());
if(def)
{
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
@@ -396,28 +397,18 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
else
{
- if(!cmSystemTools::RemoveFile(fullPath.c_str()))
+ // Sometimes anti-virus software hangs on to new files so we
+ // cannot delete them immediately. Try a few times.
+ int tries = 5;
+ while(!cmSystemTools::RemoveFile(fullPath.c_str()) &&
+ --tries && cmSystemTools::FileExists(fullPath.c_str()))
{
- bool removed = false;
- int numAttempts = 0;
- // sometimes anti-virus software hangs on to
- // new files and we can not delete them, so try
- // 5 times with .5 second delay between tries.
- while(!removed && numAttempts < 5)
- {
- cmSystemTools::Delay(500);
- if(cmSystemTools::RemoveFile(fullPath.c_str()))
- {
- removed = true;
- }
- numAttempts++;
- }
- if(!removed)
- {
- std::string m = "Remove failed on file: ";
- m += fullPath;
- cmSystemTools::ReportLastSystemError(m.c_str());
- }
+ cmSystemTools::Delay(500);
+ }
+ if(tries == 0)
+ {
+ std::string m = "Remove failed on file: " + fullPath;
+ cmSystemTools::ReportLastSystemError(m.c_str());
}
}
}
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 69ff858..19558fa 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -25,7 +25,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir):
Verbose(false),
FileComparison(0),
TargetDirectory(targetDir),
- MaxPath(cmSystemTools::GetMaximumFilePathLength()),
+ MaxPath(16384),
Dependee(new char[MaxPath]),
Depender(new char[MaxPath])
{
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 8f89b5e..502fefa 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -734,6 +734,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
;
emmited.clear();
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
+ const std::string makeArgs = mf->GetSafeDefinition(
+ "CMAKE_ECLIPSE_MAKE_ARGUMENTS");
cmGlobalGenerator* generator
= const_cast<cmGlobalGenerator*>(this->GlobalGenerator);
@@ -794,7 +796,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
if (insertTarget)
{
- this->AppendTarget(fout, ti->first, make, subdir, ": ");
+ this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": ");
}
}
break;
@@ -809,7 +811,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
break;
}
- this->AppendTarget(fout, ti->first, make, subdir, ": ");
+ this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": ");
break;
case cmTarget::EXECUTABLE:
case cmTarget::STATIC_LIBRARY:
@@ -818,10 +820,10 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ?
"[exe] " : "[lib] ");
- this->AppendTarget(fout, ti->first, make, subdir, prefix);
+ this->AppendTarget(fout, ti->first, make, makeArgs, subdir, prefix);
std::string fastTarget = ti->first;
fastTarget += "/fast";
- this->AppendTarget(fout, fastTarget, make, subdir, prefix);
+ this->AppendTarget(fout, fastTarget, make, makeArgs, subdir, prefix);
}
break;
// ignore these:
@@ -836,11 +838,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// insert the all and clean targets in every subdir
if (!allTarget.empty())
{
- this->AppendTarget(fout, allTarget, make, subdir, ": ");
+ this->AppendTarget(fout, allTarget, make, makeArgs, subdir, ": ");
}
if (!cleanTarget.empty())
{
- this->AppendTarget(fout, cleanTarget, make, subdir, ": ");
+ this->AppendTarget(fout, cleanTarget, make, makeArgs, subdir, ": ");
}
//insert rules for compiling, preprocessing and assembling individual files
@@ -860,7 +862,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
prefix = "[pre] ";
}
- this->AppendTarget(fout, *fit, make, subdir, prefix);
+ this->AppendTarget(fout, *fit, make, makeArgs, subdir, prefix);
}
}
@@ -993,6 +995,7 @@ void cmExtraEclipseCDT4Generator
void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
const std::string& target,
const std::string& make,
+ const std::string& makeArgs,
const std::string& path,
const char* prefix)
{
@@ -1003,7 +1006,7 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
"<buildCommand>"
<< cmExtraEclipseCDT4Generator::GetEclipsePath(make)
<< "</buildCommand>\n"
- "<buildArguments/>\n"
+ "<buildArguments>" << makeArgs << "</buildArguments>\n"
"<buildTarget>" << target << "</buildTarget>\n"
"<stopOnError>true</stopOnError>\n"
"<useDefaultCommand>false</useDefaultCommand>\n"
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 2ad599d..99e69c4 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -71,6 +71,7 @@ private:
static void AppendTarget (cmGeneratedFileStream& fout,
const std::string& target,
const std::string& make,
+ const std::string& makeArguments,
const std::string& path,
const char* prefix = "");
static void AppendScannerProfile (cmGeneratedFileStream& fout,
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index e771092..b11dcde 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -116,7 +116,12 @@ public:
"expressions and store it into the variable. Globbing expressions "
"are similar to regular expressions, but much simpler. If RELATIVE "
"flag is specified for an expression, the results will be returned "
- "as a relative path to the given path.\n"
+ "as a relative path to the given path. "
+ "(We do not recommend using GLOB to collect a list of source files "
+ "from your source tree. If no CMakeLists.txt file changes when a "
+ "source is added or removed then the generated build system cannot "
+ "know when to ask CMake to regenerate.)"
+ "\n"
"Examples of globbing expressions include:\n"
" *.cxx - match all files with extension cxx\n"
" *.vt? - match all files with extension vta,...,vtz\n"
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f558509..123ab5e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -814,24 +814,11 @@ void cmGlobalGenerator::Generate()
// For each existing cmLocalGenerator
unsigned int i;
- // Consolidate global targets
+ // Put a copy of each global target in every directory.
cmTargets globalTargets;
this->CreateDefaultGlobalTargets(&globalTargets);
for (i = 0; i < this->LocalGenerators.size(); ++i)
{
- cmTargets* targets =
- &(this->LocalGenerators[i]->GetMakefile()->GetTargets());
- cmTargets::iterator tarIt;
- for ( tarIt = targets->begin(); tarIt != targets->end(); ++ tarIt )
- {
- if ( tarIt->second.GetType() == cmTarget::GLOBAL_TARGET )
- {
- globalTargets[tarIt->first] = tarIt->second;
- }
- }
- }
- for (i = 0; i < this->LocalGenerators.size(); ++i)
- {
cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
cmTargets* targets = &(mf->GetTargets());
cmTargets::iterator tit;
@@ -1881,8 +1868,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
const char* name, const char* message,
const cmCustomCommandLines* commandLines,
std::vector<std::string> depends,
- const char* workingDirectory,
- bool depends_on_all /* = false */)
+ const char* workingDirectory)
{
// Package
cmTarget target;
@@ -1897,10 +1883,6 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
workingDirectory);
target.GetPostBuildCommands().push_back(cc);
target.SetProperty("EchoString", message);
- if ( depends_on_all )
- {
- target.AddUtility("all");
- }
std::vector<std::string>::iterator dit;
for ( dit = depends.begin(); dit != depends.end(); ++ dit )
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 7e43124..6a1aa53 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -291,8 +291,7 @@ protected:
void CreateDefaultGlobalTargets(cmTargets* targets);
cmTarget CreateGlobalTarget(const char* name, const char* message,
const cmCustomCommandLines* commandLines,
- std::vector<std::string> depends, const char* workingDir,
- bool depends_on_all = false);
+ std::vector<std::string> depends, const char* workingDir);
bool NeedSymbolicMark;
bool UseLinkScript;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 403507f..0b939af 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -19,6 +19,10 @@
cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
{
this->FindMakeProgramFile = "CMakeVS10FindMake.cmake";
+ std::string vc10Express;
+ this->ExpressEdition = cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
+ "ProductDir", vc10Express, cmSystemTools::KeyWOW64_32);
}
//----------------------------------------------------------------------------
@@ -63,6 +67,16 @@ void cmGlobalVisualStudio10Generator
}
//----------------------------------------------------------------------------
+const char* cmGlobalVisualStudio10Generator::GetPlatformToolset()
+{
+ if(!this->PlatformToolset.empty())
+ {
+ return this->PlatformToolset.c_str();
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------------------
std::string cmGlobalVisualStudio10Generator::GetUserMacrosDirectory()
{
std::string base;
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 219c36e..bef5642 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -54,6 +54,12 @@ public:
cmMakefile *, bool optional);
virtual void WriteSLNHeader(std::ostream& fout);
+ /** Is the installed VS an Express edition? */
+ bool IsExpressEdition() const { return this->ExpressEdition; }
+
+ /** The toolset name for the target platform. */
+ const char* GetPlatformToolset();
+
/**
* Where does this version of Visual Studio look for macros for the
* current user? Returns the empty string if this version of Visual
@@ -70,5 +76,9 @@ public:
{ return "$(Configuration)";}
protected:
virtual const char* GetIDEVersion() { return "10.0"; }
+
+ std::string PlatformToolset;
+private:
+ bool ExpressEdition;
};
#endif
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx
index 109b60d..8600777 100644
--- a/Source/cmGlobalVisualStudio10Win64Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx
@@ -36,3 +36,52 @@ void cmGlobalVisualStudio10Win64Generator
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}
+
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio10Win64Generator::Find64BitTools(cmMakefile* mf)
+{
+ if(!this->PlatformToolset.empty())
+ {
+ return true;
+ }
+ // This edition does not come with 64-bit tools. Look for them.
+ //
+ // TODO: Detect available tools? x64\v100 exists but does not work?
+ // KHLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\4.0;VCTargetsPath
+ // c:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/Platforms/
+ // {Itanium,Win32,x64}/PlatformToolsets/{v100,v90,Windows7.1SDK}
+ std::string winSDK_7_1;
+ if(cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\"
+ "Windows\\v7.1;InstallationFolder", winSDK_7_1))
+ {
+ cmOStringStream m;
+ m << "Found Windows SDK v7.1: " << winSDK_7_1;
+ mf->DisplayStatus(m.str().c_str(), -1);
+ this->PlatformToolset = "Windows7.1SDK";
+ return true;
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n"
+ << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n"
+ << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Win64Generator
+::EnableLanguage(std::vector<std::string> const& languages,
+ cmMakefile* mf, bool optional)
+{
+ if(this->IsExpressEdition() && !this->Find64BitTools(mf))
+ {
+ return;
+ }
+ this->cmGlobalVisualStudio10Generator
+ ::EnableLanguage(languages, mf, optional);
+}
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h
index 39c9d08..e6d3dc5 100644
--- a/Source/cmGlobalVisualStudio10Win64Generator.h
+++ b/Source/cmGlobalVisualStudio10Win64Generator.h
@@ -34,5 +34,8 @@ public:
virtual void AddPlatformDefinitions(cmMakefile* mf);
+ bool Find64BitTools(cmMakefile* mf);
+ virtual void EnableLanguage(std::vector<std::string>const& languages,
+ cmMakefile *, bool optional);
};
#endif
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 203ca77..fe44e20 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -197,8 +197,6 @@ void cmGlobalVisualStudio6Generator
this->GetTargetSets(projectTargets, originalTargets, root, generators);
OrderedTargetDependSet orderedProjectTargets(projectTargets);
- std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
- rootdir += "/";
for(OrderedTargetDependSet::const_iterator
tt = orderedProjectTargets.begin();
tt != orderedProjectTargets.end(); ++tt)
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index ba18687..adb5f2f 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -182,8 +182,8 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
std::string guid = this->GetGUID(dspname);
fout << project
<< dspname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << dspname << ext << "\", \"{" << guid << "}\"\n";
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << dspname << ext << "\", \"{" << guid << "}\"\n";
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
this->WriteProjectDepends(fout, dspname, dir, t);
fout << "\tEndProjectSection\n";
@@ -196,8 +196,8 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
const char* uname = ui->second.c_str();
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
<< uname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << uname << ".vcproj" << "\", \"{"
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << uname << ".vcproj" << "\", \"{"
<< this->GetGUID(uname) << "}\"\n"
<< "\tProjectSection(ProjectDependencies) = postProject\n"
<< "\t\t{" << guid << "} = {" << guid << "}\n"
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 45d6a74..51b8918 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -273,8 +273,6 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
cmLocalGenerator* root,
OrderedTargetDependSet const& projectTargets)
{
- std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
- rootdir += "/";
for(OrderedTargetDependSet::const_iterator tt =
projectTargets.begin(); tt != projectTargets.end(); ++tt)
{
@@ -301,6 +299,10 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
std::string dir = tmf->GetStartOutputDirectory();
dir = root->Convert(dir.c_str(),
cmLocalGenerator::START_OUTPUT);
+ if(dir == ".")
+ {
+ dir = ""; // msbuild cannot handle ".\" prefix
+ }
this->WriteProject(fout, vcprojName, dir.c_str(),
*target);
written = true;
@@ -516,8 +518,8 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
fout << project
<< dspname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << dspname << ext << "\", \"{"
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << dspname << ext << "\", \"{"
<< this->GetGUID(dspname) << "}\"\nEndProject\n";
UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
@@ -526,8 +528,8 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
const char* uname = ui->second.c_str();
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
<< uname << "\", \""
- << this->ConvertToSolutionPath(dir)
- << "\\" << uname << ".vcproj" << "\", \"{"
+ << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
+ << uname << ".vcproj" << "\", \"{"
<< this->GetGUID(uname) << "}\"\n"
<< "EndProject\n";
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e13acda..59ca38f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2617,7 +2617,10 @@ void cmGlobalXCodeGenerator
group->AddAttribute("BuildIndependentTargetsInParallel",
this->CreateString("YES"));
this->RootObject->AddAttribute("attributes", group);
- if (this->XcodeVersion >= 31)
+ if (this->XcodeVersion >= 32)
+ this->RootObject->AddAttribute("compatibilityVersion",
+ this->CreateString("Xcode 3.2"));
+ else if (this->XcodeVersion >= 31)
this->RootObject->AddAttribute("compatibilityVersion",
this->CreateString("Xcode 3.1"));
else
@@ -3023,7 +3026,9 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmXCodeObject::Indent(1, fout);
if(this->XcodeVersion >= 21)
{
- if (this->XcodeVersion >= 31)
+ if (this->XcodeVersion >= 32)
+ fout << "objectVersion = 46;\n";
+ else if (this->XcodeVersion >= 31)
fout << "objectVersion = 45;\n";
else if (this->XcodeVersion >= 30)
fout << "objectVersion = 44;\n";
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 57d8653..de2a837 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -117,3 +117,9 @@ void cmLocalVisualStudio10Generator
"Stored GUID",
cmCacheManager::INTERNAL);
}
+
+//----------------------------------------------------------------------------
+std::string cmLocalVisualStudio10Generator::CheckForErrorLine()
+{
+ return "if errorlevel 1 goto :VCEnd";
+}
diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h
index 5694220..06b8b09 100644
--- a/Source/cmLocalVisualStudio10Generator.h
+++ b/Source/cmLocalVisualStudio10Generator.h
@@ -36,6 +36,10 @@ public:
virtual void Generate();
virtual void ReadAndStoreExternalGUID(const char* name,
const char* path);
+
+protected:
+ virtual std::string CheckForErrorLine();
+
private:
};
#endif
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index a044363..9164beb 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -150,6 +150,18 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements
}
//----------------------------------------------------------------------------
+std::string cmLocalVisualStudioGenerator::CheckForErrorLine()
+{
+ return "if errorlevel 1 goto :VCReportError";
+}
+
+//----------------------------------------------------------------------------
+std::string cmLocalVisualStudioGenerator::GetCheckForErrorLine()
+{
+ return this->CheckForErrorLine();
+}
+
+//----------------------------------------------------------------------------
std::string
cmLocalVisualStudioGenerator
::ConstructScript(cmCustomCommand const& cc,
@@ -216,7 +228,7 @@ cmLocalVisualStudioGenerator
// sequence.
//
script += newline_text;
- script += "if errorlevel 1 goto VCReportError";
+ script += this->GetCheckForErrorLine();
}
return script;
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 551b01c..1954ac5 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -31,12 +31,19 @@ class cmLocalVisualStudioGenerator : public cmLocalGenerator
public:
cmLocalVisualStudioGenerator();
virtual ~cmLocalVisualStudioGenerator();
+
/** Construct a script from the given list of command lines. */
std::string ConstructScript(cmCustomCommand const& cc,
const char* configName,
const char* newline = "\n");
+ /** Line of batch file text that skips to the end after
+ * a failed step in a sequence of custom commands.
+ */
+ std::string GetCheckForErrorLine();
+
protected:
+ virtual std::string CheckForErrorLine();
/** Construct a custom command to make exe import lib dir. */
cmsys::auto_ptr<cmCustomCommand>
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3bce01c..cf03b80 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1365,8 +1365,8 @@ void cmMakefile::AddLinkLibraryForTarget(const char *target,
cmOStringStream e;
e << "Attempt to add link library \""
<< lib << "\" to target \""
- << target << "\" which is not built by this project.";
- cmSystemTools::Error(e.str().c_str());
+ << target << "\" which is not built in this directory.";
+ this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
}
}
@@ -3591,6 +3591,12 @@ cmTarget* cmMakefile::FindTargetToUse(const char* name)
return imported->second;
}
+ // Look for a target built in this directory.
+ if(cmTarget* t = this->FindTarget(name))
+ {
+ return t;
+ }
+
// Look for a target built in this project.
return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0, name);
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6b290ab..9dcd8f1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -849,7 +849,7 @@ cmMakefileTargetGenerator
p_depends.push_back(relativeObj);
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
temp.c_str(), p_depends, no_commands,
- true);
+ false);
}
//----------------------------------------------------------------------------
@@ -1527,6 +1527,12 @@ void cmMakefileTargetGenerator
this->LocalGenerator->AppendRuleDepend(depends,
this->BuildFileNameFull.c_str());
+ // Add a dependency on the link definitions file, if any.
+ if(!this->ModuleDefinitionFile.empty())
+ {
+ depends.push_back(this->ModuleDefinitionFile);
+ }
+
// Add dependencies on the external object files.
for(std::vector<std::string>::const_iterator obj
= this->ExternalObjects.begin();
@@ -1723,8 +1729,6 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory()
this->Target->GetProperty("Fortran_MODULE_DIRECTORY");
const char* moddir_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
- const char* moddir_default =
- this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
if(target_mod_dir && moddir_flag)
{
// Compute the full path to the module directory.
@@ -1745,10 +1749,6 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory()
// Make sure the module output directory exists.
cmSystemTools::MakeDirectory(this->FortranModuleDirectory.c_str());
}
- else if(moddir_default && moddir_flag)
- {
- this->FortranModuleDirectory = moddir_default;
- }
this->FortranModuleDirectoryComputed = true;
}
@@ -1774,7 +1774,12 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags)
}
// Add a module output directory flag if necessary.
- if(const char* mod_dir = this->GetFortranModuleDirectory())
+ const char* mod_dir = this->GetFortranModuleDirectory();
+ if(!mod_dir)
+ {
+ mod_dir = this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
+ }
+ if(mod_dir)
{
const char* moddir_flag =
this->Makefile->GetRequiredDefinition("CMAKE_Fortran_MODDIR_FLAG");
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index b793cd5..26328cf 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -472,7 +472,9 @@ void cmSourceFile::DefineProperties(cmake *cm)
"What programming language is the file.",
"A property that can be set to indicate what programming language "
"the source file is. If it is not set the language is determined "
- "based on the file extension. Typical values are CXX C etc.");
+ "based on the file extension. Typical values are CXX C etc. Setting "
+ "this property for a file means this file will be compiled. "
+ "Do not set this for header or files that should not be compiled.");
cm->DefineProperty
("LOCATION", cmProperty::SOURCE_FILE,
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 19f5c0f..2b4414d 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -606,7 +606,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const&
return false;
}
int leftOverLength = intStringLength - begin;
- if ( end < 0 || end > leftOverLength )
+ if ( end < -1 || end > leftOverLength )
{
cmOStringStream ostr;
ostr << "end index: " << end << " is out of range " << 0 << " - "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 40f68e4..9a698c0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1467,6 +1467,15 @@ cmTargetTraceDependencies
//----------------------------------------------------------------------------
void cmTarget::TraceDependencies(const char* vsProjectFile)
{
+ // CMake-generated targets have no dependencies to trace. Normally tracing
+ // would find nothing anyway, but when building CMake itself the "install"
+ // target command ends up referencing the "cmake" target but we do not
+ // really want the dependency because "install" depend on "all" anyway.
+ if(this->GetType() == cmTarget::GLOBAL_TARGET)
+ {
+ return;
+ }
+
// Use a helper object to trace the dependencies.
cmTargetTraceDependencies tracer(this, this->Internal.Get(), vsProjectFile);
tracer.Trace();
@@ -3213,6 +3222,7 @@ void cmTarget::GetLibraryNames(std::string& name,
// the library version as the soversion.
soversion = version;
}
+ bool isApple = this->Makefile->IsOn("APPLE");
// Get the components of the library name.
std::string prefix;
@@ -3224,26 +3234,33 @@ void cmTarget::GetLibraryNames(std::string& name,
name = prefix+base+suffix;
// The library's soname.
-#if defined(__APPLE__)
- soName = prefix+base;
-#else
- soName = name;
-#endif
+ if(isApple)
+ {
+ soName = prefix+base;
+ }
+ else
+ {
+ soName = name;
+ }
if(soversion)
{
soName += ".";
soName += soversion;
}
-#if defined(__APPLE__)
- soName += suffix;
-#endif
+ if(isApple)
+ {
+ soName += suffix;
+ }
// The library's real name on disk.
-#if defined(__APPLE__)
- realName = prefix+base;
-#else
+ if(isApple)
+ {
+ realName = prefix+base;
+ }
+ else
+ {
realName = name;
-#endif
+ }
if(version)
{
realName += ".";
@@ -3254,9 +3271,10 @@ void cmTarget::GetLibraryNames(std::string& name,
realName += ".";
realName += soversion;
}
-#if defined(__APPLE__)
- realName += suffix;
-#endif
+ if(isApple)
+ {
+ realName += suffix;
+ }
// The import library name.
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index 43a0d7c..ce57df7 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -62,6 +62,10 @@ public:
" target_link_libraries(<target> [item1 [item2 [...]]]\n"
" [[debug|optimized|general] <item>] ...)\n"
"Specify libraries or flags to use when linking a given target. "
+ "The named <target> must have been created in the current directory "
+ "by a command such as add_executable or add_library. "
+ "The remaining arguments specify library names or flags."
+ "\n"
"If a library name matches that of another target in the project "
"a dependency will automatically be added in the build system to make "
"sure the library being linked is up-to-date before the target links. "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index eb8320c..20ed5a8 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -244,6 +244,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
{
+ cmGlobalVisualStudio10Generator* gg =
+ static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -291,6 +293,13 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
{
this->WriteString("<CharacterSet>MultiByte</CharacterSet>\n", 2);
}
+ if(const char* toolset = gg->GetPlatformToolset())
+ {
+ std::string pts = "<PlatformToolset>";
+ pts += toolset;
+ pts += "</PlatformToolset>\n";
+ this->WriteString(pts.c_str(), 2);
+ }
this->WriteString("</PropertyGroup>\n", 1);
}
}
@@ -685,7 +694,7 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
}
(*this->BuildFileStream ) << sourceFile << "\"";
// ouput any flags specific to this source file
- if(cl && this->OutputSourceSpecificFlags(*source))
+ if(!header && cl && this->OutputSourceSpecificFlags(*source))
{
// if the source file has specific flags the tag
// is ended on a new line
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index f1bad9c..9acae0d 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -85,17 +85,15 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
// was not given explicitly in the flags we want to add an attribute
// to the generated project to disable logo suppression. Otherwise
// the GUI default is to enable suppression.
+ //
+ // Avoid this on Visual Studio 10 (and later!) because it results in:
+ // "cl ... warning D9035: option 'nologo-' has been deprecated"
+ //
if(verbose &&
+ this->Version != 10 &&
this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end())
{
- if(this->Version == 10)
- {
- this->FlagMap["SuppressStartupBanner"] = "false";
- }
- else
- {
- this->FlagMap["SuppressStartupBanner"] = "FALSE";
- }
+ this->FlagMap["SuppressStartupBanner"] = "FALSE";
}
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index ddfdc24..1b49837 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -3815,6 +3815,10 @@ int cmake::VisualStudioLink(std::vector<std::string>& args, int type)
{
hasIncremental = true;
}
+ if(cmSystemTools::Strucmp(i->c_str(), "/INCREMENTAL") == 0)
+ {
+ hasIncremental = true;
+ }
if(cmSystemTools::Strucmp(i->c_str(), "/MANIFEST:NO") == 0)
{
hasManifest = false;
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 18cae43..a35a01f 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -237,10 +237,10 @@ IF(COMMAND INSTALL)
# Setup library install rules.
SET(KWSYS_INSTALL_LIBRARY_RULE)
- IF(KWSYS_INSTALL_EXPORT_NAME)
- LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME})
- ENDIF()
IF(KWSYS_INSTALL_LIB_DIR)
+ IF(KWSYS_INSTALL_EXPORT_NAME)
+ LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME})
+ ENDIF()
# Install the shared library to the lib directory.
SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE}
LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR}
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 4818ce9..d727b32 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -151,10 +151,6 @@ public:
void RunMemoryCheck();
public:
-#define VENDOR_STRING_LENGTH (12 + 1)
-#define CHIPNAME_STRING_LENGTH (48 + 1)
-#define SERIALNUMBER_STRING_LENGTH (29 + 1)
-
typedef struct tagID
{
int Type;
@@ -163,9 +159,9 @@ public:
int Revision;
int ExtendedFamily;
int ExtendedModel;
- char ProcessorName[CHIPNAME_STRING_LENGTH];
- char Vendor[VENDOR_STRING_LENGTH];
- char SerialNumber[SERIALNUMBER_STRING_LENGTH];
+ kwsys_stl::string ProcessorName;
+ kwsys_stl::string Vendor;
+ kwsys_stl::string SerialNumber;
} ID;
typedef struct tagCPUPowerManagement
@@ -530,7 +526,12 @@ SystemInformationImplementation::SystemInformationImplementation()
this->CurrentPositionInFile = 0;
this->ChipManufacturer = UnknownManufacturer;
memset(&this->Features, 0, sizeof(CPUFeatures));
- memset(&this->ChipID, 0, sizeof(ID));
+ this->ChipID.Type = 0;
+ this->ChipID.Family = 0;
+ this->ChipID.Model = 0;
+ this->ChipID.Revision = 0;
+ this->ChipID.ExtendedFamily = 0;
+ this->ChipID.ExtendedModel = 0;
this->CPUSpeedInMHz = 0;
this->NumberOfLogicalCPU = 0;
this->NumberOfPhysicalCPU = 0;
@@ -623,7 +624,7 @@ void SystemInformationImplementation::RunMemoryCheck()
/** Get the vendor string */
const char * SystemInformationImplementation::GetVendorString()
{
- return this->ChipID.Vendor;
+ return this->ChipID.Vendor.c_str();
}
/** Get the OS Name */
@@ -726,14 +727,14 @@ kwsys_stl::string SystemInformationImplementation::GetSteppingCode()
/** Return the stepping code of the CPU present. */
const char * SystemInformationImplementation::GetExtendedProcessorName()
{
- return this->ChipID.ProcessorName;
+ return this->ChipID.ProcessorName.c_str();
}
/** Return the serial number of the processor
* in hexadecimal: xxxx-xxxx-xxxx-xxxx-xxxx-xxxx. */
const char * SystemInformationImplementation::GetProcessorSerialNumber()
{
- return this->ChipID.SerialNumber;
+ return this->ChipID.SerialNumber.c_str();
}
/** Return the logical processors per physical */
@@ -1022,21 +1023,21 @@ bool SystemInformationImplementation::RetrieveCPUFeatures()
/** Find the manufacturer given the vendor id */
void SystemInformationImplementation::FindManufacturer()
{
- if (strcmp (this->ChipID.Vendor, "GenuineIntel") == 0) this->ChipManufacturer = Intel; // Intel Corp.
- else if (strcmp (this->ChipID.Vendor, "UMC UMC UMC ") == 0) this->ChipManufacturer = UMC; // United Microelectronics Corp.
- else if (strcmp (this->ChipID.Vendor, "AuthenticAMD") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices
- else if (strcmp (this->ChipID.Vendor, "AMD ISBETTER") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices (1994)
- else if (strcmp (this->ChipID.Vendor, "CyrixInstead") == 0) this->ChipManufacturer = Cyrix; // Cyrix Corp., VIA Inc.
- else if (strcmp (this->ChipID.Vendor, "NexGenDriven") == 0) this->ChipManufacturer = NexGen; // NexGen Inc. (now AMD)
- else if (strcmp (this->ChipID.Vendor, "CentaurHauls") == 0) this->ChipManufacturer = IDT; // IDT/Centaur (now VIA)
- else if (strcmp (this->ChipID.Vendor, "RiseRiseRise") == 0) this->ChipManufacturer = Rise; // Rise
- else if (strcmp (this->ChipID.Vendor, "GenuineTMx86") == 0) this->ChipManufacturer = Transmeta; // Transmeta
- else if (strcmp (this->ChipID.Vendor, "TransmetaCPU") == 0) this->ChipManufacturer = Transmeta; // Transmeta
- else if (strcmp (this->ChipID.Vendor, "Geode By NSC") == 0) this->ChipManufacturer = NSC; // National Semiconductor
- else if (strcmp (this->ChipID.Vendor, "Sun") == 0) this->ChipManufacturer = Sun; // Sun Microelectronics
- else if (strcmp (this->ChipID.Vendor, "IBM") == 0) this->ChipManufacturer = IBM; // IBM Microelectronics
- else if (strcmp (this->ChipID.Vendor, "Motorola") == 0) this->ChipManufacturer = Motorola; // Motorola Microelectronics
- else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer
+ if (this->ChipID.Vendor == "GenuineIntel") this->ChipManufacturer = Intel; // Intel Corp.
+ else if (this->ChipID.Vendor == "UMC UMC UMC ") this->ChipManufacturer = UMC; // United Microelectronics Corp.
+ else if (this->ChipID.Vendor == "AuthenticAMD") this->ChipManufacturer = AMD; // Advanced Micro Devices
+ else if (this->ChipID.Vendor == "AMD ISBETTER") this->ChipManufacturer = AMD; // Advanced Micro Devices (1994)
+ else if (this->ChipID.Vendor == "CyrixInstead") this->ChipManufacturer = Cyrix; // Cyrix Corp., VIA Inc.
+ else if (this->ChipID.Vendor == "NexGenDriven") this->ChipManufacturer = NexGen; // NexGen Inc. (now AMD)
+ else if (this->ChipID.Vendor == "CentaurHauls") this->ChipManufacturer = IDT; // IDT/Centaur (now VIA)
+ else if (this->ChipID.Vendor == "RiseRiseRise") this->ChipManufacturer = Rise; // Rise
+ else if (this->ChipID.Vendor == "GenuineTMx86") this->ChipManufacturer = Transmeta; // Transmeta
+ else if (this->ChipID.Vendor == "TransmetaCPU") this->ChipManufacturer = Transmeta; // Transmeta
+ else if (this->ChipID.Vendor == "Geode By NSC") this->ChipManufacturer = NSC; // National Semiconductor
+ else if (this->ChipID.Vendor == "Sun") this->ChipManufacturer = Sun; // Sun Microelectronics
+ else if (this->ChipID.Vendor == "IBM") this->ChipManufacturer = IBM; // IBM Microelectronics
+ else if (this->ChipID.Vendor == "Motorola") this->ChipManufacturer = Motorola; // Motorola Microelectronics
+ else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer
}
@@ -1094,10 +1095,12 @@ bool SystemInformationImplementation::RetrieveCPUIdentity()
}
// Process the returned information.
- memcpy (this->ChipID.Vendor, &(localCPUVendor[0]), sizeof (int));
- memcpy (&(this->ChipID.Vendor[4]), &(localCPUVendor[1]), sizeof (int));
- memcpy (&(this->ChipID.Vendor[8]), &(localCPUVendor[2]), sizeof (int));
- this->ChipID.Vendor[12] = '\0';
+ char vbuf[13];
+ memcpy (&(vbuf[0]), &(localCPUVendor[0]), sizeof (int));
+ memcpy (&(vbuf[4]), &(localCPUVendor[1]), sizeof (int));
+ memcpy (&(vbuf[8]), &(localCPUVendor[2]), sizeof (int));
+ vbuf[12] = '\0';
+ this->ChipID.Vendor = vbuf;
this->FindManufacturer();
@@ -1792,7 +1795,8 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber()
}
// Process the returned information.
- sprintf (this->ChipID.SerialNumber, "%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x",
+ char sn[128];
+ sprintf (sn, "%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x",
((SerialNumber[0] & 0xff000000) >> 24),
((SerialNumber[0] & 0x00ff0000) >> 16),
((SerialNumber[0] & 0x0000ff00) >> 8),
@@ -1805,7 +1809,7 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber()
((SerialNumber[2] & 0x00ff0000) >> 16),
((SerialNumber[2] & 0x0000ff00) >> 8),
((SerialNumber[2] & 0x000000ff) >> 0));
-
+ this->ChipID.SerialNumber = sn;
return true;
#else
@@ -1873,6 +1877,15 @@ bool SystemInformationImplementation::RetrieveCPUPowerManagement()
#endif
}
+void SystemInformationStripLeadingSpace(kwsys_stl::string& str)
+{
+ // Because some manufacturers have leading white space - we have to post-process the name.
+ kwsys_stl::string::size_type pos = str.find_first_not_of(" ");
+ if(pos != kwsys_stl::string::npos)
+ {
+ str = str.substr(pos);
+ }
+}
/** */
bool SystemInformationImplementation::RetrieveExtendedCPUIdentity()
@@ -1886,7 +1899,6 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity()
return false;
#if USE_ASM_INSTRUCTIONS
- int ProcessorNameStartPos = 0;
int CPUExtendedIdentity[12];
// Use assembly to detect CPUID information...
@@ -1942,47 +1954,25 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity()
}
// Process the returned information.
- memcpy (this->ChipID.ProcessorName, &(CPUExtendedIdentity[0]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[4]), &(CPUExtendedIdentity[1]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[8]), &(CPUExtendedIdentity[2]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[12]), &(CPUExtendedIdentity[3]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[16]), &(CPUExtendedIdentity[4]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[20]), &(CPUExtendedIdentity[5]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[24]), &(CPUExtendedIdentity[6]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[28]), &(CPUExtendedIdentity[7]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[32]), &(CPUExtendedIdentity[8]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[36]), &(CPUExtendedIdentity[9]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[40]), &(CPUExtendedIdentity[10]), sizeof (int));
- memcpy (&(this->ChipID.ProcessorName[44]), &(CPUExtendedIdentity[11]), sizeof (int));
- this->ChipID.ProcessorName[48] = '\0';
+ char nbuf[49];
+ memcpy (&(nbuf[0]), &(CPUExtendedIdentity[0]), sizeof (int));
+ memcpy (&(nbuf[4]), &(CPUExtendedIdentity[1]), sizeof (int));
+ memcpy (&(nbuf[8]), &(CPUExtendedIdentity[2]), sizeof (int));
+ memcpy (&(nbuf[12]), &(CPUExtendedIdentity[3]), sizeof (int));
+ memcpy (&(nbuf[16]), &(CPUExtendedIdentity[4]), sizeof (int));
+ memcpy (&(nbuf[20]), &(CPUExtendedIdentity[5]), sizeof (int));
+ memcpy (&(nbuf[24]), &(CPUExtendedIdentity[6]), sizeof (int));
+ memcpy (&(nbuf[28]), &(CPUExtendedIdentity[7]), sizeof (int));
+ memcpy (&(nbuf[32]), &(CPUExtendedIdentity[8]), sizeof (int));
+ memcpy (&(nbuf[36]), &(CPUExtendedIdentity[9]), sizeof (int));
+ memcpy (&(nbuf[40]), &(CPUExtendedIdentity[10]), sizeof (int));
+ memcpy (&(nbuf[44]), &(CPUExtendedIdentity[11]), sizeof (int));
+ nbuf[48] = '\0';
+ this->ChipID.ProcessorName = nbuf;
// Because some manufacturers have leading white space - we have to post-process the name.
- if (this->ChipManufacturer == Intel)
- {
- for (int nCounter = 0; nCounter < CHIPNAME_STRING_LENGTH; nCounter ++)
- {
- // There will either be NULL (\0) or spaces ( ) as the leading characters.
- if ((this->ChipID.ProcessorName[nCounter] != '\0') && (this->ChipID.ProcessorName[nCounter] != ' '))
- {
- // We have found the starting position of the name.
- ProcessorNameStartPos = nCounter;
- // Terminate the loop.
- break;
- }
- }
-
- // Check to see if there is any white space at the start.
- if (ProcessorNameStartPos == 0)
- {
- return true;
- }
-
- // Now move the name forward so that there is no white space.
- memmove(this->ChipID.ProcessorName, &(this->ChipID.ProcessorName[ProcessorNameStartPos]), (CHIPNAME_STRING_LENGTH - ProcessorNameStartPos));
- }
-
+ SystemInformationStripLeadingSpace(this->ChipID.ProcessorName);
return true;
-
#else
return false;
#endif
@@ -1999,53 +1989,53 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
// Check the family / model / revision to determine the CPU ID.
switch (this->ChipID.Family) {
case 3:
- sprintf (this->ChipID.ProcessorName, "Newer i80386 family");
+ this->ChipID.ProcessorName = "Newer i80386 family";
break;
case 4:
switch (this->ChipID.Model) {
- case 0: sprintf (this->ChipID.ProcessorName,"i80486DX-25/33"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"i80486DX-50"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"i80486SX"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"i80486DX2"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"i80486SL"); break;
- case 5: sprintf (this->ChipID.ProcessorName,"i80486SX2"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"i80486DX2 WriteBack"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"i80486DX4"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"i80486DX4 WriteBack"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 80486 family"); return false;
+ case 0: this->ChipID.ProcessorName = "i80486DX-25/33"; break;
+ case 1: this->ChipID.ProcessorName = "i80486DX-50"; break;
+ case 2: this->ChipID.ProcessorName = "i80486SX"; break;
+ case 3: this->ChipID.ProcessorName = "i80486DX2"; break;
+ case 4: this->ChipID.ProcessorName = "i80486SL"; break;
+ case 5: this->ChipID.ProcessorName = "i80486SX2"; break;
+ case 7: this->ChipID.ProcessorName = "i80486DX2 WriteBack"; break;
+ case 8: this->ChipID.ProcessorName = "i80486DX4"; break;
+ case 9: this->ChipID.ProcessorName = "i80486DX4 WriteBack"; break;
+ default: this->ChipID.ProcessorName = "Unknown 80486 family"; return false;
}
break;
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"P5 A-Step"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"P5"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"P54C"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"P24T OverDrive"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"P55C"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"P54C"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"P55C (0.25micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Pentium family"); return false;
+ case 0: this->ChipID.ProcessorName = "P5 A-Step"; break;
+ case 1: this->ChipID.ProcessorName = "P5"; break;
+ case 2: this->ChipID.ProcessorName = "P54C"; break;
+ case 3: this->ChipID.ProcessorName = "P24T OverDrive"; break;
+ case 4: this->ChipID.ProcessorName = "P55C"; break;
+ case 7: this->ChipID.ProcessorName = "P54C"; break;
+ case 8: this->ChipID.ProcessorName = "P55C (0.25micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown Pentium family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"P6 A-Step"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"P6"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"Pentium II (0.28 micron)"); break;
- case 5: sprintf (this->ChipID.ProcessorName,"Pentium II (0.25 micron)"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"Pentium II With On-Die L2 Cache"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"Pentium III (0.25 micron)"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"Pentium III (0.18 micron) With 256 KB On-Die L2 Cache "); break;
- case 0xa: sprintf (this->ChipID.ProcessorName,"Pentium III (0.18 micron) With 1 Or 2 MB On-Die L2 Cache "); break;
- case 0xb: sprintf (this->ChipID.ProcessorName,"Pentium III (0.13 micron) With 256 Or 512 KB On-Die L2 Cache "); break;
- case 23: sprintf (this->ChipID.ProcessorName, "Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown P6 family"); return false;
+ case 0: this->ChipID.ProcessorName = "P6 A-Step"; break;
+ case 1: this->ChipID.ProcessorName = "P6"; break;
+ case 3: this->ChipID.ProcessorName = "Pentium II (0.28 micron)"; break;
+ case 5: this->ChipID.ProcessorName = "Pentium II (0.25 micron)"; break;
+ case 6: this->ChipID.ProcessorName = "Pentium II With On-Die L2 Cache"; break;
+ case 7: this->ChipID.ProcessorName = "Pentium III (0.25 micron)"; break;
+ case 8: this->ChipID.ProcessorName = "Pentium III (0.18 micron) With 256 KB On-Die L2 Cache "; break;
+ case 0xa: this->ChipID.ProcessorName = "Pentium III (0.18 micron) With 1 Or 2 MB On-Die L2 Cache "; break;
+ case 0xb: this->ChipID.ProcessorName = "Pentium III (0.13 micron) With 256 Or 512 KB On-Die L2 Cache "; break;
+ case 23: this->ChipID.ProcessorName = "Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz"; break;
+ default: this->ChipID.ProcessorName = "Unknown P6 family"; return false;
}
break;
case 7:
- sprintf (this->ChipID.ProcessorName,"Intel Merced (IA-64)");
+ this->ChipID.ProcessorName = "Intel Merced (IA-64)";
break;
case 0xf:
// Check the extended family bits...
@@ -2054,21 +2044,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 0:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.18 micron)"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.18 micron)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.13 micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Pentium 4 family"); return false;
+ case 0: this->ChipID.ProcessorName = "Pentium IV (0.18 micron)"; break;
+ case 1: this->ChipID.ProcessorName = "Pentium IV (0.18 micron)"; break;
+ case 2: this->ChipID.ProcessorName = "Pentium IV (0.13 micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown Pentium 4 family"; return false;
}
break;
case 1:
- sprintf (this->ChipID.ProcessorName,"Intel McKinley (IA-64)");
+ this->ChipID.ProcessorName = "Intel McKinley (IA-64)";
break;
default:
- sprintf (this->ChipID.ProcessorName,"Pentium");
+ this->ChipID.ProcessorName = "Pentium";
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Intel family");
+ this->ChipID.ProcessorName = "Unknown Intel family";
return false;
}
break;
@@ -2080,49 +2070,49 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 4:
switch (this->ChipID.Model)
{
- case 3: sprintf (this->ChipID.ProcessorName,"80486DX2"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"80486DX2 WriteBack"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"80486DX4"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"80486DX4 WriteBack"); break;
- case 0xe: sprintf (this->ChipID.ProcessorName,"5x86"); break;
- case 0xf: sprintf (this->ChipID.ProcessorName,"5x86WB"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 80486 family"); return false;
+ case 3: this->ChipID.ProcessorName = "80486DX2"; break;
+ case 7: this->ChipID.ProcessorName = "80486DX2 WriteBack"; break;
+ case 8: this->ChipID.ProcessorName = "80486DX4"; break;
+ case 9: this->ChipID.ProcessorName = "80486DX4 WriteBack"; break;
+ case 0xe: this->ChipID.ProcessorName = "5x86"; break;
+ case 0xf: this->ChipID.ProcessorName = "5x86WB"; break;
+ default: this->ChipID.ProcessorName = "Unknown 80486 family"; return false;
}
break;
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"SSA5 (PR75, PR90, PR100)"); break;
- case 1: sprintf (this->ChipID.ProcessorName,"5k86 (PR120, PR133)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"5k86 (PR166)"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"5k86 (PR200)"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"K6 (0.30 micron)"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"K6 (0.25 micron)"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"K6-2"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"K6-III"); break;
- case 0xd: sprintf (this->ChipID.ProcessorName,"K6-2+ or K6-III+ (0.18 micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 80586 family"); return false;
+ case 0: this->ChipID.ProcessorName = "SSA5 (PR75, PR90 = PR100)"; break;
+ case 1: this->ChipID.ProcessorName = "5k86 (PR120 = PR133)"; break;
+ case 2: this->ChipID.ProcessorName = "5k86 (PR166)"; break;
+ case 3: this->ChipID.ProcessorName = "5k86 (PR200)"; break;
+ case 6: this->ChipID.ProcessorName = "K6 (0.30 micron)"; break;
+ case 7: this->ChipID.ProcessorName = "K6 (0.25 micron)"; break;
+ case 8: this->ChipID.ProcessorName = "K6-2"; break;
+ case 9: this->ChipID.ProcessorName = "K6-III"; break;
+ case 0xd: this->ChipID.ProcessorName = "K6-2+ or K6-III+ (0.18 micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown 80586 family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 1: sprintf (this->ChipID.ProcessorName,"Athlon- (0.25 micron)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"Athlon- (0.18 micron)"); break;
- case 3: sprintf (this->ChipID.ProcessorName,"Duron- (SF core)"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"Athlon- (Thunderbird core)"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"Athlon- (Palomino core)"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"Duron- (Morgan core)"); break;
+ case 1: this->ChipID.ProcessorName = "Athlon- (0.25 micron)"; break;
+ case 2: this->ChipID.ProcessorName = "Athlon- (0.18 micron)"; break;
+ case 3: this->ChipID.ProcessorName = "Duron- (SF core)"; break;
+ case 4: this->ChipID.ProcessorName = "Athlon- (Thunderbird core)"; break;
+ case 6: this->ChipID.ProcessorName = "Athlon- (Palomino core)"; break;
+ case 7: this->ChipID.ProcessorName = "Duron- (Morgan core)"; break;
case 8:
if (this->Features.ExtendedFeatures.SupportsMP)
- sprintf (this->ChipID.ProcessorName,"Athlon - MP (Thoroughbred core)");
- else sprintf (this->ChipID.ProcessorName,"Athlon - XP (Thoroughbred core)");
+ this->ChipID.ProcessorName = "Athlon - MP (Thoroughbred core)";
+ else this->ChipID.ProcessorName = "Athlon - XP (Thoroughbred core)";
break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown K7 family"); return false;
+ default: this->ChipID.ProcessorName = "Unknown K7 family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown AMD family");
+ this->ChipID.ProcessorName = "Unknown AMD family";
return false;
}
break;
@@ -2133,12 +2123,12 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 4: sprintf (this->ChipID.ProcessorName,"Crusoe TM3x00 and TM5x00"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Crusoe family"); return false;
+ case 4: this->ChipID.ProcessorName = "Crusoe TM3x00 and TM5x00"; break;
+ default: this->ChipID.ProcessorName = "Unknown Crusoe family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Transmeta family");
+ this->ChipID.ProcessorName = "Unknown Transmeta family";
return false;
}
break;
@@ -2149,13 +2139,13 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"mP6 (0.25 micron)"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"mP6 (0.18 micron)"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Rise family"); return false;
+ case 0: this->ChipID.ProcessorName = "mP6 (0.25 micron)"; break;
+ case 2: this->ChipID.ProcessorName = "mP6 (0.18 micron)"; break;
+ default: this->ChipID.ProcessorName = "Unknown Rise family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Rise family");
+ this->ChipID.ProcessorName = "Unknown Rise family";
return false;
}
break;
@@ -2166,13 +2156,13 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 4:
switch (this->ChipID.Model)
{
- case 1: sprintf (this->ChipID.ProcessorName,"U5D"); break;
- case 2: sprintf (this->ChipID.ProcessorName,"U5S"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown UMC family"); return false;
+ case 1: this->ChipID.ProcessorName = "U5D"; break;
+ case 2: this->ChipID.ProcessorName = "U5S"; break;
+ default: this->ChipID.ProcessorName = "Unknown UMC family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown UMC family");
+ this->ChipID.ProcessorName = "Unknown UMC family";
return false;
}
break;
@@ -2183,21 +2173,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 4: sprintf (this->ChipID.ProcessorName,"C6"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"C2"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"C3"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); return false;
+ case 4: this->ChipID.ProcessorName = "C6"; break;
+ case 8: this->ChipID.ProcessorName = "C2"; break;
+ case 9: this->ChipID.ProcessorName = "C3"; break;
+ default: this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 6: sprintf (this->ChipID.ProcessorName,"VIA Cyrix III - Samuel"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); return false;
+ case 6: this->ChipID.ProcessorName = "VIA Cyrix III - Samuel"; break;
+ default: this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family");
+ this->ChipID.ProcessorName = "Unknown IDT\\Centaur family";
return false;
}
break;
@@ -2208,32 +2198,32 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 4:
switch (this->ChipID.Model)
{
- case 4: sprintf (this->ChipID.ProcessorName,"MediaGX GX, GXm"); break;
- case 9: sprintf (this->ChipID.ProcessorName,"5x86"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Cx5x86 family"); return false;
+ case 4: this->ChipID.ProcessorName = "MediaGX GX = GXm"; break;
+ case 9: this->ChipID.ProcessorName = "5x86"; break;
+ default: this->ChipID.ProcessorName = "Unknown Cx5x86 family"; return false;
}
break;
case 5:
switch (this->ChipID.Model)
{
- case 2: sprintf (this->ChipID.ProcessorName,"Cx6x86"); break;
- case 4: sprintf (this->ChipID.ProcessorName,"MediaGX GXm"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown Cx6x86 family"); return false;
+ case 2: this->ChipID.ProcessorName = "Cx6x86"; break;
+ case 4: this->ChipID.ProcessorName = "MediaGX GXm"; break;
+ default: this->ChipID.ProcessorName = "Unknown Cx6x86 family"; return false;
}
break;
case 6:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"6x86MX"); break;
- case 5: sprintf (this->ChipID.ProcessorName,"Cyrix M2 Core"); break;
- case 6: sprintf (this->ChipID.ProcessorName,"WinChip C5A Core"); break;
- case 7: sprintf (this->ChipID.ProcessorName,"WinChip C5B\\C5C Core"); break;
- case 8: sprintf (this->ChipID.ProcessorName,"WinChip C5C-T Core"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown 6x86MX\\Cyrix III family"); return false;
+ case 0: this->ChipID.ProcessorName = "6x86MX"; break;
+ case 5: this->ChipID.ProcessorName = "Cyrix M2 Core"; break;
+ case 6: this->ChipID.ProcessorName = "WinChip C5A Core"; break;
+ case 7: this->ChipID.ProcessorName = "WinChip C5B\\C5C Core"; break;
+ case 8: this->ChipID.ProcessorName = "WinChip C5C-T Core"; break;
+ default: this->ChipID.ProcessorName = "Unknown 6x86MX\\Cyrix III family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown Cyrix family");
+ this->ChipID.ProcessorName = "Unknown Cyrix family";
return false;
}
break;
@@ -2244,21 +2234,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
case 5:
switch (this->ChipID.Model)
{
- case 0: sprintf (this->ChipID.ProcessorName,"Nx586 or Nx586FPU"); break;
- default: sprintf (this->ChipID.ProcessorName,"Unknown NexGen family"); return false;
+ case 0: this->ChipID.ProcessorName = "Nx586 or Nx586FPU"; break;
+ default: this->ChipID.ProcessorName = "Unknown NexGen family"; return false;
}
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown NexGen family");
+ this->ChipID.ProcessorName = "Unknown NexGen family";
return false;
}
break;
case NSC:
- sprintf (this->ChipID.ProcessorName,"Cx486SLC \\ DLC \\ Cx486S A-Step");
+ this->ChipID.ProcessorName = "Cx486SLC \\ DLC \\ Cx486S A-Step";
break;
default:
- sprintf (this->ChipID.ProcessorName,"Unknown family"); // We cannot identify the processor.
+ this->ChipID.ProcessorName = "Unknown family"; // We cannot identify the processor.
return false;
}
@@ -2365,7 +2355,7 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
this->ChipID.Family = atoi(this->ExtractValueFromCpuInfoFile(buffer,"cpu family").c_str());
// Chip Vendor
- strcpy(this->ChipID.Vendor,this->ExtractValueFromCpuInfoFile(buffer,"vendor_id").c_str());
+ this->ChipID.Vendor = this->ExtractValueFromCpuInfoFile(buffer,"vendor_id");
this->FindManufacturer();
// Chip Model
@@ -2964,7 +2954,7 @@ bool SystemInformationImplementation::ParseSysCtl()
kwsys_stl::string machineBuf(retBuf);
if (machineBuf.find_first_of("Power") != kwsys_stl::string::npos)
{
- strcpy(this->ChipID.Vendor, "IBM");
+ this->ChipID.Vendor = "IBM";
len = 4;
err = sysctlbyname("hw.cputype", &this->ChipID.Family, &len, NULL, 0);
err = sysctlbyname("hw.cpusubtype", &this->ChipID.Model, &len, NULL, 0);
@@ -2982,13 +2972,14 @@ bool SystemInformationImplementation::ParseSysCtl()
len = 128;
err = sysctlbyname("machdep.cpu.vendor", retBuf, &len, NULL, 0);
// Chip Vendor
- strcpy(this->ChipID.Vendor,retBuf);
+ this->ChipID.Vendor = retBuf;
this->FindManufacturer();
- len=CHIPNAME_STRING_LENGTH;
+ ::memset(retBuf, 0, 128);
err =
sysctlbyname("machdep.cpu.brand_string",
- this->ChipID.ProcessorName, &len, NULL, 0);
+ retBuf, &len, NULL, 0);
+ this->ChipID.ProcessorName = retBuf;
// Chip Model
len = sizeof(value);
@@ -3175,11 +3166,11 @@ bool SystemInformationImplementation::QuerySolarisInfo()
this->ChipID.Family = 0;
// Chip Vendor
- strcpy(this->ChipID.Vendor,"Sun");
+ this->ChipID.Vendor = "Sun";
this->FindManufacturer();
// Chip Model
- sprintf(this->ChipID.ProcessorName,"%s",this->ParseValueFromKStat("-s cpu_type").c_str());
+ this->ChipID.ProcessorName = this->ParseValueFromKStat("-s cpu_type");
this->ChipID.Model = 0;
// Cache size
@@ -3233,7 +3224,7 @@ bool SystemInformationImplementation::QueryHaikuInfo()
char vbuf[13];
strncpy(vbuf, cpu_info.eax_0.vendor_id, 12);
vbuf[12] = '\0';
- strcpy(this->ChipID.Vendor,vbuf);
+ this->ChipID.Vendor = vbuf;
this->FindManufacturer();
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 8aa99eb..60d6869 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -378,9 +378,7 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
kwsys_stl::string::size_type endpos = pathEnv.find(pathSep, start);
if(endpos != kwsys_stl::string::npos)
{
- kwsys_stl::string convertedPath;
- Realpath(pathEnv.substr(start, endpos-start).c_str(), convertedPath);
- path.push_back(convertedPath);
+ path.push_back(pathEnv.substr(start, endpos-start));
start = endpos+1;
}
else
@@ -1642,7 +1640,7 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
kwsys_stl::string ret = path;
// remove // except at the beginning might be a cygwin drive
- kwsys_stl::string::size_type pos=0;
+ kwsys_stl::string::size_type pos=1;
while((pos = ret.find("//", pos)) != kwsys_stl::string::npos)
{
ret.erase(pos, 1);
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index fef2d01..433a86f 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010)
SET(KWSYS_DATE_STAMP_MONTH 12)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 06)
+SET(KWSYS_DATE_STAMP_DAY 21)
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index ad35c34..c0e74af 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -297,7 +297,7 @@ bool CheckStringOperations()
if (kwsys::SystemTools::ConvertToUnixOutputPath
("//Local Mojo/Hex Power Pack/Iffy Voodoo") !=
- "/Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo")
+ "//Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo")
{
kwsys_ios::cerr
<< "Problem with ConvertToUnixOutputPath "