This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  82dfb1b65285e19e01e05ced44c307d26548e5ce (commit)
       via  89bcd1a093d9d3a976f5a26e0231d0c361647fcf (commit)
      from  631b189e9f5b905b72c5605ae8cb5db8658a196e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82dfb1b65285e19e01e05ced44c307d26548e5ce
commit 82dfb1b65285e19e01e05ced44c307d26548e5ce
Merge: 631b189 89bcd1a
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Mar 25 10:43:59 2015 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed Mar 25 10:43:59 2015 -0400

    Merge topic 'add-GreenHills-MULTI-generator' into next
    
    89bcd1a0 GHS: Further revisions


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89bcd1a093d9d3a976f5a26e0231d0c361647fcf
commit 89bcd1a093d9d3a976f5a26e0231d0c361647fcf
Author:     Geoff Viola <geoffrey.vi...@asirobots.com>
AuthorDate: Tue Mar 24 21:50:50 2015 -0600
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Mar 25 10:43:07 2015 -0400

    GHS: Further revisions
    
    * broke lines after curly brace in GHS CPP files
    * added this to member accesses in GHS CPP files
    * cleaned up trailing slash logic

diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx
index d630faa..e47d583 100644
--- a/Source/cmGhsMultiGpj.cxx
+++ b/Source/cmGhsMultiGpj.cxx
@@ -14,26 +14,28 @@
 #include "cmGeneratedFileStream.h"
 
 void GhsMultiGpj::WriteGpjTag(Types const gpjType,
-                              cmGeneratedFileStream *const filestream) {
+                              cmGeneratedFileStream *const filestream)
+{
   char const *tag;
-  switch (gpjType) {
-  case INTERGRITY_APPLICATION:
-    tag = "INTEGRITY Application";
-    break;
-  case PROJECT:
-    tag = "Project";
-    break;
-  case PROGRAM:
-    tag = "Program";
-    break;
-  case REFERENCE:
-    tag = "Reference";
-    break;
-  case SUBPROJECT:
-    tag = "Subproject";
-    break;
-  default:
-    tag = "";
-  }
+  switch (gpjType)
+    {
+    case INTERGRITY_APPLICATION:
+      tag = "INTEGRITY Application";
+      break;
+    case PROJECT:
+      tag = "Project";
+      break;
+    case PROGRAM:
+      tag = "Program";
+      break;
+    case REFERENCE:
+      tag = "Reference";
+      break;
+    case SUBPROJECT:
+      tag = "Subproject";
+      break;
+    default:
+      tag = "";
+    }
   *filestream << "[" << tag << "]" << std::endl;
 }
diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h
index 225ec47..7e5b942 100644
--- a/Source/cmGhsMultiGpj.h
+++ b/Source/cmGhsMultiGpj.h
@@ -14,9 +14,11 @@
 
 class cmGeneratedFileStream;
 
-class GhsMultiGpj {
+class GhsMultiGpj
+{
 public:
-  enum Types {
+  enum Types
+  {
     INTERGRITY_APPLICATION,
     PROJECT,
     PROGRAM,
diff --git a/Source/cmGhsMultiTargetGenerator.cxx 
b/Source/cmGhsMultiTargetGenerator.cxx
index 282eb53..0c3595b 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -22,242 +22,292 @@
 std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
 
 cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget const *target)
-    : Target(target), LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
-                          target->GetMakefile()->GetLocalGenerator())),
-      Makefile(target->GetMakefile()), TargetGroup(DetermineIfTargetGroup()),
-      DynamicDownload(false) {
-  std::string BuildFileName;
-  BuildFileName = this->Target->GetName();
-  BuildFileName += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
-
+  : Target(target)
+  , LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
+                     target->GetMakefile()->GetLocalGenerator()))
+  , Makefile(target->GetMakefile())
+  , TargetGroup(DetermineIfTargetGroup())
+  , DynamicDownload(false)
+{
   char const *folderProp = this->Target->GetProperty("FOLDER");
-  RelBuildFilePath = NULL == folderProp ? "" : folderProp;
-  if (!cmHasLiteralSuffix(RelBuildFilePath, "/")) {
-    RelBuildFilePath += "/";
-  }
-  RelBuildFilePath += Target->GetName() + "/";
+  this->RelBuildFilePath = NULL == folderProp ? "" : folderProp;
+  cmSystemTools::ConvertToUnixSlashes(this->RelBuildFilePath);
+  if (!this->RelBuildFilePath.empty())
+    {
+    this->RelBuildFilePath += "/";
+    }
+  this->RelBuildFilePath += this->Target->GetName() + "/";
 
-  RelOutputFileName = RelBuildFilePath + Target->GetName() + ".a";
+  this->RelOutputFileName =
+    this->RelBuildFilePath + this->Target->GetName() + ".a";
 
-  RelBuildFileName = RelBuildFilePath;
-  if (!cmHasLiteralSuffix(RelBuildFileName, "/")) {
-    RelBuildFileName += "/";
-  }
-  RelBuildFileName += BuildFileName;
+  this->RelBuildFileName = this->RelBuildFilePath;
+  std::string BuildFileName;
+  BuildFileName = this->Target->GetName();
+  BuildFileName += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+  this->RelBuildFileName += BuildFileName;
 
   std::string absPathToRoot(this->Makefile->GetHomeOutputDirectory());
-  if (!cmHasLiteralSuffix(absPathToRoot, "/")) {
+  if (!cmHasLiteralSuffix(absPathToRoot, "/"))
+    {
     absPathToRoot += "/";
-  }
-  AbsBuildFilePath = absPathToRoot + RelBuildFilePath;
-  AbsBuildFileName = absPathToRoot + RelBuildFileName;
-  AbsOutputFileName = absPathToRoot + RelOutputFileName;
+    }
+  this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
+  this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
+  this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName;
 }
 
 cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
 {
-  cmDeleteAll(FolderBuildStreams);
+  cmDeleteAll(this->FolderBuildStreams);
 }
 
-void cmGhsMultiTargetGenerator::Generate() {
-  std::vector<cmSourceFile *> objectSources = GetSources();
-  if (!objectSources.empty() && IncludeThisTarget()) {
-    if (!cmSystemTools::FileExists(AbsBuildFilePath.c_str())) {
-      cmSystemTools::MakeDirectory(AbsBuildFilePath.c_str());
-    }
+void cmGhsMultiTargetGenerator::Generate()
+{
+  const std::vector<cmSourceFile *> objectSources = this->GetSources();
+  if (!objectSources.empty() && this->IncludeThisTarget())
+    {
+    if (!cmSystemTools::FileExists(this->AbsBuildFilePath.c_str()))
+      {
+      cmSystemTools::MakeDirectory(this->AbsBuildFilePath.c_str());
+      }
     cmGlobalGhsMultiGenerator::Open(std::string(""), this->AbsBuildFileName,
-                                    &FolderBuildStreams);
-    cmGlobalGhsMultiGenerator::OpenBuildFileStream(GetFolderBuildStreams());
+                                    &this->FolderBuildStreams);
+    cmGlobalGhsMultiGenerator::OpenBuildFileStream(
+      this->GetFolderBuildStreams());
     std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-    if (0 == config.length()) {
+    if (0 == config.length())
+      {
       config = "RELEASE";
-    }
+      }
     const std::string language(this->Target->GetLinkerLanguage(config));
     config = cmSystemTools::UpperCase(config);
-    DynamicDownload = DetermineIfDynamicDownload(config, language);
-    if (DynamicDownload) {
+    this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
+    if (this->DynamicDownload)
+      {
       *this->GetFolderBuildStreams() << "#component integrity_dynamic_download"
                                      << std::endl;
-    }
-    GhsMultiGpj::WriteGpjTag(GetGpjTag(), this->GetFolderBuildStreams());
-    cmGlobalGhsMultiGenerator::WriteDisclaimer(GetFolderBuildStreams());
-
-    bool const notKernel = IsNotKernel(config, language);
-    WriteTypeSpecifics(config, notKernel);
-    WriteDebugOptions(config, notKernel);
-    WriteCompilerOptions(config, language);
-    WriteCompilerFlags();
-    WriteCompilerDefinitions(config, language);
-    WriteIncludes(config, language);
-    WriteTargetLinkLibraries();
-    WriteCustomCommands();
-    if (DynamicDownload) {
-      *this->GetFolderBuildStreams() << "    " << DDOption << std::endl;
-    }
+      }
+    GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams());
+    cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams());
+
+    bool const notKernel = this->IsNotKernel(config, language);
+    this->WriteTypeSpecifics(config, notKernel);
+    this->WriteDebugOptions(config, notKernel);
+    this->WriteCompilerOptions(config, language);
+    this->WriteCompilerFlags();
+    this->WriteCompilerDefinitions(config, language);
+    this->WriteIncludes(config, language);
+    this->WriteTargetLinkLibraries();
+    this->WriteCustomCommands();
+    if (this->DynamicDownload)
+      {
+      *this->GetFolderBuildStreams() << "    " << this->DDOption << std::endl;
+      }
 
-    WriteSources(objectSources);
-  }
+    this->WriteSources(objectSources);
+    }
 }
 
