summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx52
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h12
-rw-r--r--Source/CPack/WiX/cmWIXPatchParser.cxx36
-rw-r--r--Source/CPack/WiX/cmWIXPatchParser.h10
-rw-r--r--Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx28
-rw-r--r--Source/CPack/WiX/cmWIXRichTextFormatWriter.h2
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.cxx70
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.h8
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx37
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h2
-rw-r--r--Source/cmLocalGenerator.cxx21
-rw-r--r--Source/cmQtAutoGenerators.cxx11
-rw-r--r--Source/kwsys/Encoding.hxx.in31
-rw-r--r--Source/kwsys/EncodingCXX.cxx93
-rw-r--r--Source/kwsys/testEncoding.cxx31
18 files changed, 315 insertions, 135 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 94f3c65..c8b60f9 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20131222)
+set(CMake_VERSION_TWEAK 20131223)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 6f1daaa..c1749ac 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -85,8 +85,8 @@ bool cmCPackWIXGenerator::RunCandleCommand(
command << " -arch " << GetArchitecture();
command << " -out " << QuotePath(objectFile);
- for(extension_set_t::const_iterator i = candleExtensions.begin();
- i != candleExtensions.end(); ++i)
+ for(extension_set_t::const_iterator i = CandleExtensions.begin();
+ i != CandleExtensions.end(); ++i)
{
command << " -ext " << QuotePath(*i);
}
@@ -111,8 +111,8 @@ bool cmCPackWIXGenerator::RunLightCommand(const std::string& objectFiles)
command << " -nologo";
command << " -out " << QuotePath(packageFileNames.at(0));
- for(extension_set_t::const_iterator i = lightExtensions.begin();
- i != lightExtensions.end(); ++i)
+ for(extension_set_t::const_iterator i = LightExtensions.begin();
+ i != LightExtensions.end(); ++i)
{
command << " -ext " << QuotePath(*i);
}
@@ -211,12 +211,12 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
SetOption("CPACK_WIX_UI_REF", defaultRef.c_str());
}
- CollectExtensions("CPACK_WIX_EXTENSIONS", candleExtensions);
- CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", candleExtensions);
+ CollectExtensions("CPACK_WIX_EXTENSIONS", CandleExtensions);
+ CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", CandleExtensions);
- lightExtensions.insert("WixUIExtension");
- CollectExtensions("CPACK_WIX_EXTENSIONS", lightExtensions);
- CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", lightExtensions);
+ LightExtensions.insert("WixUIExtension");
+ CollectExtensions("CPACK_WIX_EXTENSIONS", LightExtensions);
+ CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", LightExtensions);
const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if(patchFilePath)
@@ -247,9 +247,9 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
AppendUserSuppliedExtraSources();
std::stringstream objectFiles;
- for(size_t i = 0; i < wixSources.size(); ++i)
+ for(size_t i = 0; i < WixSources.size(); ++i)
{
- const std::string& sourceFilename = wixSources[i];
+ const std::string& sourceFilename = WixSources[i];
std::string objectFilename =
cmSystemTools::GetFilenameWithoutExtension(sourceFilename) + ".wixobj";
@@ -272,7 +272,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
const char *cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
if(!cpackWixExtraSources) return;
- cmSystemTools::ExpandListArgument(cpackWixExtraSources, wixSources);
+ cmSystemTools::ExpandListArgument(cpackWixExtraSources, WixSources);
}
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
@@ -351,7 +351,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string directoryDefinitionsFilename =
cpackTopLevel + "/directories.wxs";
- wixSources.push_back(directoryDefinitionsFilename);
+ WixSources.push_back(directoryDefinitionsFilename);
cmWIXSourceWriter directoryDefinitions(Logger, directoryDefinitionsFilename);
directoryDefinitions.BeginElement("Fragment");
@@ -406,7 +406,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string fileDefinitionsFilename =
cpackTopLevel + "/files.wxs";
- wixSources.push_back(fileDefinitionsFilename);
+ WixSources.push_back(fileDefinitionsFilename);
cmWIXSourceWriter fileDefinitions(Logger, fileDefinitionsFilename);
fileDefinitions.BeginElement("Fragment");
@@ -414,7 +414,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string featureDefinitionsFilename =
cpackTopLevel +"/features.wxs";
- wixSources.push_back(featureDefinitionsFilename);
+ WixSources.push_back(featureDefinitionsFilename);
cmWIXSourceWriter featureDefinitions(Logger, featureDefinitionsFilename);
featureDefinitions.BeginElement("Fragment");
@@ -533,11 +533,11 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
return false;
}
- wixSources.push_back(mainSourceFilePath);
+ WixSources.push_back(mainSourceFilePath);
std::string fragmentList;
for(cmWIXPatchParser::fragment_map_t::const_iterator
- i = fragments.begin(); i != fragments.end(); ++i)
+ i = Fragments.begin(); i != Fragments.end(); ++i)
{
if(!fragmentList.empty())
{
@@ -765,7 +765,7 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
fileDefinitions.EndElement("RemoveFolder");
std::string registryKey =
- std::string("Software/") + cpackVendor + "/" + cpackPackageName;
+ std::string("Software\\") + cpackVendor + "\\" + cpackPackageName;
fileDefinitions.BeginElement("RegistryValue");
fileDefinitions.AddAttribute("Root", "HKCU");
@@ -1018,8 +1018,8 @@ std::string cmCPackWIXGenerator::GetRightmostExtension(
std::string cmCPackWIXGenerator::PathToId(const std::string& path)
{
- id_map_t::const_iterator i = pathToIdMap.find(path);
- if(i != pathToIdMap.end()) return i->second;
+ id_map_t::const_iterator i = PathToIdMap.find(path);
+ if(i != PathToIdMap.end()) return i->second;
std::string id = CreateNewIdForPath(path);
return id;
@@ -1056,7 +1056,7 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(const std::string& path)
std::stringstream result;
result << idPrefix << "_" << identifier;
- size_t ambiguityCount = ++idAmbiguityCounter[identifier];
+ size_t ambiguityCount = ++IdAmbiguityCounter[identifier];
if(ambiguityCount > 999)
{
@@ -1073,7 +1073,7 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(const std::string& path)
std::string resultString = result.str();
- pathToIdMap[path] = resultString;
+ PathToIdMap[path] = resultString;
return resultString;
}
@@ -1181,15 +1181,15 @@ void cmCPackWIXGenerator::CreateStartMenuFolder(
void cmCPackWIXGenerator::LoadPatchFragments(const std::string& patchFilePath)
{
- cmWIXPatchParser parser(fragments, Logger);
+ cmWIXPatchParser parser(Fragments, Logger);
parser.ParseFile(patchFilePath.c_str());
}
void cmCPackWIXGenerator::ApplyPatchFragment(
const std::string& id, cmWIXSourceWriter& writer)
{
- cmWIXPatchParser::fragment_map_t::iterator i = fragments.find(id);
- if(i == fragments.end()) return;
+ cmWIXPatchParser::fragment_map_t::iterator i = Fragments.find(id);
+ if(i == Fragments.end()) return;
const cmWIXPatchElement& fragment = i->second;
for(cmWIXPatchElement::child_list_t::const_iterator
@@ -1198,7 +1198,7 @@ void cmCPackWIXGenerator::ApplyPatchFragment(
ApplyPatchElement(**j, writer);
}
- fragments.erase(i);
+ Fragments.erase(i);
}
void cmCPackWIXGenerator::ApplyPatchElement(
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index a0a057c..0a85ae2 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -169,14 +169,14 @@ private:
void ApplyPatchElement(const cmWIXPatchElement& element,
cmWIXSourceWriter& writer);
- std::vector<std::string> wixSources;
- id_map_t pathToIdMap;
- ambiguity_map_t idAmbiguityCounter;
+ std::vector<std::string> WixSources;
+ id_map_t PathToIdMap;
+ ambiguity_map_t IdAmbiguityCounter;
- extension_set_t candleExtensions;
- extension_set_t lightExtensions;
+ extension_set_t CandleExtensions;
+ extension_set_t LightExtensions;
- cmWIXPatchParser::fragment_map_t fragments;
+ cmWIXPatchParser::fragment_map_t Fragments;
};
#endif
diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx
index 0a3b3bc..7ceaf1f 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.cxx
+++ b/Source/CPack/WiX/cmWIXPatchParser.cxx
@@ -27,9 +27,9 @@ cmWIXPatchElement::~cmWIXPatchElement()
cmWIXPatchParser::cmWIXPatchParser(
fragment_map_t& fragments, cmCPackLog* logger):
Logger(logger),
- state(BEGIN_DOCUMENT),
- valid(true),
- fragments(fragments)
+ State(BEGIN_DOCUMENT),
+ Valid(true),
+ Fragments(fragments)
{
}
@@ -37,22 +37,22 @@ cmWIXPatchParser::cmWIXPatchParser(
void cmWIXPatchParser::StartElement(const char *name, const char **atts)
{
std::string name_str = name;
- if(state == BEGIN_DOCUMENT)
+ if(State == BEGIN_DOCUMENT)
{
if(name_str == "CPackWiXPatch")
{
- state = BEGIN_FRAGMENTS;
+ State = BEGIN_FRAGMENTS;
}
else
{
ReportValidationError("Expected root element 'CPackWiXPatch'");
}
}
- else if(state == BEGIN_FRAGMENTS)
+ else if(State == BEGIN_FRAGMENTS)
{
if(name_str == "CPackWiXFragment")
{
- state = INSIDE_FRAGMENT;
+ State = INSIDE_FRAGMENT;
StartFragment(atts);
}
else
@@ -60,9 +60,9 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
ReportValidationError("Expected 'CPackWixFragment' element");
}
}
- else if(state == INSIDE_FRAGMENT)
+ else if(State == INSIDE_FRAGMENT)
{
- cmWIXPatchElement &parent = *elementStack.back();
+ cmWIXPatchElement &parent = *ElementStack.back();
parent.children.resize(parent.children.size() + 1);
cmWIXPatchElement*& currentElement = parent.children.back();
@@ -77,7 +77,7 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
currentElement->attributes[key] = value;
}
- elementStack.push_back(currentElement);
+ ElementStack.push_back(currentElement);
}
}
@@ -90,14 +90,14 @@ void cmWIXPatchParser::StartFragment(const char **attributes)
if(key == "Id")
{
- if(fragments.find(value) != fragments.end())
+ if(Fragments.find(value) != Fragments.end())
{
std::stringstream tmp;
tmp << "Invalid reuse of 'CPackWixFragment' 'Id': " << value;
ReportValidationError(tmp.str());
}
- elementStack.push_back(&fragments[value]);
+ ElementStack.push_back(&Fragments[value]);
}
else
{
@@ -110,16 +110,16 @@ void cmWIXPatchParser::StartFragment(const char **attributes)
void cmWIXPatchParser::EndElement(const char *name)
{
std::string name_str = name;
- if(state == INSIDE_FRAGMENT)
+ if(State == INSIDE_FRAGMENT)
{
if(name_str == "CPackWiXFragment")
{
- state = BEGIN_FRAGMENTS;
- elementStack.clear();
+ State = BEGIN_FRAGMENTS;
+ ElementStack.clear();
}
else
{
- elementStack.pop_back();
+ ElementStack.pop_back();
}
}
}
@@ -129,7 +129,7 @@ void cmWIXPatchParser::ReportError(int line, int column, const char* msg)
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while processing XML patch file at " << line << ":" << column <<
": "<< msg << std::endl);
- valid = false;
+ Valid = false;
}
void cmWIXPatchParser::ReportValidationError(const std::string& message)
@@ -141,5 +141,5 @@ void cmWIXPatchParser::ReportValidationError(const std::string& message)
bool cmWIXPatchParser::IsValid() const
{
- return valid;
+ return Valid;
}
diff --git a/Source/CPack/WiX/cmWIXPatchParser.h b/Source/CPack/WiX/cmWIXPatchParser.h
index 4fa5e6f..91b3b66 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.h
+++ b/Source/CPack/WiX/cmWIXPatchParser.h
@@ -40,7 +40,7 @@ class cmWIXPatchParser : public cmXMLParser
public:
typedef std::map<std::string, cmWIXPatchElement> fragment_map_t;
- cmWIXPatchParser(fragment_map_t& fragments, cmCPackLog* logger);
+ cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
private:
virtual void StartElement(const char *name, const char **atts);
@@ -63,13 +63,13 @@ private:
INSIDE_FRAGMENT
};
- ParserState state;
+ ParserState State;
- bool valid;
+ bool Valid;
- fragment_map_t& fragments;
+ fragment_map_t& Fragments;
- std::list<cmWIXPatchElement*> elementStack;
+ std::list<cmWIXPatchElement*> ElementStack;
};
#endif
diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx
index 774c22c..886b534 100644
--- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx
+++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx
@@ -16,7 +16,7 @@
cmWIXRichTextFormatWriter::cmWIXRichTextFormatWriter(
const std::string& filename):
- file(filename.c_str(), std::ios::binary)
+ File(filename.c_str(), std::ios::binary)
{
StartGroup();
WriteHeader();
@@ -29,8 +29,8 @@ cmWIXRichTextFormatWriter::~cmWIXRichTextFormatWriter()
/* I haven't seen this in the RTF spec but
* wordpad terminates its RTF like this */
- file << "\r\n";
- file.put(0);
+ File << "\r\n";
+ File.put(0);
}
void cmWIXRichTextFormatWriter::AddText(const std::string& text)
@@ -44,16 +44,16 @@ void cmWIXRichTextFormatWriter::AddText(const std::string& text)
switch(c)
{
case '\\':
- file << "\\\\";
+ File << "\\\\";
break;
case '{':
- file << "\\{";
+ File << "\\{";
break;
case '}':
- file << "\\}";
+ File << "\\}";
break;
case '\n':
- file << "\\par\r\n";
+ File << "\\par\r\n";
break;
case '\r':
continue;
@@ -61,11 +61,11 @@ void cmWIXRichTextFormatWriter::AddText(const std::string& text)
{
if(c <= 0x7F)
{
- file << c;
+ File << c;
}
else
{
- file << "[NON-ASCII-" << int(c) << "]";
+ File << "[NON-ASCII-" << int(c) << "]";
}
}
break;
@@ -103,7 +103,7 @@ void cmWIXRichTextFormatWriter::WriteGenerator()
{
StartGroup();
NewControlWord("generator");
- file << " CPack WiX Generator (" << cmVersion::GetCMakeVersion() << ");";
+ File << " CPack WiX Generator (" << cmVersion::GetCMakeVersion() << ");";
EndGroup();
}
@@ -118,20 +118,20 @@ void cmWIXRichTextFormatWriter::WriteDocumentPrefix()
void cmWIXRichTextFormatWriter::ControlWord(const std::string& keyword)
{
- file << "\\" << keyword;
+ File << "\\" << keyword;
}
void cmWIXRichTextFormatWriter::NewControlWord(const std::string& keyword)
{
- file << "\\*\\" << keyword;
+ File << "\\*\\" << keyword;
}
void cmWIXRichTextFormatWriter::StartGroup()
{
- file.put('{');
+ File.put('{');
}
void cmWIXRichTextFormatWriter::EndGroup()
{
- file.put('}');
+ File.put('}');
}
diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
index 10b67c3..bb8580a 100644
--- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
+++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
@@ -40,7 +40,7 @@ private:
void StartGroup();
void EndGroup();
- std::ofstream file;
+ std::ofstream File;
};
#endif
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx
index c8a3922..e83c226 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx
@@ -20,9 +20,9 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
const std::string& filename,
bool isIncludeFile):
Logger(logger),
- file(filename.c_str()),
- state(DEFAULT),
- sourceFilename(filename)
+ File(filename.c_str()),
+ State(DEFAULT),
+ SourceFilename(filename)
{
WriteXMLDeclaration();
@@ -40,79 +40,79 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
cmWIXSourceWriter::~cmWIXSourceWriter()
{
- if(elements.size() > 1)
+ if(Elements.size() > 1)
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- elements.size() - 1 << " WiX elements were still open when closing '" <<
- sourceFilename << "'" << std::endl);
+ Elements.size() - 1 << " WiX elements were still open when closing '" <<
+ SourceFilename << "'" << std::endl);
return;
}
- EndElement(elements.back());
+ EndElement(Elements.back());
}
void cmWIXSourceWriter::BeginElement(const std::string& name)
{
- if(state == BEGIN)
+ if(State == BEGIN)
{
- file << ">";
+ File << ">";
}
- file << "\n";
- Indent(elements.size());
- file << "<" << name;
+ File << "\n";
+ Indent(Elements.size());
+ File << "<" << name;
- elements.push_back(name);
- state = BEGIN;
+ Elements.push_back(name);
+ State = BEGIN;
}
void cmWIXSourceWriter::EndElement(std::string const& name)
{
- if(elements.empty())
+ if(Elements.empty())
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"can not end WiX element with no open elements in '" <<
- sourceFilename << "'" << std::endl);
+ SourceFilename << "'" << std::endl);
return;
}
- if(elements.back() != name)
+ if(Elements.back() != name)
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "WiX element <" << elements.back() <<
+ "WiX element <" << Elements.back() <<
"> can not be closed by </" << name << "> in '" <<
- sourceFilename << "'" << std::endl);
+ SourceFilename << "'" << std::endl);
return;
}
- if(state == DEFAULT)
+ if(State == DEFAULT)
{
- file << "\n";
- Indent(elements.size()-1);
- file << "</" << elements.back() << ">";
+ File << "\n";
+ Indent(Elements.size()-1);
+ File << "</" << Elements.back() << ">";
}
else
{
- file << "/>";
+ File << "/>";
}
- elements.pop_back();
- state = DEFAULT;
+ Elements.pop_back();
+ State = DEFAULT;
}
void cmWIXSourceWriter::AddProcessingInstruction(
const std::string& target, const std::string& content)
{
- if(state == BEGIN)
+ if(State == BEGIN)
{
- file << ">";
+ File << ">";
}
- file << "\n";
- Indent(elements.size());
- file << "<?" << target << " " << content << "?>";
+ File << "\n";
+ Indent(Elements.size());
+ File << "<?" << target << " " << content << "?>";
- state = DEFAULT;
+ State = DEFAULT;
}
void cmWIXSourceWriter::AddAttribute(
@@ -120,7 +120,7 @@ void cmWIXSourceWriter::AddAttribute(
{
std::string utf8 = WindowsCodepageToUtf8(value);
- file << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"';
+ File << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"';
}
void cmWIXSourceWriter::AddAttributeUnlessEmpty(
@@ -172,14 +172,14 @@ std::string cmWIXSourceWriter::WindowsCodepageToUtf8(const std::string& value)
void cmWIXSourceWriter::WriteXMLDeclaration()
{
- file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
+ File << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
}
void cmWIXSourceWriter::Indent(size_t count)
{
for(size_t i = 0; i < count; ++i)
{
- file << " ";
+ File << " ";
}
}
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h
index 670d4c0..f291d25 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXSourceWriter.h
@@ -60,13 +60,13 @@ private:
cmCPackLog* Logger;
- std::ofstream file;
+ std::ofstream File;
- State state;
+ State State;
- std::vector<std::string> elements;
+ std::vector<std::string> Elements;
- std::string sourceFilename;
+ std::string SourceFilename;
};
#endif
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f160d28..227a948 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1278,7 +1278,7 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
cmQtAutoGenerators autogen;
if(autogen.InitializeAutogenTarget(&target))
{
- autogens.push_back(std::make_pair(autogen, &target));
+ autogens.push_back(AutogensType::value_type(autogen, &target));
}
}
}
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 6cfad25..22e4f08 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -240,7 +240,7 @@ void cmGlobalVisualStudio71Generator
const std::set<cmStdString>& depends)
{
fout << "Project(\"{"
- << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
+ << (typeGuid ? typeGuid : this->ExternalProjectType(location))
<< "}\") = \""
<< name << "\", \""
<< this->ConvertToSolutionPath(location) << "\", \"{"
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 1899b40..bb63289 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -146,6 +146,41 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
}
//----------------------------------------------------------------------------
+const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
+ const char* location)
+{
+ std::string extension = cmSystemTools::GetFilenameLastExtension(location);
+ if (extension == ".vbproj")
+ {
+ return "F184B08F-C81C-45F6-A57F-5ABD9991F28F";
+ }
+ else if (extension == ".csproj")
+ {
+ return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC";
+ }
+ else if (extension == ".fsproj")
+ {
+ return "F2A71F9B-5D33-465A-A702-920D77279786";
+ }
+ else if (extension == ".vdproj")
+ {
+ return "54435603-DBB4-11D2-8724-00A0C9A8B90C";
+ }
+ else if (extension == ".dbproj")
+ {
+ return "C8D11400-126E-41CD-887F-60BD40844F9E";
+ }
+ else if (extension == ".wixproj")
+ {
+ return "930C7802-8A8C-48F9-8165-68863BCCD9DD";
+ }
+ else if (extension == ".pyproj")
+ {
+ return "888888A0-9F3D-457C-B088-3A5042F75D52";
+ }
+ return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942";
+}
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
const char* makeProgram,
@@ -730,7 +765,7 @@ void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
std::string d = cmSystemTools::ConvertToOutputPath(location);
fout << "Project("
<< "\"{"
- << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
+ << (typeGuid ? typeGuid : this->ExternalProjectType(location))
<< "}\") = \""
<< name << "\", \""
<< this->ConvertToSolutionPath(location) << "\", \"{"
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 611422a..f69bd84 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -115,6 +115,8 @@ protected:
std::string const& GetDevEnvCommand();
virtual std::string FindDevEnvCommand();
+ static const char* ExternalProjectType(const char* location);
+
static cmIDEFlagTable const* GetExtraFlagTableVS7();
virtual void OutputSLNFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 402855c..455f542 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1477,27 +1477,6 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
includeBinaryDir = true;
}
- // Hack for VTK 4.0 - 4.4 which depend on the old behavior but do
- // not set the backwards compatibility level automatically.
- const char* vtkSourceDir =
- this->Makefile->GetDefinition("VTK_SOURCE_DIR");
- if(vtkSourceDir)
- {
- const char* vtk_major =
- this->Makefile->GetDefinition("VTK_MAJOR_VERSION");
- const char* vtk_minor =
- this->Makefile->GetDefinition("VTK_MINOR_VERSION");
- vtk_major = vtk_major? vtk_major : "4";
- vtk_minor = vtk_minor? vtk_minor : "4";
- int vmajor = 0;
- int vminor = 0;
- if(sscanf(vtk_major, "%d", &vmajor) &&
- sscanf(vtk_minor, "%d", &vminor) && vmajor == 4 && vminor <= 4)
- {
- includeSourceDir = true;
- }
- }
-
// Do not repeat an include path.
std::set<cmStdString> emitted;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a561aab..abf20cb 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -810,6 +810,8 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> newFiles;
+
for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end();
++fileIt)
@@ -833,10 +835,17 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
rcc_output_file.c_str(), false);
cmSourceFile* rccCppSource
= makefile->GetOrCreateSource(rcc_output_file.c_str(), true);
- target->AddSourceFile(rccCppSource);
+ newFiles.push_back(rccCppSource);
}
}
}
+
+ for(std::vector<cmSourceFile*>::const_iterator fileIt = newFiles.begin();
+ fileIt != newFiles.end();
+ ++fileIt)
+ {
+ target->AddSourceFile(*fileIt);
+ }
}
void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
diff --git a/Source/kwsys/Encoding.hxx.in b/Source/kwsys/Encoding.hxx.in
index 60a4a8e..aba4175 100644
--- a/Source/kwsys/Encoding.hxx.in
+++ b/Source/kwsys/Encoding.hxx.in
@@ -14,6 +14,7 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/stl/string>
+#include <@KWSYS_NAMESPACE@/stl/vector>
/* Define these macros temporarily to keep the code readable. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
@@ -25,6 +26,36 @@ namespace @KWSYS_NAMESPACE@
class @KWSYS_NAMESPACE@_EXPORT Encoding
{
public:
+
+ // Container class for argc/argv.
+ class CommandLineArguments
+ {
+ public:
+ // On Windows, get the program command line arguments
+ // in this Encoding module's 8 bit encoding.
+ // On other platforms the given argc/argv is used, and
+ // to be consistent, should be the argc/argv from main().
+ static CommandLineArguments Main(int argc, char const* const* argv);
+
+ // Construct CommandLineArguments with the given
+ // argc/argv. It is assumed that the string is already
+ // in the encoding used by this module.
+ CommandLineArguments(int argc, char const* const* argv);
+
+ // Construct CommandLineArguments with the given
+ // argc and wide argv. This is useful if wmain() is used.
+ CommandLineArguments(int argc, wchar_t const* const* argv);
+ ~CommandLineArguments();
+ CommandLineArguments(const CommandLineArguments&);
+ CommandLineArguments& operator=(const CommandLineArguments&);
+
+ int argc() const;
+ char const* const* argv() const;
+
+ protected:
+ std::vector<char*> argv_;
+ };
+
/**
* Convert between char and wchar_t
*/
diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx
index aebc148..f76deb5 100644
--- a/Source/kwsys/EncodingCXX.cxx
+++ b/Source/kwsys/EncodingCXX.cxx
@@ -29,6 +29,7 @@
#endif
#include <stdlib.h>
+#include <string.h>
#ifdef _MSC_VER
# pragma warning (disable: 4786)
@@ -42,6 +43,98 @@
namespace KWSYS_NAMESPACE
{
+Encoding::CommandLineArguments
+Encoding::CommandLineArguments::Main(int argc, char const* const* argv)
+{
+#ifdef _WIN32
+ (void) argc;
+ (void) argv;
+
+ int ac;
+ LPWSTR* w_av = CommandLineToArgvW(GetCommandLineW(), &ac);
+
+ std::vector<std::string> av1(ac);
+ std::vector<char const*> av2(ac);
+ for(int i=0; i<ac; i++)
+ {
+ av1[i] = ToNarrow(w_av[i]);
+ av2[i] = av1[i].c_str();
+ }
+ LocalFree(w_av);
+ return CommandLineArguments(ac, &av2[0]);
+#else
+ return CommandLineArguments(argc, argv);
+#endif
+}
+
+Encoding::CommandLineArguments::CommandLineArguments(int ac,
+ char const* const* av)
+{
+ this->argv_.resize(ac+1);
+ for(int i=0; i<ac; i++)
+ {
+ this->argv_[i] = strdup(av[i]);
+ }
+ this->argv_[ac] = 0;
+}
+
+Encoding::CommandLineArguments::CommandLineArguments(int ac,
+ wchar_t const* const* av)
+{
+ this->argv_.resize(ac+1);
+ for(int i=0; i<ac; i++)
+ {
+ this->argv_[i] = kwsysEncoding_DupToNarrow(av[i]);
+ }
+ this->argv_[ac] = 0;
+}
+
+Encoding::CommandLineArguments::~CommandLineArguments()
+{
+ for(size_t i=0; i<this->argv_.size(); i++)
+ {
+ free(argv_[i]);
+ }
+}
+
+Encoding::CommandLineArguments::
+ CommandLineArguments(const CommandLineArguments& other)
+{
+ this->argv_.resize(other.argv_.size());
+ for(size_t i=0; i<this->argv_.size(); i++)
+ {
+ this->argv_[i] = other.argv_[i] ? strdup(other.argv_[i]) : 0;
+ }
+}
+
+Encoding::CommandLineArguments&
+Encoding::CommandLineArguments::operator=(const CommandLineArguments& other)
+{
+ size_t i;
+ for(i=0; i<this->argv_.size(); i++)
+ {
+ free(this->argv_[i]);
+ }
+
+ this->argv_.resize(other.argv_.size());
+ for(i=0; i<this->argv_.size(); i++)
+ {
+ this->argv_[i] = other.argv_[i] ? strdup(other.argv_[i]) : 0;
+ }
+
+ return *this;
+}
+
+int Encoding::CommandLineArguments::argc() const
+{
+ return static_cast<int>(this->argv_.size() - 1);
+}
+
+char const* const* Encoding::CommandLineArguments::argv() const
+{
+ return &this->argv_[0];
+}
+
#if KWSYS_STL_HAS_WSTRING
kwsys_stl::wstring Encoding::ToWide(const kwsys_stl::string& str)
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx
index a65c430..094588c 100644
--- a/Source/kwsys/testEncoding.cxx
+++ b/Source/kwsys/testEncoding.cxx
@@ -145,6 +145,36 @@ static int testRobustEncoding()
return ret;
}
+static int testCommandLineArguments()
+{
+ int status = 0;
+
+ char const* argv[2] = {
+ "./app.exe",
+ (char const*)helloWorldStrings[1]
+ };
+
+ kwsys::Encoding::CommandLineArguments args(2, argv);
+ kwsys::Encoding::CommandLineArguments arg2 =
+ kwsys::Encoding::CommandLineArguments(args);
+
+ char const* const* u8_argv = args.argv();
+ for(int i=0; i<args.argc(); i++)
+ {
+ char const* u8_arg = u8_argv[i];
+ if(strcmp(argv[i], u8_arg) != 0)
+ {
+ std::cout << "argv[" << i << "] " << argv[i] << " != "
+ << u8_arg << std::endl;
+ status++;
+ }
+ }
+
+ kwsys::Encoding::CommandLineArguments args3 =
+ kwsys::Encoding::CommandLineArguments::Main(2, argv);
+
+ return status;
+}
//----------------------------------------------------------------------------
int testEncoding(int, char*[])
@@ -163,6 +193,7 @@ int testEncoding(int, char*[])
ret |= testHelloWorldEncoding();
ret |= testRobustEncoding();
+ ret |= testCommandLineArguments();
return ret;
}