summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/QtDialog/AddCacheEntry.cxx12
-rw-r--r--Source/QtDialog/AddCacheEntry.h3
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx25
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h10
-rw-r--r--Source/cmQtAutomoc.cxx6
-rw-r--r--Source/cmTarget.cxx23
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx57
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
9 files changed, 124 insertions, 17 deletions
diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index b4d9191..00aaf69 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -12,15 +12,16 @@
#include "AddCacheEntry.h"
#include <QMetaProperty>
+#include <QCompleter>
static const int NumTypes = 4;
-static const QString TypeStrings[NumTypes] =
+static const QString TypeStrings[NumTypes] =
{ "BOOL", "PATH", "FILEPATH", "STRING" };
-static const QCMakeProperty::PropertyType Types[NumTypes] =
- { QCMakeProperty::BOOL, QCMakeProperty::PATH,
- QCMakeProperty::FILEPATH, QCMakeProperty::STRING};
+static const QCMakeProperty::PropertyType Types[NumTypes] =
+ { QCMakeProperty::BOOL, QCMakeProperty::PATH,
+ QCMakeProperty::FILEPATH, QCMakeProperty::STRING};
-AddCacheEntry::AddCacheEntry(QWidget* p)
+AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& completions)
: QWidget(p)
{
this->setupUi(this);
@@ -42,6 +43,7 @@ AddCacheEntry::AddCacheEntry(QWidget* p)
this->setTabOrder(path, filepath);
this->setTabOrder(filepath, string);
this->setTabOrder(string, this->Description);
+ this->Name->setCompleter(new QCompleter(completions, this));
}
QString AddCacheEntry::name() const
diff --git a/Source/QtDialog/AddCacheEntry.h b/Source/QtDialog/AddCacheEntry.h
index db6baf9..e219d4e 100644
--- a/Source/QtDialog/AddCacheEntry.h
+++ b/Source/QtDialog/AddCacheEntry.h
@@ -15,6 +15,7 @@
#include <QWidget>
#include <QCheckBox>
+#include <QStringList>
#include "QCMake.h"
#include "ui_AddCacheEntry.h"
@@ -23,7 +24,7 @@ class AddCacheEntry : public QWidget, public Ui::AddCacheEntry
{
Q_OBJECT
public:
- AddCacheEntry(QWidget* p);
+ AddCacheEntry(QWidget* p, const QStringList& completions);
QString name() const;
QVariant value() const;
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index c8c4bfa..1c058d3 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -68,6 +68,9 @@ CMakeSetupDialog::CMakeSetupDialog()
int w = settings.value("Width", 700).toInt();
this->resize(w, h);
+ this->AddVariableCompletions = settings.value("AddVariableCompletionEntries",
+ QStringList("CMAKE_INSTALL_PREFIX")).toStringList();
+
QWidget* cont = new QWidget(this);
this->setupUi(cont);
this->Splitter->setStretchFactor(0, 3);
@@ -1008,7 +1011,7 @@ void CMakeSetupDialog::addCacheEntry()
dialog.resize(400, 200);
dialog.setWindowTitle(tr("Add Cache Entry"));
QVBoxLayout* l = new QVBoxLayout(&dialog);
- AddCacheEntry* w = new AddCacheEntry(&dialog);
+ AddCacheEntry* w = new AddCacheEntry(&dialog, this->AddVariableCompletions);
QDialogButtonBox* btns = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal, &dialog);
@@ -1021,6 +1024,26 @@ void CMakeSetupDialog::addCacheEntry()
{
QCMakeCacheModel* m = this->CacheValues->cacheModel();
m->insertProperty(w->type(), w->name(), w->description(), w->value(), false);
+
+ // only add variable names to the completion which are new
+ if (!this->AddVariableCompletions.contains(w->name()))
+ {
+ this->AddVariableCompletions << w->name();
+ // limit to at most 100 completion items
+ if (this->AddVariableCompletions.size() > 100)
+ {
+ this->AddVariableCompletions.removeFirst();
+ }
+ // make sure CMAKE_INSTALL_PREFIX is always there
+ if (!this->AddVariableCompletions.contains("CMAKE_INSTALL_PREFIX"))
+ {
+ this->AddVariableCompletions << QString("CMAKE_INSTALL_PREFIX");
+ }
+ QSettings settings;
+ settings.beginGroup("Settings/StartPath");
+ settings.setValue("AddVariableCompletionEntries",
+ this->AddVariableCompletions);
+ }
}
}
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 5121759..2599675 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -36,7 +36,7 @@ public slots:
void setBinaryDirectory(const QString& dir);
void setSourceDirectory(const QString& dir);
-protected slots:
+protected slots:
void initialize();
void doConfigure();
void doGenerate();
@@ -46,7 +46,7 @@ protected slots:
void doInterrupt();
void error(const QString& message);
void message(const QString& message);
-
+
void doSourceBrowse();
void doBinaryBrowse();
void doReloadCache();
@@ -105,6 +105,8 @@ protected:
QTextCharFormat ErrorFormat;
QTextCharFormat MessageFormat;
+ QStringList AddVariableCompletions;
+
QEventLoop LocalLoop;
float ProgressOffset;
@@ -118,8 +120,8 @@ class QCMakeThread : public QThread
public:
QCMakeThread(QObject* p);
QCMake* cmakeInstance() const;
-
-signals:
+
+signals:
void cmakeInitialized();
protected:
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 7a80f28..d07f84b 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -49,11 +49,11 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
{
cmMakefile* makefile = target->GetMakefile();
const char* targetName = target->GetName();
- // don't do anything if there is no Qt4 or Qt5SrcTools (which contains moc):
+ // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
if (qtMajorVersion == "")
{
- qtMajorVersion = makefile->GetSafeDefinition("Qt5SrcTools_VERSION_MAJOR");
+ qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
}
if (qtMajorVersion != "4" && qtMajorVersion != "5")
{
@@ -229,7 +229,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
if (this->QtMajorVersion == "")
{
this->QtMajorVersion = makefile->GetSafeDefinition(
- "AM_Qt5SrcTools_VERSION_MAJOR");
+ "AM_Qt5Core_VERSION_MAJOR");
}
this->Sources = makefile->GetSafeDefinition("AM_SOURCES");
this->Headers = makefile->GetSafeDefinition("AM_HEADERS");
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dad0353..d021990 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1038,6 +1038,29 @@ void cmTarget::DefineProperties(cmake *cm)
"Can be set to change the visual studio source code control "
"auxpath property.");
cm->DefineProperty
+ ("VS_GLOBAL_PROJECT_TYPES", cmProperty::TARGET,
+ "Visual Studio project type(s).",
+ "Can be set to one or more UUIDs recognized by Visual Studio "
+ "to indicate the type of project. This value is copied "
+ "verbatim into the generated project file. Example for a "
+ "managed C++ unit testing project: \""
+ "{3AC096D0-A1C2-E12C-1390-A8335801FDAB};"
+ "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\". UUIDs are "
+ "semicolon-delimited.");
+ cm->DefineProperty
+ ("VS_GLOBAL_KEYWORD", cmProperty::TARGET,
+ "Visual Studio project keyword.",
+ "Sets the \"keyword\" attribute for a generated Visual Studio "
+ "project. Defaults to \"Win32Proj\". You may wish to override "
+ "this value with \"ManagedCProj\", for example, in a Visual "
+ "Studio managed C++ unit test project.");
+ cm->DefineProperty
+ ("VS_DOTNET_REFERENCES", cmProperty::TARGET,
+ "Visual Studio managed project .NET references",
+ "Adds one or more semicolon-delimited .NET references to a "
+ "generated Visual Studio project. For example, \"System;"
+ "System.Windows.Forms\".");
+ cm->DefineProperty
("VS_GLOBAL_<variable>", cmProperty::TARGET,
"Visual Studio project-specific global variable.",
"Tell the Visual Studio generator to set the global variable "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index fcb668a..a219ae9 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -178,6 +178,15 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<ProjectGUID>", 2);
(*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n";
+ const char* vsProjectTypes =
+ this->Target->GetProperty("VS_GLOBAL_PROJECT_TYPES");
+ if(vsProjectTypes)
+ {
+ this->WriteString("<ProjectTypes>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(vsProjectTypes) <<
+ "</ProjectTypes>\n";
+ }
+
const char* vsProjectName = this->Target->GetProperty("VS_SCC_PROJECTNAME");
const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH");
const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER");
@@ -203,7 +212,19 @@ void cmVisualStudio10TargetGenerator::Generate()
}
}
- this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
+ const char* vsGlobalKeyword =
+ this->Target->GetProperty("VS_GLOBAL_KEYWORD");
+ if(!vsGlobalKeyword)
+ {
+ this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
+ }
+ else
+ {
+ this->WriteString("<Keyword>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(vsGlobalKeyword) <<
+ "</Keyword>\n";
+ }
+
this->WriteString("<Platform>", 2);
(*this->BuildFileStream) << this->Platform << "</Platform>\n";
const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
@@ -233,6 +254,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteCustomCommands();
this->WriteObjSources();
this->WriteCLSources();
+ this->WriteDotNetReferences();
this->WriteProjectReferences();
this->WriteString(
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
@@ -244,6 +266,39 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteGroups();
}
+void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
+{
+ const char* vsDotNetReferences
+ = this->Target->GetProperty("VS_DOTNET_REFERENCES");
+ if(vsDotNetReferences)
+ {
+ std::string references(vsDotNetReferences);
+ std::string::size_type position = 0;
+
+ this->WriteString("<ItemGroup>\n", 1);
+ while(references.length() > 0)
+ {
+ if((position = references.find(";")) == std::string::npos)
+ {
+ position = references.length() + 1;
+ }
+
+ this->WriteString("<Reference Include=\"", 2);
+ (*this->BuildFileStream) <<
+ cmVS10EscapeXML(references.substr(0, position)) << "\">\n";
+ this->WriteString("<CopyLocalSatelliteAssemblies>true"
+ "</CopyLocalSatelliteAssemblies>\n", 3);
+ this->WriteString("<ReferenceOutputAssembly>true"
+ "</ReferenceOutputAssembly>\n", 3);
+ this->WriteString("</Reference>\n", 2);
+
+ references.erase(0, position + 1);
+ }
+
+ this->WriteString("</ItemGroup>\n", 1);
+ }
+}
+
// ConfigurationType Application, Utility StaticLibrary DynamicLibrary
void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index c3c27f4..6702509 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -47,6 +47,7 @@ private:
void WriteProjectConfigurations();
void WriteProjectConfigurationValues();
void WriteCLSources();
+ void WriteDotNetReferences();
void WriteObjSources();
void WritePathAndIncrementalLinkOptions();
void WriteItemDefinitionGroups();
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 6ee8947..bd72486 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2011)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 11)
+SET(KWSYS_DATE_STAMP_MONTH 12)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 26)
+SET(KWSYS_DATE_STAMP_DAY 01)