-bool cmGhsMultiTargetGenerator::IncludeThisTarget() {
+bool cmGhsMultiTargetGenerator::IncludeThisTarget()
+{
   bool output = true;
   char const *excludeFromAll = this->Target->GetProperty("EXCLUDE_FROM_ALL");
   if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
-      '\0' == excludeFromAll[1]) {
+      '\0' == excludeFromAll[1])
+    {
     output = false;
-  }
+    }
   return output;
 }
 
-std::vector<cmSourceFile *> cmGhsMultiTargetGenerator::GetSources() const {
+std::vector<cmSourceFile *> cmGhsMultiTargetGenerator::GetSources() const
+{
   std::vector<cmSourceFile *> output;
   std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
   this->Target->GetSourceFiles(output, config);
   return output;
 }
 
-GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const {
+GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const
+{
   GhsMultiGpj::Types output;
-  if (IsTargetGroup()) {
+  if (this->IsTargetGroup())
+    {
     output = GhsMultiGpj::INTERGRITY_APPLICATION;
-  } else {
+    }
+  else
+    {
     output = GhsMultiGpj::PROGRAM;
-  }
+    }
   return output;
 }
 
-cmGlobalGhsMultiGenerator *
-cmGhsMultiTargetGenerator::GetGlobalGenerator() const {
+cmGlobalGhsMultiGenerator*
+cmGhsMultiTargetGenerator::GetGlobalGenerator() const
+{
   return static_cast<cmGlobalGhsMultiGenerator *>(
-      LocalGenerator->GetGlobalGenerator());
+    this->LocalGenerator->GetGlobalGenerator());
 }
 
 void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
-                                                   bool const notKernel) {
-  std::string outputDir(GetOutputDirectory(config));
-  std::string outputFilename(GetOutputFilename(config));
-
-  if (Target->GetType() == cmTarget::STATIC_LIBRARY) {
-    *GetFolderBuildStreams() << "    -relobj" << std::endl;
-    *GetFolderBuildStreams() << "    {optgroup=GhsCommonOptions} -o \""
-                             << outputDir << outputFilename << ".a\""
-                             << std::endl;
-  } else if (Target->GetType() == cmTarget::EXECUTABLE) {
-    if (notKernel && !IsTargetGroup()) {
-      *GetFolderBuildStreams() << "    -relprog" << std::endl;
+                                                   bool const notKernel)
+{
+  std::string outputDir(this->GetOutputDirectory(config));
+  std::string outputFilename(this->GetOutputFilename(config));
+
+  if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+    {
+    *this->GetFolderBuildStreams() << "    -relobj" << std::endl;
+    *this->GetFolderBuildStreams() << "    {optgroup=GhsCommonOptions} -o \""
+                                   << outputDir << outputFilename << ".a\""
+                                   << std::endl;
     }
-    if (IsTargetGroup()) {
-      *GetFolderBuildStreams() << "    -non_shared" << std::endl;
-      *GetFolderBuildStreams() << "    -o \"" << outputDir << outputFilename
-                               << ".elf\"" << std::endl;
-    } else {
-      *GetFolderBuildStreams() << "    {optgroup=GhsCommonOptions} -o \""
-                               << outputDir << outputFilename << ".as\""
-                               << std::endl;
+  else if (this->Target->GetType() == cmTarget::EXECUTABLE)
+    {
+    if (notKernel && !this->IsTargetGroup())
+      {
+      *this->GetFolderBuildStreams() << "    -relprog" << std::endl;
+      }
+    if (this->IsTargetGroup())
+      {
+      *this->GetFolderBuildStreams() << "    -non_shared" << std::endl;
+      *this->GetFolderBuildStreams() << "    -o \"" << outputDir
+                                     << outputFilename << ".elf\""
+                                     << std::endl;
+      }
+    else
+      {
+      *this->GetFolderBuildStreams() << "    {optgroup=GhsCommonOptions} -o \""
+                                     << outputDir << outputFilename << ".as\""
+                                     << std::endl;
+      }
     }
-  }
 }
 
 void cmGhsMultiTargetGenerator::WriteDebugOptions(std::string const &config,
-                                                  bool const notKernel) {
-  if ("DEBUG" == config) {
-    if (notKernel) {
-      *GetFolderBuildStreams() << "    -G" << std::endl;
-      *GetFolderBuildStreams() << "    -Onone" << std::endl;
-    } else {
-      *GetFolderBuildStreams() << "    -ldebug" << std::endl;
+                                                  bool const notKernel)
+{
+  if ("DEBUG" == config)
+    {
+    if (notKernel)
+      {
+      *this->GetFolderBuildStreams() << "    -G" << std::endl;
+      *this->GetFolderBuildStreams() << "    -Onone" << std::endl;
+      }
+    else
+      {
+      *this->GetFolderBuildStreams() << "    -ldebug" << std::endl;
+      }
+    }
+  else if (notKernel)
+    {
+    *this->GetFolderBuildStreams() << "    -O" << std::endl;
     }
-  } else if (notKernel) {
-    *GetFolderBuildStreams() << "    -O" << std::endl;
-  }
 }
 
 void cmGhsMultiTargetGenerator::WriteCompilerOptions(
-    std::string const &config, const std::string &language) {
+  std::string const &config, const std::string &language)
+{
   std::vector<std::string> options;
-  Target->GetCompileOptions(options, config, language);
+  this->Target->GetCompileOptions(options, config, language);
   bool hasStartfileDirProp = false;
   std::string const startFilePropName("-startfile_dir=");
   for (std::vector<std::string>::const_iterator options_i = options.begin();
-       options_i != options.end(); ++options_i) {
+       options_i != options.end(); ++options_i)
+    {
     std::string option = *options_i;
-    if (DDOption != option) {
+    if (this->DDOption != option)
+      {
       if (option.length() >= startFilePropName.length() &&
-          startFilePropName == option.substr(0, startFilePropName.length())) {
+          startFilePropName == option.substr(0, startFilePropName.length()))
+        {
         hasStartfileDirProp = true;
-      }
+        }
       cmSystemTools::ConvertToUnixSlashes(option);
       *this->GetFolderBuildStreams() << "    " << option << std::endl;
+      }
     }
-  }
 
   // If this property is relative, make it relative to the root lists file
-  if (!hasStartfileDirProp && GetGlobalGenerator()->IsOSDirRelative()) {
+  if (!hasStartfileDirProp && this->GetGlobalGenerator()->IsOSDirRelative())
+    {
     *this->GetFolderBuildStreams() << "    " << startFilePropName << "\""
                                    << this->Makefile->GetHomeOutputDirectory()
                                    << "/$(__LIBS_DIR_BASE)/$(__BSP_NAME)\""
                                    << std::endl;
-  }
+    }
 }
 
-void cmGhsMultiTargetGenerator::WriteCompilerFlags() {
-  char const *const compileFlags = Target->GetProperty("COMPILE_FLAGS");
-  if (NULL != compileFlags) {
+void cmGhsMultiTargetGenerator::WriteCompilerFlags()
+{
+  char const *const compileFlags = this->Target->GetProperty("COMPILE_FLAGS");
+  if (NULL != compileFlags)
+    {
     *this->GetFolderBuildStreams() << "    " << compileFlags << std::endl;
-  }
+    }
 }
 
 void cmGhsMultiTargetGenerator::WriteCompilerDefinitions(
-    const std::string &config, const std::string &language) {
+  const std::string &config, const std::string &language)
+{
   std::vector<std::string> compileDefinitions;
   this->Target->GetCompileDefinitions(compileDefinitions, config, language);
   for (std::vector<std::string>::const_iterator cdI =
-           compileDefinitions.begin();
-       cdI != compileDefinitions.end(); ++cdI) {
+         compileDefinitions.begin();
+       cdI != compileDefinitions.end(); ++cdI)
+    {
     *this->GetFolderBuildStreams() << "    -D" << (*cdI) << std::endl;
-  }
+    }
 }
 
 void cmGhsMultiTargetGenerator::WriteIncludes(const std::string &config,
-                                              const std::string &language) {
+                                              const std::string &language)
+{
   std::vector<std::string> includes =
-      Target->GetIncludeDirectories(config, language);
+    this->Target->GetIncludeDirectories(config, language);
   for (std::vector<std::string>::const_iterator includes_i = includes.begin();
-       includes_i != includes.end(); ++includes_i) {
+       includes_i != includes.end(); ++includes_i)
+    {
     *this->GetFolderBuildStreams() << "    -I\"" << *includes_i << "\""
                                    << std::endl;
-  }
+    }
 }
 
-void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries() {
+void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
+{
   // library directories
   cmTargetDependSet tds =
-      GetGlobalGenerator()->GetTargetDirectDepends(*this->Target);
+    this->GetGlobalGenerator()->GetTargetDirectDepends(*this->Target);
   for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
-       ++tdsI) {
+       ++tdsI)
+    {
     cmTarget const *tg(*tdsI);
     cmGhsMultiTargetGenerator gmtg(tg);
     *this->GetFolderBuildStreams() << "    -L\"" << gmtg.GetAbsBuildFilePath()
                                    << "\"" << std::endl;
-  }
+    }
   // library targets
   cmTarget::LinkLibraryVectorType llv =
-      this->Target->GetOriginalLinkLibraries();
+    this->Target->GetOriginalLinkLibraries();
   for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin();
-       llvI != llv.end(); ++llvI) {
+       llvI != llv.end(); ++llvI)
+    {
     std::string libName = llvI->first;
     // if it is a user defined target get the full path to the lib
     cmTarget *tg(GetGlobalGenerator()->FindTarget(libName));
-    if (NULL != tg) {
+    if (NULL != tg)
+      {
       cmGhsMultiTargetGenerator gmtg(tg);
       libName = tg->GetName() + ".a";
-    }
+      }
     *this->GetFolderBuildStreams() << "    -l\"" << libName << "\""
                                    << std::endl;
-  }
+    }
 }
 
