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, master has been updated
       via  f7f2b8078e6181f0f3c476c55d7cab3d86ffdaae (commit)
       via  f6f5f9f75f809a077ac3f451745904d9f3faaa85 (commit)
       via  e014df762b41e61b423e56637667a050be3a78e7 (commit)
       via  ce4f20ba62a3c7e0dd78cffc1669a400311f057e (commit)
       via  281c601024e7a82f85ef02ce00a0fc5686c5412d (commit)
       via  01c98c6cccc5a4d5c9faaf524da92590492e9976 (commit)
       via  bb77dc0cee95b2606ab6715aa9babc89c09d176f (commit)
       via  f80692cf600675bae4d12810c8119a62e76aa701 (commit)
       via  a37a4a00c8b8982c89ffc99505de097d3b2d7300 (commit)
       via  5d40d2b44fe93e223bd7802797b4cd430656790e (commit)
      from  7b04ad61cf925161c8b7f9abf6ef3db047118807 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7f2b8078e6181f0f3c476c55d7cab3d86ffdaae
commit f7f2b8078e6181f0f3c476c55d7cab3d86ffdaae
Merge: f6f5f9f e014df7
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Jul 12 13:15:15 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Jul 12 09:15:58 2018 -0400

    Merge topic 'qnx_fix'
    
    e014df762b QNX: Fix autogen compiler predefines detection
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2205


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6f5f9f75f809a077ac3f451745904d9f3faaa85
commit f6f5f9f75f809a077ac3f451745904d9f3faaa85
Merge: 7b04ad6 ce4f20b
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Jul 12 13:14:58 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Jul 12 09:15:18 2018 -0400

    Merge topic 'ghs'
    
    ce4f20ba62 GHS: Add release notes
    281c601024 GHS: Update default BSP name
    01c98c6ccc GHS: Update setting default OS location for Integrity platforms
    bb77dc0cee GHS: Set primary target using arch/platform values (or user 
specified value)
    f80692cf60 GHS: Add platform selection support
    a37a4a00c8 GHS: Add toolset selection support
    5d40d2b44f GHS: Support ARM, PPC, 86 architectures
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Acked-by: Matt Soucy <matthew.so...@baesystems.com>
    Merge-request: !798


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e014df762b41e61b423e56637667a050be3a78e7
commit e014df762b41e61b423e56637667a050be3a78e7
Author:     Cristian Adam <cristian.a...@here.com>
AuthorDate: Wed Jul 11 15:45:40 2018 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Jul 11 09:54:49 2018 -0400

    QNX: Fix autogen compiler predefines detection
    
    In commit v3.12.0-rc1~20^2 (Move GNU COMPILER_PREDEFINES_COMMAND from
    Platform to Compiler, 2018-06-01), `Compiler/GNU.cmake` introduced the
    `-dM` flag, which requires `-Wp` prefix for the QNX compiler wrapper.

diff --git a/Modules/Compiler/QCC.cmake b/Modules/Compiler/QCC.cmake
index 0da7050..a5e2b0b 100644
--- a/Modules/Compiler/QCC.cmake
+++ b/Modules/Compiler/QCC.cmake
@@ -16,6 +16,8 @@ macro(__compiler_qcc lang)
   set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE NO)
   set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
 
+  set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}" 
"-Wp,-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+
   unset(CMAKE_${lang}_COMPILE_OPTIONS_IPO)
   unset(CMAKE_${lang}_ARCHIVE_CREATE_IPO)
   unset(CMAKE_${lang}_ARCHIVE_APPEND_IPO)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ce4f20ba62a3c7e0dd78cffc1669a400311f057e
commit ce4f20ba62a3c7e0dd78cffc1669a400311f057e
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:22 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Wed Jul 11 08:48:25 2018 -0400

    GHS: Add release notes

