summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudioWCEPlatformParser.cxx
diff options
context:
space:
mode:
authorPatrick Gansterer <paroga@paroga.com>2012-11-29 15:36:20 (GMT)
committerBrad King <brad.king@kitware.com>2012-11-30 12:59:25 (GMT)
commitdce54b103af0ee1627de9e0cf04a5e390442a929 (patch)
treef56bd77d241bdb0a2641297b5340fdbdd9335143 /Source/cmVisualStudioWCEPlatformParser.cxx
parentd5ac791366595be307896e9894c66815c1e1eb2f (diff)
downloadCMake-dce54b103af0ee1627de9e0cf04a5e390442a929.zip
CMake-dce54b103af0ee1627de9e0cf04a5e390442a929.tar.gz
CMake-dce54b103af0ee1627de9e0cf04a5e390442a929.tar.bz2
Add command to generate environment for a Windows CE SDK
Diffstat (limited to 'Source/cmVisualStudioWCEPlatformParser.cxx')
-rw-r--r--Source/cmVisualStudioWCEPlatformParser.cxx48
1 files changed, 42 insertions, 6 deletions
diff --git a/Source/cmVisualStudioWCEPlatformParser.cxx b/Source/cmVisualStudioWCEPlatformParser.cxx
index 0afcf67..b302246 100644
--- a/Source/cmVisualStudioWCEPlatformParser.cxx
+++ b/Source/cmVisualStudioWCEPlatformParser.cxx
@@ -15,18 +15,23 @@
int cmVisualStudioWCEPlatformParser::ParseVersion(const char* version)
{
- std::string vskey = cmGlobalVisualStudioGenerator::GetRegistryBase(version);
- vskey += "\\Setup\\VS;ProductDir";
+ const std::string registryBase =
+ cmGlobalVisualStudioGenerator::GetRegistryBase(version);
+ const std::string vckey = registryBase + "\\Setup\\VC;ProductDir";
+ const std::string vskey = registryBase + "\\Setup\\VS;ProductDir";
- std::string vsInstallPath;
- if(!cmSystemTools::ReadRegistryValue(vskey.c_str(), vsInstallPath))
+ if(!cmSystemTools::ReadRegistryValue(vckey.c_str(), this->VcInstallDir) ||
+ !cmSystemTools::ReadRegistryValue(vskey.c_str(), this->VsInstallDir))
{
return 0;
}
- cmSystemTools::ConvertToUnixSlashes(vsInstallPath);
+ cmSystemTools::ConvertToUnixSlashes(this->VcInstallDir);
+ cmSystemTools::ConvertToUnixSlashes(this->VsInstallDir);
+ this->VcInstallDir.append("/");
+ this->VsInstallDir.append("/");
const std::string configFilename =
- vsInstallPath + "/VC/vcpackages/WCE.VCPlatform.config";
+ this->VcInstallDir + "vcpackages/WCE.VCPlatform.config";
return this->ParseFile(configFilename.c_str());
}
@@ -93,6 +98,24 @@ void cmVisualStudioWCEPlatformParser::StartElement(const char* name,
this->Macros[macroName] = macroValue;
}
}
+ else if(strcmp(name, "Directories") == 0)
+ {
+ for(const char** attr = attributes; *attr; attr += 2)
+ {
+ if(strcmp(attr[0], "Include") == 0)
+ {
+ this->Include = attr[1];
+ }
+ else if(strcmp(attr[0], "Library") == 0)
+ {
+ this->Library = attr[1];
+ }
+ else if(strcmp(attr[0], "Path") == 0)
+ {
+ this->Path = attr[1];
+ }
+ }
+ }
}
void cmVisualStudioWCEPlatformParser::EndElement(const char* name)
@@ -137,3 +160,16 @@ void cmVisualStudioWCEPlatformParser::CharacterDataHandler(const char* data,
{
this->CharacterData.append(data, length);
}
+
+std::string cmVisualStudioWCEPlatformParser::FixPaths(
+ const std::string& paths) const
+{
+ std::string ret = paths;
+ cmSystemTools::ReplaceString(ret, "$(PATH)", "%PATH%");
+ cmSystemTools::ReplaceString(ret, "$(VCInstallDir)", VcInstallDir.c_str());
+ cmSystemTools::ReplaceString(ret, "$(VSInstallDir)", VsInstallDir.c_str());
+ cmSystemTools::ReplaceString(ret, "\\", "/");
+ cmSystemTools::ReplaceString(ret, "//", "/");
+ cmSystemTools::ReplaceString(ret, "/", "\\");
+ return ret;
+}