-void cmGhsMultiTargetGenerator::WriteCustomCommands() {
+void cmGhsMultiTargetGenerator::WriteCustomCommands()
+{
   WriteCustomCommandsHelper(this->Target->GetPreBuildCommands(),
                             cmTarget::PRE_BUILD);
   WriteCustomCommandsHelper(this->Target->GetPostBuildCommands(),
@@ -265,172 +315,204 @@ void cmGhsMultiTargetGenerator::WriteCustomCommands() {
 }
 
 void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
-    std::vector<cmCustomCommand> const &commandsSet,
-    cmTarget::CustomCommandType const commandType) {
+  std::vector<cmCustomCommand> const &commandsSet,
+  cmTarget::CustomCommandType const commandType)
+{
   for (std::vector<cmCustomCommand>::const_iterator commandsSetI =
-           commandsSet.begin();
-       commandsSetI != commandsSet.end(); ++commandsSetI) {
+         commandsSet.begin();
+       commandsSetI != commandsSet.end(); ++commandsSetI)
+    {
     cmCustomCommandLines const &commands = commandsSetI->GetCommandLines();
     for (cmCustomCommandLines::const_iterator commandI = commands.begin();
-         commandI != commands.end(); ++commandI) {
-      switch (commandType) {
-      case cmTarget::PRE_BUILD:
-        *GetFolderBuildStreams() << "    :preexecShellSafe=";
-        break;
-      case cmTarget::POST_BUILD:
-        *GetFolderBuildStreams() << "    :postexecShellSafe=";
-        break;
-      default:
-        assert("Only pre and post are supported");
-      }
+         commandI != commands.end(); ++commandI)
+      {
+      switch (commandType)
+        {
+        case cmTarget::PRE_BUILD:
+          *this->GetFolderBuildStreams() << "    :preexecShellSafe=";
+          break;
+        case cmTarget::POST_BUILD:
+          *this->GetFolderBuildStreams() << "    :postexecShellSafe=";
+          break;
+        default:
+          assert("Only pre and post are supported");
+        }
       cmCustomCommandLine const &command = *commandI;
       for (cmCustomCommandLine::const_iterator commandLineI = command.begin();
-           commandLineI != command.end(); ++commandLineI) {
-        if (!command.empty()) {
-          *GetFolderBuildStreams()
-              << (command.begin() == commandLineI ? "'" : " ");
+           commandLineI != command.end(); ++commandLineI)
+        {
+        if (!command.empty())
+          {
+          *this->GetFolderBuildStreams()
+            << (command.begin() == commandLineI ? "'" : " ");
+          }
+        *this->GetFolderBuildStreams() << *commandLineI;
+        }
+      if (!command.empty())
+        {
+        *this->GetFolderBuildStreams() << "'" << std::endl;
         }
-        *GetFolderBuildStreams() << *commandLineI;
-      }
-      if (!command.empty()) {
-        *GetFolderBuildStreams() << "'" << std::endl;
       }
     }
-  }
 }
 
 void cmGhsMultiTargetGenerator::WriteSources(
-    std::vector<cmSourceFile *> const &objectSources) {
+  std::vector<cmSourceFile *> const &objectSources)
+{
   for (std::vector<cmSourceFile *>::const_iterator si = objectSources.begin();
-       si != objectSources.end(); ++si) {
+       si != objectSources.end(); ++si)
+    {
     std::vector<cmSourceGroup> sourceGroups(this->Makefile->GetSourceGroups());
     char const *sourceFullPath = (*si)->GetFullPath().c_str();
     cmSourceGroup *sourceGroup =
-        this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups);
+      this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups);
     std::string sgPath(sourceGroup->GetFullName());
     cmSystemTools::ConvertToUnixSlashes(sgPath);
     cmGlobalGhsMultiGenerator::AddFilesUpToPath(
-        GetFolderBuildStreams(), &FolderBuildStreams,
-        this->Makefile->GetHomeOutputDirectory(), sgPath,
-        GhsMultiGpj::SUBPROJECT, RelBuildFilePath);
+      this->GetFolderBuildStreams(), &this->FolderBuildStreams,
+      this->Makefile->GetHomeOutputDirectory(), sgPath,
+      GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
 
-    if ((*si)->GetExtension() == ".int") {
+    if ((*si)->GetExtension() == ".int")
+      {
       *this->FolderBuildStreams[sgPath] << "\"" << (*si)->GetFullPath() << "\""
                                         << std::endl;
-    } else {
+      }
+    else
+      {
       *this->FolderBuildStreams[sgPath] << (*si)->GetFullPath() << std::endl;
-    }
+      }
 
     if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() &&
-        "bsp" != (*si)->GetExtension()) {
-      WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si));
+        "bsp" != (*si)->GetExtension())
+      {
+      this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si));
 
-      WriteObjectDir(this->FolderBuildStreams[sgPath],
-                     AbsBuildFilePath + sgPath);
+      this->WriteObjectDir(this->FolderBuildStreams[sgPath],
+                           this->AbsBuildFilePath + sgPath);
+      }
     }
-  }
 }
 
 void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
-    cmGeneratedFileStream *fileStream, cmSourceFile *sourceFile) {
+  cmGeneratedFileStream *fileStream, cmSourceFile *sourceFile)
+{
   const char *rawLangProp = sourceFile->GetProperty("LANGUAGE");
-  if (NULL != rawLangProp) {
+  if (NULL != rawLangProp)
+    {
     std::string sourceLangProp(rawLangProp);
     std::string extension(sourceFile->GetExtension());
-    if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) {
+    if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension))
+      {
       *fileStream << "    -dotciscxx" << std::endl;
+      }
     }