diff --git a/Help/release/dev/ghs.rst b/Help/release/dev/ghs.rst
new file mode 100644
index 0000000..d3bec95
--- /dev/null
+++ b/Help/release/dev/ghs.rst
@@ -0,0 +1,20 @@
+ghs
+---
+
+* The :generator:`Green Hills MULTI` generator is updated:
+
+  - Added support for architecture selection through
+    :variable:`CMAKE_GENERATOR_PLATFORM`:
+    e.g. ``arm``, ``ppc``, and ``86``.
+
+  - Added support for toolset selection through
+    :variable:`CMAKE_GENERATOR_TOOLSET`,
+    e.g. ``comp_201205``, ``comp_201510``, ``comp_201722_beta``.
+
+  - Added support for platform selection through ``GHS_TARGET_PLATFORM``,
+    e.g. ``integrity``, ``linux``, ``standalone``, etc.
+
+  - No longer checks that ``arm`` based compilers are installed but ensures
+    that the correct ``gbuild.exe`` exists.
+
+  - No longer hard-codes ARM files, BSP, toolset, or OS locations.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=281c601024e7a82f85ef02ce00a0fc5686c5412d
commit 281c601024e7a82f85ef02ce00a0fc5686c5412d
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:22 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Wed Jul 11 08:48:23 2018 -0400

    GHS: Update default BSP name
    
    -- Use default value of sim<arch> if not user defined
    -- Also no reason to trim quotes or changes slashes; it is just a name not 
a path

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills 
MULTI.rst
index f148b4f..1b4960d 100644
--- a/Help/generator/Green Hills MULTI.rst      
+++ b/Help/generator/Green Hills MULTI.rst      
@@ -37,9 +37,12 @@ Default to ``C:/ghs``.  Root path for RTOS searches.
 Default to latest platform OS installation at ``GHS_OS_ROOT``.  Set this value 
if
 a specific RTOS is to be used.
 
+* ``GHS_BSP_NAME``
+
+Defaults to ``sim<arch>`` if not set by user.
+
 Customizations are available through the following cache variables:
 
-* ``GHS_BSP_NAME``
 * ``GHS_CUSTOMIZATION``
 * ``GHS_GPJ_MACROS``
 
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake 
b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 62a7e9f..9b384df 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -37,7 +37,8 @@ if ( NOT GHS_OS_DIR )
   endif ()
 endif ()
 
-set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name")
+set(GHS_BSP_NAME "IGNORE" CACHE STRING "BSP name")
+
 set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization")
 mark_as_advanced(GHS_CUSTOMIZATION)
 set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs 
for legacy reasons")
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx 
b/Source/cmGlobalGhsMultiGenerator.cxx
index 17fac41..a9742c5 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -236,25 +236,28 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
     this->OSDirRelative = true;
   }
 
-  char const* bspName =
+  std::string bspName;
+  char const* bspCache =
     this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
-  if (NULL == bspName) {
-    bspName = "";
-    cmSystemTools::Error("GHS_BSP_NAME cache variable must be set");
-  } else {
+  if (bspCache) {
+    bspName = bspCache;
     this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
   }
-  std::string fBspName(this->trimQuotes(bspName));
-  std::replace(fBspName.begin(), fBspName.end(), '\\', '/');
+  if (bspName.empty() || bspName.compare("IGNORE") == 0) {
+    const char* a =
+      this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
+    bspName = "sim";
+    bspName += (a ? a : "");
+  }
+
   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->GetBuildFileStream() << "    -bsp " << bspName << std::endl;
+
   this->WriteCompilerOptions(fOSDir);
 }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01c98c6cccc5a4d5c9faaf524da92590492e9976
commit 01c98c6cccc5a4d5c9faaf524da92590492e9976
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:21 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Wed Jul 11 08:46:26 2018 -0400

    GHS: Update setting default OS location for Integrity platforms
    
    -- Update how the latest OS is determined; scan the location GHS_OS_ROOT 
and sort it
       No longer use registry settings looking for installations
         The registry values are assigned in installation order for Green Hills 
tools not version order
       Filter out files from the list of directories (i.e if int1234.zip and 
int1234 are both in root folder)

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills 
MULTI.rst
index 7c2e643..f148b4f 100644
--- a/Help/generator/Green Hills MULTI.rst      
+++ b/Help/generator/Green Hills MULTI.rst      
@@ -28,12 +28,20 @@ Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
 
 Default to ``C:/ghs``.  Root path for ``toolset``.
 
+* ``GHS_OS_ROOT``
+
+Default to ``C:/ghs``.  Root path for RTOS searches.
+
+* ``GHS_OS_DIR``
+
+Default to latest platform OS installation at ``GHS_OS_ROOT``.  Set this value 
if
+a specific RTOS is to be used.
+
 Customizations are available through the following cache variables:
 
 * ``GHS_BSP_NAME``
 * ``GHS_CUSTOMIZATION``
 * ``GHS_GPJ_MACROS``