-  }
 }
 
 void cmGhsMultiTargetGenerator::WriteObjectDir(
-    cmGeneratedFileStream *fileStream, std::string const &dir) {
+  cmGeneratedFileStream *fileStream, std::string const &dir)
+{
   std::string workingDir(dir);
-  if (!cmHasLiteralSuffix(workingDir, "/")) {
+  cmSystemTools::ConvertToUnixSlashes(workingDir);
+  if (!workingDir.empty())
+    {
     workingDir += "/";
-  }
+    }
   workingDir += "Objs";
   *fileStream << "    -object_dir=\"" << workingDir << "\"" << std::endl;
 }
 
 std::string
-cmGhsMultiTargetGenerator
-::GetOutputDirectory(const std::string &config) const {
+cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const
+{
   std::string outputDir(AbsBuildFilePath);
 
   const char *runtimeOutputProp =
-      Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
-  if (NULL != runtimeOutputProp) {
+    this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
+  if (NULL != runtimeOutputProp)
+    {
     outputDir = runtimeOutputProp;
-  }
+    }
 
   std::string configCapped(cmSystemTools::UpperCase(config));
   const char *runtimeOutputSProp =
-      Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
-  if (NULL != runtimeOutputSProp) {
+    this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
+  if (NULL != runtimeOutputSProp)
+    {
     outputDir = runtimeOutputSProp;
-  }
+    }
   cmSystemTools::ConvertToUnixSlashes(outputDir);
 
-  if (outputDir.length() > 0 && ('/' != (*outputDir.rbegin()))) {
+  if (!outputDir.empty())
+    {
     outputDir += "/";
-  }
+    }
 
   return outputDir;
 }
 
 std::string
-cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const {
-  std::string outputFilename(Target->GetName());
+cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const
+{
+  std::string outputFilename(this->Target->GetName());
 
-  const char *outputNameProp = Target->GetProperty("OUTPUT_NAME");
-  if (NULL != outputNameProp) {
+  const char *outputNameProp = this->Target->GetProperty("OUTPUT_NAME");
+  if (NULL != outputNameProp)
+    {
     outputFilename = outputNameProp;
-  }
+    }
 
   std::string configCapped(cmSystemTools::UpperCase(config));
   const char *outputNameSProp =
-      Target->GetProperty(configCapped + "_OUTPUT_NAME");
-  if (NULL != outputNameSProp) {
+    this->Target->GetProperty(configCapped + "_OUTPUT_NAME");
+  if (NULL != outputNameSProp)
+    {
     outputFilename = outputNameSProp;
-  }
+    }
 
   return outputFilename;
 }
 
 bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const &config,
-                                            const std::string &language) {
+                                            const std::string &language)
+{
   bool output;
   std::vector<std::string> options;
-  Target->GetCompileOptions(options, config, language);
+  this->Target->GetCompileOptions(options, config, language);
   output =
-      options.end() == std::find(options.begin(), options.end(), "-kernel");
+    options.end() == std::find(options.begin(), options.end(), "-kernel");
   return output;
 }
 
-bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup() {
+bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup()
+{
   bool output = false;
-  std::vector<cmSourceFile *> sources = GetSources();
+  std::vector<cmSourceFile *> sources = this->GetSources();
   for (std::vector<cmSourceFile *>::const_iterator sources_i = sources.begin();
-       sources.end() != sources_i; ++sources_i) {
-    if ("int" == (*sources_i)->GetExtension()) {
+       sources.end() != sources_i; ++sources_i)
+    {
+    if ("int" == (*sources_i)->GetExtension())
+      {
       output = true;
+      }
     }
-  }
   return output;
 }
 
 bool cmGhsMultiTargetGenerator::DetermineIfDynamicDownload(
-    std::string const &config, const std::string &language) {
+  std::string const &config, const std::string &language)
+{
   std::vector<std::string> options;
   bool output = false;
-  Target->GetCompileOptions(options, config, language);
+  this->Target->GetCompileOptions(options, config, language);
   for (std::vector<std::string>::const_iterator options_i = options.begin();
-       options_i != options.end(); ++options_i) {
+       options_i != options.end(); ++options_i)
+    {
     std::string option = *options_i;
-    if (DDOption == option) {
+    if (this->DDOption == option)
+      {
       output = true;
+      }
     }
-  }
   return output;
 }
diff --git a/Source/cmGhsMultiTargetGenerator.h 
b/Source/cmGhsMultiTargetGenerator.h
index 0e61193..3eecc60 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -24,7 +24,8 @@ class cmSourceFile;
 class cmGeneratedFileStream;
 class cmCustomCommand;
 
-class cmGhsMultiTargetGenerator {
+class cmGhsMultiTargetGenerator
+{
 public:
   cmGhsMultiTargetGenerator(cmTarget const *target);
 
@@ -35,17 +36,30 @@ public:
   bool IncludeThisTarget();
   std::vector<cmSourceFile *> GetSources() const;
   GhsMultiGpj::Types GetGpjTag() const;
-  const char *GetAbsBuildFilePath() const { return AbsBuildFilePath.c_str(); }
-  const char *GetRelBuildFileName() const { return RelBuildFileName.c_str(); }
-  const char *GetAbsBuildFileName() const { return AbsBuildFileName.c_str(); }
-  const char *GetAbsOutputFileName() const {return AbsOutputFileName.c_str();}
+  const char *GetAbsBuildFilePath() const
+  {
+    return this->AbsBuildFilePath.c_str();
+  }
+  const char *GetRelBuildFileName() const
+  {
+    return this->RelBuildFileName.c_str();
+  }
+  const char *GetAbsBuildFileName() const
+  {
+    return this->AbsBuildFileName.c_str();
+  }
+  const char *GetAbsOutputFileName() const
+  {
+    return this->AbsOutputFileName.c_str();
+  }
 
 private:
   cmGlobalGhsMultiGenerator *GetGlobalGenerator() const;
-  cmGeneratedFileStream *GetFolderBuildStreams() {
-    return FolderBuildStreams[""];
+  cmGeneratedFileStream *GetFolderBuildStreams()
+  {
+    return this->FolderBuildStreams[""];
   };
-  bool IsTargetGroup() const { return TargetGroup; }
+  bool IsTargetGroup() const { return this->TargetGroup; }
 
   void WriteTypeSpecifics(const std::string &config, bool notKernel);
   void WriteDebugOptions(std::string const &config, bool notKernel);
@@ -82,8 +96,7 @@ private:
   std::string RelBuildFileName;
   std::string RelOutputFileName;
   std::string AbsOutputFileName;
-  std::map<std::string, cmGeneratedFileStream*>
-      FolderBuildStreams;
+  std::map<std::string, cmGeneratedFileStream *> FolderBuildStreams;
   bool TargetGroup;
   bool DynamicDownload;
   static std::string const DDOption;
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx 
b/Source/cmGlobalGhsMultiGenerator.cxx
index b99462b..afd05ae 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -20,35 +20,41 @@
 
 const char *cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj";
 
-cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator() : OSDirRelative(false) {
+cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator()
+  : OSDirRelative(false)
+{
   this->GhsBuildCommandInitialized = false;
 }
 
-cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator() {
+cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator()
+{
   cmDeleteAll(TargetFolderBuildStreams);
 }
 
-cmLocalGenerator *cmGlobalGhsMultiGenerator::CreateLocalGenerator() {
+cmLocalGenerator *cmGlobalGhsMultiGenerator::CreateLocalGenerator()
+{
   cmLocalGenerator *lg = new cmLocalGhsMultiGenerator;
   lg->SetGlobalGenerator(this);
   this->SetCurrentLocalGenerator(lg);
   return lg;
 }
 
-void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry &entry) {
+void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry &entry)
+{
   entry.Name = GetActualName();
   entry.Brief = "Generates Green Hills MULTI files (experimental).";
 }
 
 void cmGlobalGhsMultiGenerator::EnableLanguage(
-    std::vector<std::string> const &l, cmMakefile *mf, bool optional) {
+  std::vector<std::string> const &l, cmMakefile *mf, bool optional)
+{
   mf->AddDefinition("CMAKE_SYSTEM_NAME", "GHS-MULTI");
   mf->AddDefinition("CMAKE_SYSTEM_PROCESSOR", "ARM");
 
   const std::string ghsCompRoot(GetCompRoot());
   mf->AddDefinition("GHS_COMP_ROOT", ghsCompRoot.c_str());
   std::string ghsCompRootStart =
-      0 == ghsCompRootStart.size() ? "" : ghsCompRoot + "/";
+    0 == ghsCompRootStart.size() ? "" : ghsCompRoot + "/";
   mf->AddDefinition("CMAKE_C_COMPILER",
                     std::string(ghsCompRootStart + "ccarm.exe").c_str());
   mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE");
@@ -61,45 +67,53 @@ void cmGlobalGhsMultiGenerator::EnableLanguage(
   mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GHSCXX");
   mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE");
 
-  if (ghsCompRoot.length() > 0) {
+  if (!ghsCompRoot.empty())
+    {
     static const char *compPreFix = "comp_";
     std::string compFilename =
-        cmsys::SystemTools::FindLastString(ghsCompRoot.c_str(), compPreFix);
+      cmsys::SystemTools::FindLastString(ghsCompRoot.c_str(), compPreFix);
     cmsys::SystemTools::ReplaceString(compFilename, compPreFix, "");
     mf->AddDefinition("CMAKE_SYSTEM_VERSION", compFilename.c_str());
-  }
+    }
 
   mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files
   this->cmGlobalGenerator::EnableLanguage(l, mf, optional);
 }
 
-void cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile *mf) {
+void cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile *mf)
+{
   // The GHS generator knows how to lookup its build tool
   // directly instead of needing a helper module to do it, so we
   // do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
-  if (cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+  if (cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
+    {
     mf->AddDefinition("CMAKE_MAKE_PROGRAM",
                       this->GetGhsBuildCommand().c_str());
-  }
+    }
 }
 
-std::string const &cmGlobalGhsMultiGenerator::GetGhsBuildCommand() {
-  if (!this->GhsBuildCommandInitialized) {
+std::string const &cmGlobalGhsMultiGenerator::GetGhsBuildCommand()
+{
+  if (!this->GhsBuildCommandInitialized)
+    {
     this->GhsBuildCommandInitialized = true;
     this->GhsBuildCommand = this->FindGhsBuildCommand();
-  }
+    }
   return this->GhsBuildCommand;
 }
 
-std::string cmGlobalGhsMultiGenerator::FindGhsBuildCommand() {
+std::string cmGlobalGhsMultiGenerator::FindGhsBuildCommand()
+{
   std::string makeProgram = cmSystemTools::FindProgram("gbuild");
-  if (makeProgram.empty()) {
+  if (makeProgram.empty())
+    {
     makeProgram = "gbuild";
-  }
+    }
   return makeProgram;
 }
 
-std::string cmGlobalGhsMultiGenerator::GetCompRoot() {
+std::string cmGlobalGhsMultiGenerator::GetCompRoot()
+{
   std::string output;
 
   const std::vector<std::string>
@@ -117,194 +131,235 @@ std::string cmGlobalGhsMultiGenerator::GetCompRoot() {
   // Use latest version
   std::string outputDirName;
   for (std::vector<std::string>::const_iterator potentialDirsCompleteIt =
-           potentialDirsComplete.begin();
+         potentialDirsComplete.begin();
        potentialDirsCompleteIt != potentialDirsComplete.end();
-       ++potentialDirsCompleteIt) {
+       ++potentialDirsCompleteIt)
+    {
     const std::string dirName(
-        cmsys::SystemTools::GetFilenameName(*potentialDirsCompleteIt));
-    if (dirName.compare(outputDirName) > 0) {
+      cmsys::SystemTools::GetFilenameName(*potentialDirsCompleteIt));
+    if (dirName.compare(outputDirName) > 0)
+      {
       output = *potentialDirsCompleteIt;
       outputDirName = dirName;
+      }
     }
-  }
 
   return output;
 }
 
-std::vector<std::string> cmGlobalGhsMultiGenerator::GetCompRootHardPaths() {
+std::vector<std::string> cmGlobalGhsMultiGenerator::GetCompRootHardPaths()
+{
   std::vector<std::string> output;
   cmSystemTools::Glob("C:/ghs", "comp_[^;]+", output);
   for (std::vector<std::string>::iterator outputIt = output.begin();
-       outputIt != output.end(); ++outputIt) {
+       outputIt != output.end(); ++outputIt)
+    {
     *outputIt = "C:/ghs/" + *outputIt;
-  }
+    }
   return output;
 }
 
-std::vector<std::string> cmGlobalGhsMultiGenerator::GetCompRootRegistry() {
+std::vector<std::string> cmGlobalGhsMultiGenerator::GetCompRootRegistry()
+{
   std::vector<std::string> output(2);
   cmsys::SystemTools::ReadRegistryValue(
-      "HKEY_LOCAL_"
-      "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\"
-      "Windows\\CurrentVersion\\Uninstall\\"
-      "GreenHillsSoftwared771f1b4;InstallLocation",
-      output[0]);
+    "HKEY_LOCAL_"
+    "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\"
+    "Windows\\CurrentVersion\\Uninstall\\"
+    "GreenHillsSoftwared771f1b4;InstallLocation",
+    output[0]);
   cmsys::SystemTools::ReadRegistryValue(
-      "HKEY_LOCAL_"
-      "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\"
-      "Windows\\CurrentVersion\\Uninstall\\"
-      "GreenHillsSoftware9881cef6;InstallLocation",
-      output[1]);
+    "HKEY_LOCAL_"
+    "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\"
+    "Windows\\CurrentVersion\\Uninstall\\"
+    "GreenHillsSoftware9881cef6;InstallLocation",
+    output[1]);
   return output;
 }
 
 void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
-    std::string const &filepath, cmGeneratedFileStream **filestream) {
+  std::string const &filepath, cmGeneratedFileStream **filestream)
+{
   // Get a stream where to generate things.
-  if (NULL == *filestream) {
+  if (NULL == *filestream)
+    {
     *filestream = new cmGeneratedFileStream(filepath.c_str());
-    if (NULL != *filestream) {
+    if (NULL != *filestream)
+      {
       OpenBuildFileStream(*filestream);
+      }
     }
-  }
 }
 
 void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
-    cmGeneratedFileStream *filestream) {
+  cmGeneratedFileStream *filestream)
+{
   *filestream << "#!gbuild" << std::endl;
 }
 
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream() {
+void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
+{
   // Compute GHS MULTI's build file path.
   std::string buildFilePath =
-      this->GetCMakeInstance()->GetHomeOutputDirectory();
+    this->GetCMakeInstance()->GetHomeOutputDirectory();
   buildFilePath += "/";
   buildFilePath += "default";
   buildFilePath += FILE_EXTENSION;
 
-  Open(std::string(""), buildFilePath, &TargetFolderBuildStreams);
+  this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams);
   OpenBuildFileStream(GetBuildFileStream());
 
   char const *osDir =
-      this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR");
-  if (NULL == osDir) {
+    this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR");
+  if (NULL == osDir)
+    {
     osDir = "";
     cmSystemTools::Error("GHS_OS_DIR cache variable must be set");
-  } else {
+    }
+  else
+    {
     this->GetCMakeInstance()->MarkCliAsUsed("GHS_OS_DIR");
-  }
-  std::string fOSDir(trimQuotes(osDir));
+    }
+  std::string fOSDir(this->trimQuotes(osDir));
   cmSystemTools::ReplaceString(fOSDir, "\\", "/");
-  if (fOSDir.length() > 0 && ('c' == fOSDir[0] || 'C' == fOSDir[0])) {
-    OSDirRelative = false;
-  } else {
-    OSDirRelative = true;
-  }
+  if (!fOSDir.empty() && ('c' == fOSDir[0] || 'C' == fOSDir[0]))
+    {
+    this->OSDirRelative = false;
+    }
+  else
+    {
+    this->OSDirRelative = true;
+    }
 
   char const *bspName =
-      this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
-  if (NULL == bspName) {
+    this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
+  if (NULL == bspName)
+    {
     bspName = "";
     cmSystemTools::Error("GHS_BSP_NAME cache variable must be set");
-  } else {
+    }
+  else
+    {
     this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
-  }
-  std::string fBspName(trimQuotes(bspName));
+    }
+  std::string fBspName(this->trimQuotes(bspName));
   cmSystemTools::ReplaceString(fBspName, "\\", "/");
-  WriteMacros();
-  WriteHighLevelDirectives();
-
-  GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, GetBuildFileStream());
-  WriteDisclaimer(GetBuildFileStream());
-  *GetBuildFileStream() << "# Top Level Project File" << std::endl;
-  if (fBspName.length() > 0) {
-    *GetBuildFileStream() << "    -bsp " << fBspName << std::endl;
-  }
-  WriteCompilerOptions(fOSDir);
+  this->WriteMacros();
+  this->WriteHighLevelDirectives();
+
+  GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
+  this->WriteDisclaimer(this->GetBuildFileStream());
+  *this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
+  if (!fBspName.empty())
+    {
+    *this->GetBuildFileStream() << "    -bsp " << fBspName << std::endl;
+    }
+  this->WriteCompilerOptions(fOSDir);
 }
 
 void cmGlobalGhsMultiGenerator::CloseBuildFileStream(
-    cmGeneratedFileStream **filestream) {
-  if (filestream) {
+  cmGeneratedFileStream **filestream)
+{
+  if (filestream)
+    {
     delete *filestream;
     *filestream = NULL;
-  } else {
+    }
+  else
+    {
     cmSystemTools::Error("Build file stream was not open.");
-  }
+    }
 }
 
-void cmGlobalGhsMultiGenerator::Generate() {
+void cmGlobalGhsMultiGenerator::Generate()
+{
   this->cmGlobalGenerator::Generate();
 
-  if (!this->LocalGenerators.empty()) {
+  if (!this->LocalGenerators.empty())
+    {
     this->OpenBuildFileStream();
 
     // Build all the folder build files
-    for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
+    for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+      {
       cmLocalGhsMultiGenerator *lg =
-          static_cast<cmLocalGhsMultiGenerator *>(this->LocalGenerators[i]);
+        static_cast<cmLocalGhsMultiGenerator *>(this->LocalGenerators[i]);
       cmGeneratorTargetsType tgts = lg->GetMakefile()->GetGeneratorTargets();
-      UpdateBuildFiles(tgts);
+      this->UpdateBuildFiles(tgts);
+      }
     }
-  }
 
   cmDeleteAll(TargetFolderBuildStreams);
   this->TargetFolderBuildStreams.clear();
 }
 
 void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
-    std::vector<std::string> &makeCommand, const std::string &makeProgram,
-    const std::string & /*projectName*/, const std::string & /*projectDir*/,
-    const std::string &targetName, const std::string & /*config*/,
-    bool /*fast*/, bool /*verbose*/,
-    std::vector<std::string> const &makeOptions) {
+  std::vector<std::string> &makeCommand, const std::string &makeProgram,
+  const std::string & /*projectName*/, const std::string & /*projectDir*/,
+  const std::string &targetName, const std::string & /*config*/,
+  bool /*fast*/, bool /*verbose*/,
+  std::vector<std::string> const &makeOptions)
+{
   makeCommand.push_back(
     this->SelectMakeProgram(makeProgram, this->GetGhsBuildCommand())
     );
 
   makeCommand.insert(makeCommand.end(),
                      makeOptions.begin(), makeOptions.end());
-  if (!targetName.empty()) {
-    if (targetName == "clean") {
+  if (!targetName.empty())
+    {
+    if (targetName == "clean")
+      {
       makeCommand.push_back("-clean");
-    } else {
+      }
+    else
+      {
       makeCommand.push_back(targetName);
+      }
     }
-  }
 }
 
-void cmGlobalGhsMultiGenerator::WriteMacros() {
+void cmGlobalGhsMultiGenerator::WriteMacros()
+{
   char const *ghsGpjMacros =
-      this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS");
-  if (NULL != ghsGpjMacros) {
+    this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS");
+  if (NULL != ghsGpjMacros)
+    {
     std::vector<std::string> expandedList;
     cmSystemTools::ExpandListArgument(std::string(ghsGpjMacros), expandedList);
     for (std::vector<std::string>::const_iterator expandedListI =
-             expandedList.begin();
-         expandedListI != expandedList.end(); ++expandedListI) {
-      *GetBuildFileStream() << "macro " << *expandedListI << std::endl;
+           expandedList.begin();
+         expandedListI != expandedList.end(); ++expandedListI)
+      {
+      *this->GetBuildFileStream() << "macro " << *expandedListI << std::endl;
+      }
     }
-  }
 }
 
-void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives() {
-  *GetBuildFileStream() << "primaryTarget=arm_integrity.tgt" << std::endl;
+void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
+{
+  *this->GetBuildFileStream() << "primaryTarget=arm_integrity.tgt"
+                              << std::endl;
   char const *const customization =
-      this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
-  if (NULL != customization && strlen(customization) > 0) {
-    *GetBuildFileStream() << "customization=" << trimQuotes(customization)
-                          << std::endl;
+    this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
+  if (NULL != customization && strlen(customization) > 0)
+    {
+    *this->GetBuildFileStream() << "customization="
+                                << trimQuotes(customization)
+                                << std::endl;
     this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION");
-  }
+    }
 }
 
-void cmGlobalGhsMultiGenerator::WriteCompilerOptions(
-    std::string const &fOSDir) {
-  *GetBuildFileStream() << "    -os_dir=\"" << fOSDir << "\"" << std::endl;
-  *GetBuildFileStream() << "    --link_once_templates" << std::endl;
+void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const &fOSDir)
+{
+  *this->GetBuildFileStream() << "    -os_dir=\"" << fOSDir << "\""
+                              << std::endl;
+  *this->GetBuildFileStream() << "    --link_once_templates" << std::endl;
 }
 
-void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream *os) {
+void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream *os)
+{
   (*os) << "#" << std::endl
         << "# CMAKE generated file: DO NOT EDIT!" << std::endl
         << "# Generated by \"" << GetActualName() << "\""
@@ -314,141 +369,160 @@ void 
cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream *os) {
 }
 
 void cmGlobalGhsMultiGenerator::AddFilesUpToPath(
-    cmGeneratedFileStream *mainBuildFile,
-    std::map<std::string, cmGeneratedFileStream*> *
-        targetFolderBuildStreams,
-    char const *homeOutputDirectory, std::string const &path,
-    GhsMultiGpj::Types projType, std::string const &relPath) {
+  cmGeneratedFileStream *mainBuildFile,
+  std::map<std::string, cmGeneratedFileStream *> *targetFolderBuildStreams,
+  char const *homeOutputDirectory, std::string const &path,
+  GhsMultiGpj::Types projType, std::string const &relPath)
+{
   std::string workingPath(path);
   cmSystemTools::ConvertToUnixSlashes(workingPath);
   std::vector<cmsys::String> splitPath =
-      cmSystemTools::SplitString(workingPath);
+    cmSystemTools::SplitString(workingPath);
   std::string workingRelPath(relPath);
-  if (!cmHasLiteralSuffix(relPath, "/")) {
+  cmSystemTools::ConvertToUnixSlashes(workingRelPath);
+  if (!workingRelPath.empty())
+    {
     workingRelPath += "/";
-  }
+    }
   std::string pathUpTo;
   for (std::vector<cmsys::String>::const_iterator splitPathI =
-           splitPath.begin();
-       splitPath.end() != splitPathI; ++splitPathI) {
+         splitPath.begin();
+       splitPath.end() != splitPathI; ++splitPathI)
+    {
     pathUpTo += *splitPathI;
     if (targetFolderBuildStreams->end() ==
-        targetFolderBuildStreams->find(pathUpTo)) {
+        targetFolderBuildStreams->find(pathUpTo))
+      {
       AddFilesUpToPathNewBuildFile(
-          mainBuildFile, targetFolderBuildStreams, homeOutputDirectory,
-          pathUpTo, splitPath.begin() == splitPathI, workingRelPath, projType);
-    }
+        mainBuildFile, targetFolderBuildStreams, homeOutputDirectory,
+        pathUpTo, splitPath.begin() == splitPathI, workingRelPath, projType);
+      }
     AddFilesUpToPathAppendNextFile(targetFolderBuildStreams, pathUpTo,
                                    splitPathI, splitPath.end(), projType);
     pathUpTo += "/";
-  }
+    }
 }
 
 void cmGlobalGhsMultiGenerator::Open(
-    std::string const &mapKeyName, std::string const &fileName,
-    std::map<std::string, cmGeneratedFileStream*> *fileMap) {
-  if (fileMap->end() == fileMap->find(fileName)) {
-    cmGeneratedFileStream* temp(new cmGeneratedFileStream);
+  std::string const &mapKeyName, std::string const &fileName,
+  std::map<std::string, cmGeneratedFileStream *> *fileMap)
+{
+  if (fileMap->end() == fileMap->find(fileName))
+    {
+    cmGeneratedFileStream *temp(new cmGeneratedFileStream);
     temp->open(fileName.c_str());
     (*fileMap)[mapKeyName] = temp;
-  }
+    }
 }
 
 void cmGlobalGhsMultiGenerator::AddFilesUpToPathNewBuildFile(
-    cmGeneratedFileStream *mainBuildFile,
-    std::map<std::string, cmGeneratedFileStream*> *
-        targetFolderBuildStreams,
-    char const *homeOutputDirectory, std::string const &pathUpTo,
-    bool const isFirst, std::string const &relPath,
-    GhsMultiGpj::Types const projType) {
+  cmGeneratedFileStream *mainBuildFile,
+  std::map<std::string, cmGeneratedFileStream *> *targetFolderBuildStreams,
+  char const *homeOutputDirectory, std::string const &pathUpTo,
+  bool const isFirst, std::string const &relPath,
+  GhsMultiGpj::Types const projType)
+{
   // create folders up to file path
   std::string absPath = std::string(homeOutputDirectory) + "/" + relPath;
   std::string newPath = absPath + pathUpTo;
-  if (!cmSystemTools::FileExists(newPath.c_str())) {
+  if (!cmSystemTools::FileExists(newPath.c_str()))
+    {
     cmSystemTools::MakeDirectory(newPath.c_str());
-  }
+    }
 
   // Write out to filename for first time
   std::string relFilename(GetFileNameFromPath(pathUpTo));
   std::string absFilename = absPath + relFilename;
   Open(pathUpTo, absFilename, targetFolderBuildStreams);
   OpenBuildFileStream((*targetFolderBuildStreams)[pathUpTo]);
-  GhsMultiGpj::WriteGpjTag(projType,
-                           (*targetFolderBuildStreams)[pathUpTo]);
+  GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]);
   WriteDisclaimer((*targetFolderBuildStreams)[pathUpTo]);
 
   // Add to main build file
-  if (isFirst) {
+  if (isFirst)
+    {
     *mainBuildFile << relFilename << " ";
     GhsMultiGpj::WriteGpjTag(projType, mainBuildFile);
-  }
+    }
 }
 
 void cmGlobalGhsMultiGenerator::AddFilesUpToPathAppendNextFile(
-    std::map<std::string, cmGeneratedFileStream*> *
-        targetFolderBuildStreams,
-    std::string const &pathUpTo,
-    std::vector<cmsys::String>::const_iterator splitPathI,
-    std::vector<cmsys::String>::const_iterator end,
-    GhsMultiGpj::Types const projType) {
+  std::map<std::string, cmGeneratedFileStream *> *targetFolderBuildStreams,
+  std::string const &pathUpTo,
+  std::vector<cmsys::String>::const_iterator splitPathI,
+  std::vector<cmsys::String>::const_iterator end,
+  GhsMultiGpj::Types const projType)
+{
   std::vector<cmsys::String>::const_iterator splitPathNextI = splitPathI + 1;
   if (end != splitPathNextI &&
       targetFolderBuildStreams->end() ==
-          targetFolderBuildStreams->find(pathUpTo + "/" + *splitPathNextI)) {
+      targetFolderBuildStreams->find(pathUpTo + "/" + *splitPathNextI))
+    {
     std::string nextFilename(*splitPathNextI);
     nextFilename = GetFileNameFromPath(nextFilename);
     *(*targetFolderBuildStreams)[pathUpTo] << nextFilename << " ";
-    GhsMultiGpj::WriteGpjTag(projType,
-                             (*targetFolderBuildStreams)[pathUpTo]);
-  }
+    GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]);
+    }
 }
 
 std::string
-cmGlobalGhsMultiGenerator::GetFileNameFromPath(std::string const &path) {
+cmGlobalGhsMultiGenerator::GetFileNameFromPath(std::string const &path)
+{
   std::string output(path);
-  if (path.length() > 0) {
+  if (!path.empty())
+    {
     cmSystemTools::ConvertToUnixSlashes(output);
     std::vector<cmsys::String> splitPath = cmSystemTools::SplitString(output);
     output += "/" + splitPath.back() + FILE_EXTENSION;
-  }
+    }
   return output;
 }
 
 void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
-    cmGeneratorTargetsType const &tgts) {
+  cmGeneratorTargetsType const &tgts)
+{
   for (cmGeneratorTargetsType::const_iterator tgtsI = tgts.begin();
-       tgtsI != tgts.end(); ++tgtsI) {
+       tgtsI != tgts.end(); ++tgtsI)
+    {
     cmGhsMultiTargetGenerator gmtg(tgtsI->first);
-    if (!gmtg.GetSources().empty() && gmtg.IncludeThisTarget()) {
+    if (!gmtg.GetSources().empty() && gmtg.IncludeThisTarget())
+      {
       char const *rawFolderName = tgtsI->first->GetProperty("FOLDER");
-      if (NULL == rawFolderName) {
+      if (NULL == rawFolderName)
+        {
         rawFolderName = "";
-      }
+        }
       std::string folderName(rawFolderName);
-      if (TargetFolderBuildStreams.end() ==
-          TargetFolderBuildStreams.find(folderName)) {
-        AddFilesUpToPath(GetBuildFileStream(), &TargetFolderBuildStreams,
-                         this->GetCMakeInstance()->GetHomeOutputDirectory(),
-                         folderName, GhsMultiGpj::PROJECT);
-      }
+      if (this->TargetFolderBuildStreams.end() ==
+          this->TargetFolderBuildStreams.find(folderName))
+        {
+        this->AddFilesUpToPath(
+          GetBuildFileStream(), &this->TargetFolderBuildStreams,
+          this->GetCMakeInstance()->GetHomeOutputDirectory(), folderName,
+          GhsMultiGpj::PROJECT);
+        }
       std::vector<cmsys::String> splitPath =
-          cmSystemTools::SplitString(gmtg.GetRelBuildFileName());
+        cmSystemTools::SplitString(gmtg.GetRelBuildFileName());
       std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" +
                                        splitPath.back());
-      *TargetFolderBuildStreams[folderName] << foldNameRelBuildFile << " ";
+      *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
+                                                  << " ";
       GhsMultiGpj::WriteGpjTag(gmtg.GetGpjTag(),
-                               TargetFolderBuildStreams[folderName]);
+                               this->TargetFolderBuildStreams[folderName]);
+      }
     }
-  }
 }
 