-* ``GHS_OS_DIR``
 
 .. note::
   This generator is deemed experimental as of CMake |release|
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake 
b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 0b7422c..62a7e9f 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -1,38 +1,42 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
+#Setup Green Hills MULTI specific compilation information
 
-#Setup Greenhills MULTI specific compilation information
-
-if (NOT GHS_INT_DIRECTORY)
-  #Assume the C:/ghs/int#### directory that is latest is preferred
-  set(GHS_EXPECTED_ROOT "C:/ghs")
-  if (EXISTS ${GHS_EXPECTED_ROOT})
-    FILE(GLOB GHS_CANDIDATE_INT_DIRS RELATIVE
-      ${GHS_EXPECTED_ROOT} ${GHS_EXPECTED_ROOT}/*)
-    string(REGEX MATCHALL  "int[0-9][0-9][0-9][0-9a-z]" GHS_CANDIDATE_INT_DIRS
-      ${GHS_CANDIDATE_INT_DIRS})
-    if (GHS_CANDIDATE_INT_DIRS)
-      list(SORT GHS_CANDIDATE_INT_DIRS)
-      list(GET GHS_CANDIDATE_INT_DIRS -1 GHS_INT_DIRECTORY)
-      string(CONCAT GHS_INT_DIRECTORY ${GHS_EXPECTED_ROOT} "/"
-        ${GHS_INT_DIRECTORY})
+set(GHS_OS_ROOT "C:/ghs" CACHE PATH "GHS platform OS search root directory")
+mark_as_advanced(GHS_OS_ROOT)
+
+set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory")
+mark_as_advanced(GHS_OS_DIR)
+
+#set GHS_OS_DIR if not set by user
+if ( NOT GHS_OS_DIR )
+  if (EXISTS ${GHS_OS_ROOT})
+
+    #get all directories in root directory
+    FILE(GLOB GHS_CANDIDATE_OS_DIRS
+      LIST_DIRECTORIES true RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*)
+    FILE(GLOB GHS_CANDIDATE_OS_FILES
+      LIST_DIRECTORIES false RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*)
+    if ( GHS_CANDIDATE_OS_FILES )
+      list(REMOVE_ITEM GHS_CANDIDATE_OS_DIRS ${GHS_CANDIDATE_OS_FILES})
     endif ()
-  endif ()
 
-  #Try to look for known registry values
-  if (NOT GHS_INT_DIRECTORY)
-    find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS
-      
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]"
 #int1122
-      
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]"
 #int1104
-      )
-  endif ()
+    #filter based on platform name
+    if (GHS_TARGET_PLATFORM STREQUAL "integrity")
+      list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX 
"int[0-9][0-9][0-9][0-9a-z].*")
+    endif ()
 
-  set(GHS_INT_DIRECTORY ${GHS_INT_DIRECTORY} CACHE PATH
-    "Path to integrity directory")
+    if (GHS_CANDIDATE_OS_DIRS)
+      list(SORT GHS_CANDIDATE_OS_DIRS)
+      list(GET GHS_CANDIDATE_OS_DIRS -1 GHS_OS_DIR)
+      string(CONCAT GHS_OS_DIR ${GHS_OS_ROOT} "/" ${GHS_OS_DIR})
+    endif()
+
+    set(GHS_OS_DIR "${GHS_OS_DIR}" CACHE PATH "GHS platform OS directory" 
FORCE)
+  endif ()
 endif ()
 
-set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory")
 set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name")
 set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization")
 mark_as_advanced(GHS_CUSTOMIZATION)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb77dc0cee95b2606ab6715aa9babc89c09d176f
commit bb77dc0cee95b2606ab6715aa9babc89c09d176f
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:21 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Wed Jul 11 08:44:49 2018 -0400

    GHS: Set primary target using arch/platform values (or user specified value)

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills 
MULTI.rst
index 7da93dd..7c2e643 100644
--- a/Help/generator/Green Hills MULTI.rst      
+++ b/Help/generator/Green Hills MULTI.rst      
@@ -19,6 +19,11 @@ Default to ``integrity``.
 Usual values are ``integrity``, ``threadx``, ``uvelosity``,
 ``velosity``, ``vxworks``, ``standalone``.
 
+* ``GHS_PRIMARY_TARGET``
+
+Sets ``primaryTarget`` field in project file.
+Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
+
 * ``GHS_TOOLSET_ROOT``
 
 Default to ``C:/ghs``.  Root path for ``toolset``.
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake 
b/Modules/Platform/GHS-MULTI-Initialize.cmake
index bf61d7b..0b7422c 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -33,7 +33,6 @@ if (NOT GHS_INT_DIRECTORY)
 endif ()
 
 set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory")
-set(GHS_PRIMARY_TARGET "arm_integrity.tgt" CACHE STRING "target for 
compilation")
 set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name")
 set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization")
 mark_as_advanced(GHS_CUSTOMIZATION)
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx 
b/Source/cmGlobalGhsMultiGenerator.cxx
index ddf8147..17fac41 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -335,8 +335,26 @@ void cmGlobalGhsMultiGenerator::WriteMacros()
 
 void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
 {
-  *this->GetBuildFileStream()
-    << "primaryTarget=arm_integrity.tgt" << std::endl;
+  /* set primary target */
+  std::string tgt;
+  const char* t =
+    this->GetCMakeInstance()->GetCacheDefinition("GHS_PRIMARY_TARGET");
+  if (t) {
+    tgt = t;
+    this->GetCMakeInstance()->MarkCliAsUsed("GHS_PRIMARY_TARGET");
+  } else {
+    const char* a =
+      this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
+    const char* p =
+      this->GetCMakeInstance()->GetCacheDefinition("GHS_TARGET_PLATFORM");
+    tgt = (a ? a : "");
+    tgt += "_";
+    tgt += (p ? p : "");
+    tgt += ".tgt";
+  }
+
+  *this->GetBuildFileStream() << "primaryTarget=" << tgt << std::endl;
+
   char const* const customization =
     this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
   if (NULL != customization && strlen(customization) > 0) {
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b389a13..bd81a84 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2256,7 +2256,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P 
${CMake_SOURCE_DIR}/Utilities/Release
         --build-generator "Green Hills MULTI"
         --build-project ReturnNum
         --build-config $<CONFIGURATION>
-        --build-options -DGHS_PRIMARY_TARGET="arm_integrity.tgt"
+        --build-options -DGHS_PRIMARY_TARGET=arm_integrity.tgt
         -DGHS_BSP_NAME="simarm"
         )
   endif ()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f80692cf600675bae4d12810c8119a62e76aa701
commit f80692cf600675bae4d12810c8119a62e76aa701
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:21 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Wed Jul 11 08:33:21 2018 -0400

    GHS: Add platform selection support

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills 
MULTI.rst
index daebfcd..7da93dd 100644
--- a/Help/generator/Green Hills MULTI.rst      
+++ b/Help/generator/Green Hills MULTI.rst      
@@ -13,6 +13,11 @@ The ``-T <toolset>`` can be supplied for setting the toolset 
to be used.
 All toolsets are expected to be located at ``GHS_TOOLSET_ROOT``.
 If the toolset is not specified then the latest toolset will be used.
 
+* ``GHS_TARGET_PLATFORM``
+
+Default to ``integrity``.
+Usual values are ``integrity``, ``threadx``, ``uvelosity``,
+``velosity``, ``vxworks``, ``standalone``.
 
 * ``GHS_TOOLSET_ROOT``
 
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx 
b/Source/cmGlobalGhsMultiGenerator.cxx
index c980746..ddf8147 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -127,6 +127,16 @@ bool 
cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
                            cmStateEnums::INTERNAL);
   }
 
+  const char* tgtPlatform = mf->GetDefinition("GHS_TARGET_PLATFORM");
+  if (tgtPlatform == nullptr) {
+    tgtPlatform = "integrity";
+  }
+
+  /* store the platform name for later use */
+  mf->AddCacheDefinition("GHS_TARGET_PLATFORM", tgtPlatform,
+                         "Name of GHS target platform.",
+                         cmStateEnums::INTERNAL);
+
   return true;
 }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a37a4a00c8b8982c89ffc99505de097d3b2d7300
commit a37a4a00c8b8982c89ffc99505de097d3b2d7300
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:21 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Wed Jul 11 08:28:36 2018 -0400

    GHS: Add toolset selection support
    
    -- Use the specified toolset located within GHS_TOOLSET_ROOT
    -- Update how the latest toolset is determined; scan the location 
GHS_TOOLSET_ROOT and sort it
       No longer use registry settings looking for installations
         The registry values are assigned in installation order for Green Hills 
tools not version order
    -- Update to use gbuild.exe from the proper toolset
    -- Clarify that CMAKE_MAKE_PROGRAM should not be set by user.
    -- Detect some toolset changes when regenerating project files
       This could occur if GHS_TOOLSET_ROOT was changed by user after the 
initial project generation
       This could occur if CMAKE_MAKE_PROGRAM was changed at the command line
    -- Use placeholder values for CMAKE_<LANG>_COMPILER
       The MULTI build system only uses gbuild to build a project
         gbuild uses the project file to determine which set of compilers to 