-std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const &str) {
+std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const &str)
+{
   std::string result;
   result.reserve(str.size());
-  for (const char *ch = str.c_str(); *ch != '\0'; ++ch) {
-    if (*ch != '"') {
+  for (const char *ch = str.c_str(); *ch != '\0'; ++ch)
+    {
+    if (*ch != '"')
+      {
       result += *ch;
+      }
     }
-  }
   return result;
 }
diff --git a/Source/cmGlobalGhsMultiGenerator.h 
b/Source/cmGlobalGhsMultiGenerator.h
index 78a7736..d5948da 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -18,7 +18,8 @@
 
 class cmGeneratedFileStream;
 
-class cmGlobalGhsMultiGenerator : public cmGlobalGenerator {
+class cmGlobalGhsMultiGenerator : public cmGlobalGenerator
+{
 public:
   /// The default name of GHS MULTI's build file. Typically: monolith.gpj.
   static const char *FILE_EXTENSION;
@@ -26,9 +27,8 @@ public:
   cmGlobalGhsMultiGenerator();
   ~cmGlobalGhsMultiGenerator();
 
-  static cmGlobalGeneratorFactory *NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory<cmGlobalGhsMultiGenerator>();
-  }
+  static cmGlobalGeneratorFactory *NewFactory()
+  { return new cmGlobalGeneratorSimpleFactory<cmGlobalGhsMultiGenerator>(); }
 
   ///! create the correct local generator
   virtual cmLocalGenerator *CreateLocalGenerator();
@@ -36,7 +36,7 @@ public:
   /// @return the name of this generator.
   static std::string GetActualName() { return "Green Hills MULTI"; }
   ///! Get the name for this generator
-  virtual std::string GetName() const { return GetActualName(); }
+  virtual std::string GetName() const { return this->GetActualName(); }
 
   /// Overloaded methods. @see cmGlobalGenerator::GetDocumentation()
   static void GetDocumentation(cmDocumentationEntry &entry);
@@ -52,8 +52,9 @@ public:
   */
   virtual void FindMakeProgram(cmMakefile *);
 
-  cmGeneratedFileStream *GetBuildFileStream() {
-    return TargetFolderBuildStreams[""];
+  cmGeneratedFileStream *GetBuildFileStream()
+  {
+    return this->TargetFolderBuildStreams[""];
   }
 
   static void OpenBuildFileStream(std::string const &filepath,
@@ -62,30 +63,28 @@ public:
   static void CloseBuildFileStream(cmGeneratedFileStream **filestream);
   /// Write the common disclaimer text at the top of each build file.
   static void WriteDisclaimer(std::ostream *os);
-  std::vector<std::string> GetLibDirs() { return LibDirs; }
+  std::vector<std::string> GetLibDirs() { return this->LibDirs; }
 
   static void AddFilesUpToPath(
       cmGeneratedFileStream *mainBuildFile,
-      std::map<std::string, cmGeneratedFileStream*> *
-          targetFolderBuildStreams,
+      std::map<std::string, cmGeneratedFileStream *> *targetFolderBuildStreams,
       char const *homeOutputDirectory, std::string const &path,
       GhsMultiGpj::Types projType, std::string const &relPath = "");
-  static void
-  Open(std::string const &mapKeyName, std::string const &fileName,
-       std::map<std::string, cmGeneratedFileStream*> *fileMap);
+  static void Open(std::string const &mapKeyName, std::string const &fileName,
+                   std::map<std::string, cmGeneratedFileStream *> *fileMap);
 
   static std::string trimQuotes(std::string const &str);
-  inline bool IsOSDirRelative() { return OSDirRelative; }
+  inline bool IsOSDirRelative() { return this->OSDirRelative; }
 
 protected:
   virtual void Generate();
   virtual void GenerateBuildCommand(
       std::vector<std::string> &makeCommand, const std::string &makeProgram,
       const std::string &projectName, const std::string &projectDir,
-      const std::string &targetName, const std::string &config,
-      bool fast, bool verbose,
-      std::vector<std::string> const &makeOptions =
-      std::vector<std::string>());
+      const std::string &targetName, const std::string &config, bool fast,
+      bool verbose,
+      std::vector<std::string> const& makeOptions = std::vector<std::string>()
+    );
 
 private:
   std::string const &GetGhsBuildCommand();
@@ -101,13 +100,11 @@ private:
 
   static void AddFilesUpToPathNewBuildFile(
       cmGeneratedFileStream *mainBuildFile,
-      std::map<std::string, cmGeneratedFileStream*> *
-          targetFolderBuildStreams,
+      std::map<std::string, cmGeneratedFileStream *> *targetFolderBuildStreams,
       char const *homeOutputDirectory, std::string const &pathUpTo,
       bool isFirst, std::string const &relPath, GhsMultiGpj::Types projType);
   static void AddFilesUpToPathAppendNextFile(
-      std::map<std::string, cmGeneratedFileStream*> *
-          targetFolderBuildStreams,
+      std::map<std::string, cmGeneratedFileStream *> *targetFolderBuildStreams,
       std::string const &pathUpTo,
       std::vector<cmsys::String>::const_iterator splitPathI,
       std::vector<cmsys::String>::const_iterator end,
@@ -116,8 +113,7 @@ private:
   void UpdateBuildFiles(cmGeneratorTargetsType const &tgts);
 
   std::vector<cmGeneratedFileStream *> TargetSubProjects;
-  std::map<std::string, cmGeneratedFileStream*>
-      TargetFolderBuildStreams;
+  std::map<std::string, cmGeneratedFileStream *> TargetFolderBuildStreams;
 
   std::vector<std::string> LibDirs;
 
diff --git a/Source/cmLocalGhsMultiGenerator.cxx 
b/Source/cmLocalGhsMultiGenerator.cxx
index b60463f..8773715 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -20,15 +20,18 @@ cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator() {}
 
 cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator() {}
 
-void cmLocalGhsMultiGenerator::Generate() {
+void cmLocalGhsMultiGenerator::Generate()
+{
   cmGeneratorTargetsType tgts = this->GetMakefile()->GetGeneratorTargets();
-  if (!tgts.empty()) {
+  if (!tgts.empty())
+    {
     for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end();
-         ++l) {
+         ++l)
+      {
       cmGhsMultiTargetGenerator tg(l->second->Target);
       tg.Generate();
+      }
     }
-  }
 }
 
 // Implemented in:
@@ -36,13 +39,15 @@ void cmLocalGhsMultiGenerator::Generate() {
 // Used in:
 //   Source/cmMakefile.cxx
 //   Source/cmGlobalGenerator.cxx
-void cmLocalGhsMultiGenerator::Configure() {
+void cmLocalGhsMultiGenerator::Configure()
+{
   // Compute the path to use when referencing the current output
   // directory from the top output directory.
   this->HomeRelativeOutputPath =
-      this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT);
-  if (this->HomeRelativeOutputPath == ".") {
+    this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT);
+  if (this->HomeRelativeOutputPath == ".")
+    {
     this->HomeRelativeOutputPath = "";
-  }
+    }
   this->cmLocalGenerator::Configure();
 }
diff --git a/Source/cmLocalGhsMultiGenerator.h 
b/Source/cmLocalGhsMultiGenerator.h
index c97b03f..a8df3e7 100644
--- a/Source/cmLocalGhsMultiGenerator.h
+++ b/Source/cmLocalGhsMultiGenerator.h
@@ -22,7 +22,8 @@ class cmGeneratedFileStream;
  * cmLocalGhsMultiGenerator produces a set of .gpj
  * file for each target in its mirrored directory.
  */
-class cmLocalGhsMultiGenerator : public cmLocalGenerator {
+class cmLocalGhsMultiGenerator : public cmLocalGenerator
+{
 public:
   cmLocalGhsMultiGenerator();
 
@@ -30,7 +31,8 @@ public:
 
   /// @returns the relative path between the HomeOutputDirectory and this
   /// local generators StartOutputDirectory.
-  std::string GetHomeRelativeOutputPath() const {
+  std::string GetHomeRelativeOutputPath() const
+  {
     return this->HomeRelativeOutputPath;
   }
 
@@ -41,7 +43,7 @@ public:
 
   /// Overloaded methods. @see cmLocalGenerator::Configure()
   virtual void Configure();
-  const char *GetBuildFileName() { return BuildFileName.c_str(); }
+  const char *GetBuildFileName() { return this->BuildFileName.c_str(); }
 
 protected:
   virtual bool CustomCommandUseLocal() const { return true; }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGhsMultiGpj.cxx             |   42 +--
 Source/cmGhsMultiGpj.h               |    6 +-
 Source/cmGhsMultiTargetGenerator.cxx |  490 ++++++++++++++++++++--------------
 Source/cmGhsMultiTargetGenerator.h   |   33 ++-
 Source/cmGlobalGhsMultiGenerator.cxx |  420 +++++++++++++++++------------
 Source/cmGlobalGhsMultiGenerator.h   |   44 ++-
 Source/cmLocalGhsMultiGenerator.cxx  |   21 +-
 Source/cmLocalGhsMultiGenerator.h    |    8 +-
 8 files changed, 620 insertions(+), 444 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to