use based on target platform and architecture
         because compiler detection is skipped, placeholder values are used so 
that CMake does not complain

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills 
MULTI.rst
index 55fbab4..daebfcd 100644
--- a/Help/generator/Green Hills MULTI.rst      
+++ b/Help/generator/Green Hills MULTI.rst      
@@ -9,6 +9,15 @@ The ``-A <arch>`` can be supplied for setting the target 
architecture.
 ``<arch>`` usually is one of "arm", "ppc", "86", etcetera.  If the target 
architecture
 is not specified then the default architecture of "arm" will be used.
 
+The ``-T <toolset>`` can be supplied for setting the toolset to be used.
+All toolsets are expected to be located at ``GHS_TOOLSET_ROOT``.
+If the toolset is not specified then the latest toolset will be used.
+
+
+* ``GHS_TOOLSET_ROOT``
+
+Default to ``C:/ghs``.  Root path for ``toolset``.
+
 Customizations are available through the following cache variables:
 
 * ``GHS_BSP_NAME``
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst 
b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index 3220244..e9bc28b 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -18,6 +18,7 @@ Toolset specification is supported only on specific 
generators:
 
 * :ref:`Visual Studio Generators` for VS 2010 and above
 * The :generator:`Xcode` generator for Xcode 3.0 and above
+* The :generator:`Green Hills MULTI` generator
 
 See native build system documentation for allowed toolset names.
 
diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst 
b/Help/variable/CMAKE_MAKE_PROGRAM.rst
index a3b997a..4f5a50f 100644
--- a/Help/variable/CMAKE_MAKE_PROGRAM.rst
+++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst
@@ -55,9 +55,11 @@ to configure the project:
   the CMake cache then CMake will use the specified value if
   possible.
 
-* The :generator:`Green Hills MULTI` generator sets this to ``gbuild``.
-  If a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
-  the CMake cache then CMake will use the specified value.
+* The :generator:`Green Hills MULTI` generator sets this to the full
+  path to ``gbuild.exe`` based upon the toolset being used.
+
+  Once the generator has initialized a particular value for this
+  variable, changing the value has undefined behavior.
 
 The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
 The value is also used by the :manual:`cmake(1)` ``--build`` and
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx 
b/Source/cmGlobalGhsMultiGenerator.cxx
index 804a010..c980746 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -14,13 +14,13 @@
 #include "cmVersion.h"
 
 const char* cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj";
-const char* cmGlobalGhsMultiGenerator::DEFAULT_MAKE_PROGRAM = "gbuild";
+const char* cmGlobalGhsMultiGenerator::DEFAULT_BUILD_PROGRAM = "gbuild.exe";
+const char* cmGlobalGhsMultiGenerator::DEFAULT_TOOLSET_ROOT = "C:/ghs";
 
 cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake* cm)
   : cmGlobalGenerator(cm)
   , OSDirRelative(false)
 {
-  this->GhsBuildCommandInitialized = false;
 }
 
 cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator()
@@ -41,6 +41,76 @@ void 
cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry& entry)
     "Generates Green Hills MULTI files (experimental, work-in-progress).";
 }
 
+bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
+                                                    cmMakefile* mf)
+{
+  std::string tsp;      /* toolset path */
+  std::string tsn = ts; /* toolset name */
+
+  GetToolset(mf, tsp, tsn);
+
+  /* no toolset was found */
+  if (tsn.empty()) {
+    return false;
+  } else if (ts.empty()) {
+    std::string message;
+    message =
+      "Green Hills MULTI: -T <toolset> not specified; defaulting to \"";
+    message += tsn;
+    message += "\"";
+    cmSystemTools::Message(message.c_str());
+
+    /* store the toolset for later use
+     * -- already done if -T<toolset> was specified
+     */
+    mf->AddCacheDefinition("CMAKE_GENERATOR_TOOLSET", tsn.c_str(),
+                           "Name of generator toolset.",
+                           cmStateEnums::INTERNAL);
+  }
+
+  /* set the build tool to use */
+  const char* prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM");
+  std::string gbuild(tsp + "/" + tsn + "/" + DEFAULT_BUILD_PROGRAM);
+
+  /* check if the toolset changed from last generate */
+  if (prevTool != NULL && (gbuild != prevTool)) {
+    std::string message = "generator toolset: ";
+    message += gbuild;
+    message += "\nDoes not match the toolset used previously: ";
+    message += prevTool;
+    message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
+               "directory or choose a different binary directory.";
+    cmSystemTools::Error(message.c_str());
+  } else {
+    /* store the toolset that is being used for this build */
+    mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", gbuild.c_str(),
+                           "build program to use", cmStateEnums::INTERNAL,
+                           true);
+  }
+
+  mf->AddDefinition("CMAKE_SYSTEM_VERSION", tsn.c_str());
+
+  // FIXME: compiler detection not implemented
+  // gbuild uses the primaryTarget setting in the top-level project
+  // file to determine which compiler to use. Because compiler
+  // detection is not implemented these variables must be
+  // set to skip past these tests. However cmake will verify that
+  // the executable pointed to by CMAKE_<LANG>_COMPILER exists.
+  // To pass this additional check gbuild is used as a place holder for the
+  // actual compiler.
+  mf->AddDefinition("CMAKE_C_COMPILER", gbuild.c_str());
+  mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE");
+  mf->AddDefinition("CMAKE_C_COMPILER_ID", "GHS");
+  mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE");
+
+  mf->AddDefinition("CMAKE_CXX_COMPILER", gbuild.c_str());
+  mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE");
+  mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GHS");
+  mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE");
+
+  return true;
+}
+
 bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
                                                      cmMakefile* mf)
 {
@@ -65,127 +135,49 @@ void cmGlobalGhsMultiGenerator::EnableLanguage(
 {
   mf->AddDefinition("CMAKE_SYSTEM_NAME", "GHS-MULTI");
 
-  const std::string ghsCompRoot(GetCompRoot());
-  mf->AddDefinition("GHS_COMP_ROOT", ghsCompRoot.c_str());
-  std::string ghsCompRootStart =
-    0 == ghsCompRootStart.size() ? "" : ghsCompRoot + "/";
-  mf->AddDefinition("CMAKE_C_COMPILER",
-                    std::string(ghsCompRootStart + "ccarm.exe").c_str());
-  mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE");
-  mf->AddDefinition("CMAKE_C_COMPILER_ID", "GHS");
-  mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE");
-
-  mf->AddDefinition("CMAKE_CXX_COMPILER",
-                    std::string(ghsCompRootStart + "cxarm.exe").c_str());
-  mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE");
-  mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GHS");
-  mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE");
-
-  if (!ghsCompRoot.empty()) {
-    static const char* compPreFix = "comp_";
-    std::string compFilename =
-      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);
 }
 
-bool cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile* mf)
+bool 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"))) {
-    mf->AddDefinition("CMAKE_MAKE_PROGRAM",
-                      this->GetGhsBuildCommand().c_str());
-  }
+  // The GHS generator only knows how to lookup its build tool
+  // during generation of the project files, but this
+  // can only be done after the toolset is specified.
+
   return true;
 }
 
-std::string const& cmGlobalGhsMultiGenerator::GetGhsBuildCommand()
+void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
+                                           std::string& ts)
 {
-  if (!this->GhsBuildCommandInitialized) {
-    this->GhsBuildCommandInitialized = true;
-    this->GhsBuildCommand = this->FindGhsBuildCommand();
-  }
-  return this->GhsBuildCommand;
-}
+  const char* ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT");
 
-std::string cmGlobalGhsMultiGenerator::FindGhsBuildCommand()
-{
-  std::vector<std::string> userPaths;
-  userPaths.push_back(this->GetCompRoot());
-  std::string makeProgram =
-    cmSystemTools::FindProgram(DEFAULT_MAKE_PROGRAM, userPaths);
-  if (makeProgram.empty()) {
-    makeProgram = DEFAULT_MAKE_PROGRAM;
+  if (!ghsRoot) {
+    ghsRoot = DEFAULT_TOOLSET_ROOT;
   }
-  return makeProgram;
-}
+  tsd = ghsRoot;
 
-std::string cmGlobalGhsMultiGenerator::GetCompRoot()
-{
-  std::string output;
-
-  const std::vector<std::string> potentialDirsHardPaths(
-    GetCompRootHardPaths());
-  const std::vector<std::string> potentialDirsRegistry(GetCompRootRegistry());
-
-  std::vector<std::string> potentialDirsComplete;
-  potentialDirsComplete.insert(potentialDirsComplete.end(),
-                               potentialDirsHardPaths.begin(),
-                               potentialDirsHardPaths.end());
-  potentialDirsComplete.insert(potentialDirsComplete.end(),
-                               potentialDirsRegistry.begin(),
-                               potentialDirsRegistry.end());
-
-  // Use latest version
-  std::string outputDirName;
-  for (std::vector<std::string>::const_iterator potentialDirsCompleteIt =
-         potentialDirsComplete.begin();
-       potentialDirsCompleteIt != potentialDirsComplete.end();
-       ++potentialDirsCompleteIt) {
-    const std::string dirName(
-      cmsys::SystemTools::GetFilenameName(*potentialDirsCompleteIt));
-    if (dirName.compare(outputDirName) > 0) {
-      output = *potentialDirsCompleteIt;
-      outputDirName = dirName;
-    }
-  }
+  if (ts.empty()) {
+    std::vector<std::string> output;
 
-  return output;
-}
+    // Use latest? version
+    cmSystemTools::Glob(tsd, "comp_[^;]+", output);
 
-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 = "C:/ghs/" + *outputIt;
+    if (output.empty()) {
+      cmSystemTools::Error("GHS toolset not found in ", tsd.c_str());
+      ts = "";
+    } else {
+      ts = output.back();
+    }
+  } else {
+    std::string tryPath = tsd + std::string("/") + ts;
+    if (!cmSystemTools::FileExists(tryPath)) {
+      cmSystemTools::Error("GHS toolset \"", ts.c_str(), "\" not found in ",
+                           tsd.c_str());
+      ts = "";
+    }
   }
-  return output;
-}
-
-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]);
-  cmsys::SystemTools::ReadRegistryValue(
-    "HKEY_LOCAL_"
-    "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\"
-    "Windows\\CurrentVersion\\Uninstall\\"
-    "GreenHillsSoftware9881cef6;InstallLocation",
-    output[1]);
-  return output;
 }
 
 void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
@@ -293,8 +285,10 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
   const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
   int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
 {
+  const char* gbuild =
+    this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
   makeCommand.push_back(
-    this->SelectMakeProgram(makeProgram, this->GetGhsBuildCommand()));
+    this->SelectMakeProgram(makeProgram, (std::string)gbuild));
 
   if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
     makeCommand.push_back("-parallel");
diff --git a/Source/cmGlobalGhsMultiGenerator.h 
b/Source/cmGlobalGhsMultiGenerator.h
index dc98cdc..13c5113 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -49,6 +49,7 @@ public:
   static bool SupportsPlatform() { return true; }
 
   // Toolset / Platform Support
+  virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
   virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
 
   /**
@@ -96,11 +97,7 @@ protected:
     std::vector<std::string> const& makeOptions = std::vector<std::string>());
 
 private:
-  std::string const& GetGhsBuildCommand();
-  std::string FindGhsBuildCommand();
-  std::string GetCompRoot();
-  std::vector<std::string> GetCompRootHardPaths();
-  std::vector<std::string> GetCompRootRegistry();
+  void GetToolset(cmMakefile* mf, std::string& tsd, std::string& ts);
   void OpenBuildFileStream();
 
   void WriteMacros();
@@ -127,9 +124,8 @@ private:
   std::vector<std::string> LibDirs;
 
   bool OSDirRelative;
-  bool GhsBuildCommandInitialized;
-  std::string GhsBuildCommand;
-  static const char* DEFAULT_MAKE_PROGRAM;
+  static const char* DEFAULT_BUILD_PROGRAM;
+  static const char* DEFAULT_TOOLSET_ROOT;
 };
 
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d40d2b44fe93e223bd7802797b4cd430656790e
commit 5d40d2b44fe93e223bd7802797b4cd430656790e
Author:     Fred Baksik <froda...@gmail.com>
AuthorDate: Sat Jul 7 07:27:21 2018 -0400
Commit:     Fred Baksik <froda...@gmail.com>
CommitDate: Sat Jul 7 07:27:21 2018 -0400

    GHS: Support ARM, PPC, 86 architectures
    
    -- Update -A option to choose target architecture.
    -- Update commentary about which variables are used to control toolset and 
target settings
    -- Remove setting CMAKE_SYSTEM_PROCESSOR because the value is overwritten 
to be "" by subsequent CMAKE processing

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills 
MULTI.rst
index 4d31690..55fbab4 100644
--- a/Help/generator/Green Hills MULTI.rst      
+++ b/Help/generator/Green Hills MULTI.rst      
@@ -3,6 +3,12 @@ Green Hills MULTI
 
 Generates Green Hills MULTI project files (experimental, work-in-progress).
 
+Customizations that are used to pick toolset and target system:
+
+The ``-A <arch>`` can be supplied for setting the target architecture.
+``<arch>`` usually is one of "arm", "ppc", "86", etcetera.  If the target 
architecture
+is not specified then the default architecture of "arm" will be used.
+
 Customizations are available through the following cache variables:
 
 * ``GHS_BSP_NAME``
diff --git a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst 
b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
index 50412ff..963f0a4 100644
--- a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
@@ -19,6 +19,8 @@ Platform specification is supported only on specific 
generators:
 * For :ref:`Visual Studio Generators` with VS 2005 and above this
   specifies the target architecture.
 
+* For :generator:`Green Hills MULTI` this specifies the target architecture.
+
 See native build system documentation for allowed platform names.
 
 Visual Studio Platform Selection
diff --git a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst 
b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst
index 09280de..8ad89f1 100644
--- a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst
+++ b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst
@@ -6,5 +6,3 @@ The name of the CPU CMake is building for.
 This variable is the same as :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` if
 you build for the host system instead of the target system when
 cross compiling.
-
-* The :generator:`Green Hills MULTI` generator sets this to ``ARM`` by default.
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx 
b/Source/cmGlobalGhsMultiGenerator.cxx
index 1e104ee..804a010 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -41,11 +41,29 @@ void 
cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry& entry)
     "Generates Green Hills MULTI files (experimental, work-in-progress).";
 }
 
+bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
+                                                     cmMakefile* mf)
+{
+  if (p == "") {
+    cmSystemTools::Message(
+      "Green Hills MULTI: -A <arch> not specified; defaulting to \"arm\"");
+    std::string arch = "arm";
+
+    /* store the platform name for later use
+     * -- already done if -A<arch> was specified
+     */
+    mf->AddCacheDefinition("CMAKE_GENERATOR_PLATFORM", arch.c_str(),
+                           "Name of generator platform.",
+                           cmStateEnums::INTERNAL);
+  }
+
+  return true;
+}
+
 void cmGlobalGhsMultiGenerator::EnableLanguage(
   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());
diff --git a/Source/cmGlobalGhsMultiGenerator.h 
b/Source/cmGlobalGhsMultiGenerator.h
index ef1b66f..dc98cdc 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -40,13 +40,16 @@ public:
    * Utilized by the generator factory to determine if this generator
    * supports toolsets.
    */
-  static bool SupportsToolset() { return false; }
+  static bool SupportsToolset() { return true; }
 
   /**
    * Utilized by the generator factory to determine if this generator
    * supports platforms.
    */
-  static bool SupportsPlatform() { return false; }
+  static bool SupportsPlatform() { return true; }
+
+  // Toolset / Platform Support
+  virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
 
   /**
    * Try to determine system information such as shared library

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

Summary of changes:
 Help/generator/Green Hills MULTI.rst        |  40 +++-
 Help/release/dev/ghs.rst                    |  20 ++
 Help/variable/CMAKE_GENERATOR_PLATFORM.rst  |   2 +
 Help/variable/CMAKE_GENERATOR_TOOLSET.rst   |   1 +
 Help/variable/CMAKE_MAKE_PROGRAM.rst        |   8 +-
 Help/variable/CMAKE_SYSTEM_PROCESSOR.rst    |   2 -
 Modules/Compiler/QCC.cmake                  |   2 +
 Modules/Platform/GHS-MULTI-Initialize.cmake |  60 +++---
 Source/cmGlobalGhsMultiGenerator.cxx        | 273 ++++++++++++++++------------
 Source/cmGlobalGhsMultiGenerator.h          |  19 +-
 Tests/CMakeLists.txt                        |   2 +-
 11 files changed, 268 insertions(+), 161 deletions(-)
 create mode 100644 Help/release/dev/ghs.rst


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to