[Cmake-commits] CMake branch, master, updated. v3.13.3-981-ga61c061

Kitware Robot kwrobot at kitware.com
Fri Jan 18 07:03:07 EST 2019


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  a61c061b6143cb6d8920b1b5796a867c0f104556 (commit)
       via  65a3abf999b30117447c2e62581fbcaec56aadd9 (commit)
       via  2e7d4029f42430ac7339d15ae7b6f849b0f7e429 (commit)
       via  1c08652580ce3641f38f173074215bb12705ce63 (commit)
       via  00c7e006a5554911986ec4afe8b03e929d7b72e2 (commit)
       via  21ab58d3f8782e80145f14eb6e72926c9d17afc6 (commit)
       via  72e0c115b771fe9e3f4b5a5b6bd3bcdade77a7cb (commit)
       via  436cc5e991c7be07610d7902a5ce2a00221ca0a2 (commit)
       via  4a1ec0de3d2102918284eff13763f2aa3d20d119 (commit)
       via  1a66acdef268865e5816bd56176274034769b1b5 (commit)
       via  0c9e47d7cdb498f9bc29231587030e0840c9f00c (commit)
       via  80443184317e97999da63d71549aa1b89997dc3d (commit)
       via  73092b2213495e06ef2ecfbf5fcca850874d6c88 (commit)
       via  14f3ba205989a422f1668073a325b057cece0b32 (commit)
       via  702121c5f3eceeb6b74ede845f1e1297cf113c47 (commit)
       via  b2a72ec72d609547d2278701a56237822c0dcc92 (commit)
       via  595932c4f0570ab6bdef0a50a321877ffa9c50e4 (commit)
       via  2ed2d6b46f9fb8f0742ce60bef16f1d636008136 (commit)
       via  ead7117afda23d7cf0c1466ce5229d06240d3de0 (commit)
       via  e7825386e2e9e69728e5a5c3dcbc94814bb7cb1c (commit)
       via  447b57a2676b5bb7e9f97b15c9fe5fe7d3817a86 (commit)
       via  6436080996ae6f2482fdeefcc639dc36fefedfd8 (commit)
       via  5cef3c61fc815393248762c14ba1878aae68394d (commit)
       via  a42e40e78dc3d9c4289a3c9640cae94ecd034373 (commit)
      from  92d132100a0097c867eaa73f4bcca59670cca4f3 (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=a61c061b6143cb6d8920b1b5796a867c0f104556
commit a61c061b6143cb6d8920b1b5796a867c0f104556
Merge: 65a3abf 1c08652
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 18 12:01:55 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 18 07:02:01 2019 -0500

    Merge topic 'automoc-test-in-place'
    
    1c08652580 Tests: Fix Qt4And5Automoc tests to work on in-source build
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2817


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65a3abf999b30117447c2e62581fbcaec56aadd9
commit 65a3abf999b30117447c2e62581fbcaec56aadd9
Merge: 2e7d402 21ab58d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 18 11:58:23 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 18 06:58:35 2019 -0500

    Merge topic 'GHS_updates'
    
    21ab58d3f8 GHS: Update test suite
    72e0c115b7 GHS: Add Compiler ID detection
    436cc5e991 GHS: try_compile() now uses GHS platform variables
    4a1ec0de3d GHS: Fix toolset selection
    1a66acdef2 GHS: Append ".gpj" to target name when generating build command
    0c9e47d7cd GHS: Integrity Application updates
    8044318431 GHS: Add support for some of the source file properties
    73092b2213 GHS: Add support for object libraries
    ...
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2231


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e7d4029f42430ac7339d15ae7b6f849b0f7e429
commit 2e7d4029f42430ac7339d15ae7b6f849b0f7e429
Merge: 92d1321 00c7e00
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 18 11:55:46 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 18 06:55:52 2019 -0500

    Merge topic 'remove-duplicate-link'
    
    00c7e006a5 Help: Remove duplicate reference to IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2818


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c08652580ce3641f38f173074215bb12705ce63
commit 1c08652580ce3641f38f173074215bb12705ce63
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 17 10:15:44 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 17 12:58:41 2019 -0500

    Tests: Fix Qt4And5Automoc tests to work on in-source build
    
    Use a distinctly-named build directory for each case so that neither
    one uses its own source tree as the build tree.
    
    Fixes: #18159

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6b166d6..e9b497f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1362,18 +1362,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets")
 
     if(Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0)
-      add_test(Qt4And5Automoc ${CMAKE_CTEST_COMMAND}
+      add_test(Qt4And5AutomocForward ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc"
-        "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc"
+        "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward"
         ${build_generator_args}
         --build-project Qt4And5Automoc
-        --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc"
+        --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward"
         --force-new-ctest-process
         --build-options ${build_options}
         --test-command ${CMAKE_CTEST_COMMAND} -V
         )
-      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc")
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward")
       add_test(Qt4And5AutomocReverse ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00c7e006a5554911986ec4afe8b03e929d7b72e2
commit 00c7e006a5554911986ec4afe8b03e929d7b72e2
Author:     Kyle Edwards <kyle.edwards at kitware.com>
AuthorDate: Thu Jan 17 10:21:25 2019 -0500
Commit:     Kyle Edwards <kyle.edwards at kitware.com>
CommitDate: Thu Jan 17 10:21:25 2019 -0500

    Help: Remove duplicate reference to IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index df8f12c..4a25878 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -204,7 +204,6 @@ Properties on Targets
    /prop_tgt/IMPORTED_LIBNAME_CONFIG
    /prop_tgt/IMPORTED_LIBNAME
    /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
-   /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
    /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES
    /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG
    /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21ab58d3f8782e80145f14eb6e72926c9d17afc6
commit 21ab58d3f8782e80145f14eb6e72926c9d17afc6
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Tue Jan 8 23:52:12 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:42:08 2019 -0500

    GHS: Update test suite
    
    -- Allow for testing default toolset settings
       If CMake_TEST_GreenHillsMULTI_config is not defined then
       just run the GHS tests using defaults.
    -- Handle paths that contain spaces
    -- Update test suite to use "-non_shared" linker option
       Fixes linking issue if GHS is not shipped with shared libraries
    -- Other minor cleanup

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 4588901..19605e4 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -532,6 +532,7 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
     }
   }
 }
+
 void cmGhsMultiTargetGenerator::WriteReferences(std::ostream& fout)
 {
   // This only applies to INTEGRITY Applications
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 87bd27e..d78811d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2260,11 +2260,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
   endif()
 
   if (CMake_TEST_GreenHillsMULTI)
-    macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts test_cmd)
-      separate_arguments(_build_opts UNIX_COMMAND ${build_opts})
-      separate_arguments(_test_cmd UNIX_COMMAND ${test_cmd})
+    macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts)
+      separate_arguments(_ghs_build_opts UNIX_COMMAND ${build_opts})
       separate_arguments(_ghs_toolset_extra UNIX_COMMAND ${ghs_toolset_extra})
-      add_test(NAME GhsMulti.${ghs_config_name}.${test_name}
+      if(${ARGC} GREATER 4)
+        set(_ghs_test_command --test-command ${ARGN})
+      endif()
+      if(ghs_config_name STREQUAL "__default__")
+        set(_ghs_test_name "${test_name}")
+      else()
+        set(_ghs_test_name "${ghs_config_name}.${test_name}")
+      endif()
+      add_test(NAME GhsMulti.${_ghs_test_name}
         COMMAND ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/GhsMulti/${test_dir}"
@@ -2273,51 +2280,71 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
         --build-project test
         --build-config $<CONFIGURATION>
         --build-options ${ghs_target_arch} ${ghs_toolset_name} ${ghs_toolset_root} ${ghs_target_platform}
-          ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_build_opts} ${_ghs_toolset_extra}
-        --test-command ${_test_cmd}
+          ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_ghs_build_opts} ${_ghs_toolset_extra}
+          ${_ghs_test_command}
         )
-    endmacro ()
+        unset(_ghs_build_opts)
+        unset(_ghs_toolset_extra)
+        unset(_ghs_test_command)
+        unset(_ghs_test_name)
+    endmacro()
     macro(add_test_GhsMulti_rename_install test_name)
       add_test_GhsMulti( ${test_name} GhsMultiRenameInstall ${test_name}
-        "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" "${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake")
-    endmacro ()
+        "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" ${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake)
+    endmacro()
+    #unset ghs config variables
+    unset(ghs_config_name)
+    unset(ghs_target_arch)
+    unset(ghs_toolset_root)
+    unset(ghs_toolset_name)
+    unset(ghs_os_root)
+    unset(ghs_os_dir)
+    unset(ghs_target_platform)
+    unset(ghs_bsp_name)
+    unset(ghs_toolset_extra)
+    if(NOT CMake_TEST_GreenHillsMULTI_config)
+      #if list of config settings not defined then just run once as default
+      set(CMake_TEST_GreenHillsMULTI_config "__default__")
+    endif()
     foreach(ghs_file IN LISTS CMake_TEST_GreenHillsMULTI_config)
       # source GHS tools config file
-      if(IS_ABSOLUTE ${ghs_file})
-        include(${ghs_file})
-      else()
-        include(${CMAKE_BINARY_DIR}/${ghs_file})
+      if(NOT ghs_file STREQUAL "__default__")
+        if(IS_ABSOLUTE ${ghs_file})
+          include(${ghs_file})
+        else()
+          include(${CMAKE_BINARY_DIR}/${ghs_file})
+        endif()
+      endif()
+      if(NOT ghs_config_name)
+        set(ghs_config_name "__default__")
       endif()
       # test integrity build
       if (NOT ghs_skip_integrity AND (NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity"))
-        add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "" "")
-        add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "" "")
-        add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "" "")
-      endif ()
-      add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "" "")
+        add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "")
+        add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "")
+        add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "")
+      endif()
+      add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "")
       add_test_GhsMulti_rename_install(SINGLE_EXEC)
       add_test_GhsMulti_rename_install(SINGLE_EXEC_RENAMED)
       add_test_GhsMulti_rename_install(EXEC_AND_LIB)
-      add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "" "")
-      add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON" "")
-      add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON" "")
-      add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "" "")
-      set_tests_properties(GhsMulti.${ghs_config_name}.unsupported_targets PROPERTIES TIMEOUT 15)
-      add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "" "")
-      set_tests_properties(GhsMulti.${ghs_config_name}.object_library PROPERTIES TIMEOUT 15)
+      add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "")
+      add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON")
+      add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON")
+      add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "")
+      add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "")
       add_test_GhsMulti(exclude GhsMultiExclude "" ""
-        "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake")
-      add_test_GhsMulti(interface GhsMultiInterface "" "" "")
-      set_tests_properties(GhsMulti.${ghs_config_name}.interface PROPERTIES TIMEOUT 15)
-      add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS" "")
-      add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS" "")
-      add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "" "")
+        ${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake)
+      add_test_GhsMulti(interface GhsMultiInterface "" "")
+      add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS")
+      add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS")
+      add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "")
       add_test_GhsMulti(multiple_projects GhsMultiMultipleProjects "" ""
-        "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake")
-      add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"" "")
-      add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" "")
-      add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "" "")
-      add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "" "")
+        ${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake)
+      add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"")
+      add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG")
+      add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "")
+      add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "")
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
       #unset ghs config variables
       unset(ghs_config_name)
@@ -2329,8 +2356,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
       unset(ghs_target_platform)
       unset(ghs_bsp_name)
       unset(ghs_toolset_extra)
-    endforeach(ghs_file)
-  endif ()
+    endforeach()
+  endif()
 
   if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
     macro(add_test_VSNsightTegra name generator)
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
index d425631..fc24d90 100644
--- a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
@@ -5,24 +5,28 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project(test C)
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  add_link_options("-non_shared")
+endif()
+
 if(RUN_TEST STREQUAL "RELEASE_FLAGS")
-#RELEASE flags used when CMAKE_BUILD_TYPE is undefined
-string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
-add_executable(test_none test.c)
+  #RELEASE flags used when CMAKE_BUILD_TYPE is undefined
+  string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
+  add_executable(test_none test.c)
 endif()
 
 if(RUN_TEST STREQUAL "KERNEL_FLAGS")
-#DEBUG flag missing when -kernel is added as a compile option
-string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
+  #DEBUG flag missing when -kernel is added as a compile option
+  string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
 
-add_executable(K1 test.c)
+  add_executable(K1 test.c)
 
-add_executable(K2 test.c)
-target_compile_options(K2 PRIVATE -kernel)
+  add_executable(K2 test.c)
+  target_compile_options(K2 PRIVATE -kernel)
 
-add_executable(K3 test.c)
-target_compile_options(K3 PRIVATE -kernel=fast)
+  add_executable(K3 test.c)
+  target_compile_options(K3 PRIVATE -kernel=fast)
 
-add_executable(K4 test.c)
-target_link_options(K4 PRIVATE -kernel)
+  add_executable(K4 test.c)
+  target_link_options(K4 PRIVATE -kernel)
 endif()
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
index 520e65f..a1f152f 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
@@ -12,6 +12,6 @@ add_library(libdemo
 
 add_executable(demo main.c)
 target_link_libraries(demo libdemo)
-if(GHSMULTI)
-    target_compile_options(demo PUBLIC "-non_shared")
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  target_link_options(demo PRIVATE "-non_shared")
 endif()
diff --git a/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
index 329cb3f..0448cf2 100644
--- a/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
@@ -5,6 +5,10 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project(test C)
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  add_link_options("-non_shared")
+endif()
+
 add_library(lib1 lib1.c)
 set_target_properties( lib1 PROPERTIES EXCLUDE_FROM_ALL yes )
 
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
index 3d0642d..d4cbf04 100644
--- a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project(test C)
 
+add_link_options("-non_shared")
+
 # create virtual AS
 add_executable(vas exe.c)
 target_link_libraries(vas lib)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
index 741fece..c5db155 100644
--- a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
@@ -3,6 +3,8 @@
 
 cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
+add_link_options("-non_shared")
+
 project(test C)
 
 # create virtual AS
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
index dfb72ce..da80b51 100644
--- a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
@@ -37,7 +37,7 @@ if (RUN_TEST STREQUAL "NO_FLAGS")
   endif()
 else()
   unset(fileName CACHE)
-  find_file (fileName exe1.gpj
+  find_file(fileName exe1.gpj
     ${CMAKE_CURRENT_BINARY_DIR}/link_build
     ${CMAKE_CURRENT_BINARY_DIR}/link_build/exe1
     )
@@ -50,12 +50,12 @@ else()
     -lcsl1 csl2
     -clinkexe1 -clinkexe2
     -special-lib2-public-link)
-  foreach( opt IN LISTS expected_flags )
+  foreach(opt IN LISTS expected_flags)
     string(FIND "${fileText}" "${opt}" opt_found)
     if ( opt_found EQUAL -1 )
       message(SEND_ERROR "Could not find: ${opt}")
     endif()
-  endforeach(opt)
+  endforeach()
 
   unset(fileName CACHE)
   find_file (fileName lib1.gpj
@@ -67,12 +67,12 @@ else()
   set(expected_flags
     -clinkexeA1 -clinkexeA2
     -static-lib-flags1 -static-lib-flags2)
-  foreach( opt IN LISTS expected_flags )
+  foreach(opt IN LISTS expected_flags)
     string(FIND "${fileText}" "${opt}" opt_found)
-    if ( opt_found EQUAL -1 )
+    if (opt_found EQUAL -1)
       message(SEND_ERROR "Could not find: ${opt}")
     endif()
-  endforeach(opt)
+  endforeach()
 
   unset(fileName CACHE)
   find_file (fileName lib2.gpj
@@ -83,10 +83,10 @@ else()
   file(STRINGS ${fileName} fileText)
   set(expected_flags
     -clinkexeA1 -clinkexeA2)
-  foreach( opt IN LISTS expected_flags )
+  foreach(opt IN LISTS expected_flags)
     string(FIND "${fileText}" "${opt}" opt_found)
     if ( opt_found EQUAL -1 )
       message(SEND_ERROR "Could not find: ${opt}")
     endif()
-  endforeach(opt)
+  endforeach()
 endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
index 4cf86a2..58c2115 100644
--- a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
@@ -5,31 +5,39 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project(test C)
 
-if( RUN_TEST STREQUAL "CHECK_FLAGS" )
-add_link_options(-add-link-options1 -add-link-options2)
-link_directories(link_directories_used1 link_directories_used2 "c:/absolute")
-link_libraries(link_libraries_used1 link_libraries_used2 )
-set( CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcsl1 csl2" )
-set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -clinkexe1 -clinkexe2")
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  add_link_options("-non_shared")
+endif()
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+  add_link_options(-add-link-options1 -add-link-options2)
+  link_directories(link_directories_used1 link_directories_used2 "c:/absolute")
+  link_libraries(link_libraries_used1 link_libraries_used2 )
+  set( CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcsl1 csl2" )
+  set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -clinkexe1 -clinkexe2")
 endif()
 
 add_executable(exe1 exe1.c)
 target_link_libraries(exe1 lib1)
-if( RUN_TEST STREQUAL "CHECK_FLAGS" )
-set_property( TARGET exe1 APPEND_STRING PROPERTY LINK_FLAGS "--link-flag-prop1 --link-flag-prop2")
-set_property( TARGET exe1 APPEND PROPERTY LINK_OPTIONS --link-opt-prop1 --link-opt-prop2)
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+  set_property(TARGET exe1 APPEND_STRING PROPERTY LINK_FLAGS "--link-flag-prop1 --link-flag-prop2")
+  set_property(TARGET exe1 APPEND PROPERTY LINK_OPTIONS --link-opt-prop1 --link-opt-prop2)
 endif()
 
-if( RUN_TEST STREQUAL "CHECK_FLAGS" )
-set( CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} "-clinkexeA1 -clinkexeA2")
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+  set(CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} "-clinkexeA1 -clinkexeA2")
 endif()
+
 add_library(lib1 STATIC func2.c func3.c func4.c)
 target_link_libraries(lib1 lib2)
-if( RUN_TEST STREQUAL "CHECK_FLAGS" )
-set_property( TARGET lib1 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS "-static-lib-flags1 -static-lib-flags2")
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+  set_property(TARGET lib1 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS "-static-lib-flags1 -static-lib-flags2")
 endif()
 
 add_library(lib2 STATIC func5.c func6.c func7.c)
-if( RUN_TEST STREQUAL "CHECK_FLAGS" )
-target_link_options(lib2 PUBLIC -special-lib2-public-link)
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+  target_link_options(lib2 PUBLIC -special-lib2-public-link)
 endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
index 55f693d..f49e33d 100644
--- a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
@@ -7,3 +7,6 @@ project(test C)
 
 add_executable(exe1 exe1.c)
 target_link_libraries(exe1 lib1)
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  target_link_options(exe1 PRIVATE "-non_shared")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
index d01c4d2..9e077a9 100644
--- a/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
@@ -5,6 +5,10 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project(test C)
 
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  add_link_options("-non_shared")
+endif()
+
 add_library(lib1 lib1.c)
 add_executable(exe1 exe1.c)
 target_link_libraries(exe1 lib1)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
index e00cbb3..3855215 100644
--- a/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
@@ -3,13 +3,13 @@
 
 #test project was generated
 unset(fileName CACHE)
-find_file (fileName lib3.gpj
+find_file(fileName lib3.gpj
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}/lib3
   ${CMAKE_CURRENT_BINARY_DIR}/examples
   )
 
-if ( fileName )
+if (fileName)
   message("Found target lib3: ${fileName}")
 else()
   message(SEND_ERROR "Could not find target lib3: ${fileName}")
@@ -23,7 +23,7 @@ find_file (fileName exe3.gpj
   ${CMAKE_CURRENT_BINARY_DIR}/examples
   )
 
-if ( fileName )
+if (fileName)
   message("Found target exe3: ${fileName}")
 else()
   message(SEND_ERROR "Could not find target exe3: ${fileName}")
@@ -37,7 +37,7 @@ find_file (fileName lib3.a
   ${CMAKE_CURRENT_BINARY_DIR}/examples
   )
 
-if ( fileName )
+if (fileName)
   message(SEND_ERROR "Found target lib3: ${fileName}")
 else()
   message("Could not find target lib3: ${fileName}")
@@ -51,7 +51,7 @@ find_file (fileName NAMES exe3.as exe3
   ${CMAKE_CURRENT_BINARY_DIR}/examples
   )
 
-if ( fileName )
+if (fileName)
   message(SEND_ERROR "Found target exe3: ${fileName}")
 else()
   message("Could not find target exe3: ${fileName}")
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt b/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
index 7fe91bc..a025814 100644
--- a/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
@@ -8,3 +8,6 @@ project(test C)
 add_library(obj1 OBJECT testObj.c testObj.h sub/testObj.c testObj2.c)
 
 add_executable(exe1 exe.c $<TARGET_OBJECTS:obj1>)
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  target_link_options(exe1 PRIVATE "-non_shared")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt b/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
index 222aa17..b177887 100644
--- a/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
@@ -5,9 +5,12 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project(test)
 
+message("PLATFORM_ID = ${PLATFORM_ID}")
+
 message("CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}")
 message("CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}")
 message("CMAKE_C_COMPILER_VERSION = ${CMAKE_C_COMPILER_VERSION}")
+message("CMAKE_C_COMPILER_VERSION_INTERNAL = ${CMAKE_C_COMPILER_VERSION_INTERNAL}")
 message("CMAKE_C_PLATFORM_ID = ${CMAKE_C_PLATFORM_ID}")
 message("CMAKE_C_COMPILER_ARCHITECTURE_ID = ${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
 message("CMAKE_C_COMPILER_ABI = ${CMAKE_C_COMPILER_ABI}")
@@ -16,6 +19,7 @@ message("CMAKE_C_STANDARD_COMPUTED_DEFAULT = ${CMAKE_C_STANDARD_COMPUTED_DEFAULT
 message("CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
 message("CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
 message("CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
+message("CMAKE_CXX_COMPILER_VERSION_INTERNAL = ${CMAKE_CXX_COMPILER_VERSION_INTERNAL}")
 message("CMAKE_CXX_PLATFORM_ID = ${CMAKE_CXX_PLATFORM_ID}")
 message("CMAKE_CXX_COMPILER_ARCHITECTURE_ID = ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
 message("CMAKE_CXX_COMPILER_ABI = ${CMAKE_CXX_COMPILER_ABI}")
diff --git a/Tests/GhsMulti/GhsMultiPlatform/file1.c b/Tests/GhsMulti/GhsMultiPlatform/file1.c
index 6f7c837..4132aa4 100644
--- a/Tests/GhsMulti/GhsMultiPlatform/file1.c
+++ b/Tests/GhsMulti/GhsMultiPlatform/file1.c
@@ -1,6 +1,4 @@
-#include <stdio.h>
-
 int main(void)
 {
-  printf("Testing...\n");
+  return -42;
 }
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt b/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
index f10b2f0..f5792b4 100644
--- a/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
@@ -7,29 +7,33 @@ project(test C)
 
 set(targets_to_install "")
 
-if( RUN_TEST STREQUAL "SINGLE_EXEC" )
-add_executable(exe1 exe.c)
-set(targets_to_install ${targets_to_install} exe1)
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  add_link_options("-non_shared")
 endif()
 
-if( RUN_TEST STREQUAL "SINGLE_EXEC_RENAMED" )
-set(name new_name)
-add_executable(exe1 exe.c)
-set_property(TARGET exe1 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${name}_bin_$<CONFIG>)
-set_property(TARGET exe1 PROPERTY OUTPUT_NAME ${name}_$<CONFIG>)
-set_property(TARGET exe1 PROPERTY SUFFIX .bin)
-set(targets_to_install ${targets_to_install} exe1)
+if(RUN_TEST STREQUAL "SINGLE_EXEC")
+  add_executable(exe1 exe.c)
+  set(targets_to_install ${targets_to_install} exe1)
 endif()
 
-if( RUN_TEST STREQUAL "EXEC_AND_LIB" )
-add_library(lib1 lib1.c)
-set_property(TARGET lib1 PROPERTY ARCHIVE_OUTPUT_DIRECTORY forced-$<CONFIG>)
-set_property(TARGET lib1 PROPERTY SUFFIX .LL)
-set_property(TARGET lib1 PROPERTY OUTPUT_NAME lib1_$<CONFIG>)
+if(RUN_TEST STREQUAL "SINGLE_EXEC_RENAMED")
+  set(name new_name)
+  add_executable(exe1 exe.c)
+  set_property(TARGET exe1 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${name}_bin_$<CONFIG>)
+  set_property(TARGET exe1 PROPERTY OUTPUT_NAME ${name}_$<CONFIG>)
+  set_property(TARGET exe1 PROPERTY SUFFIX .bin)
+  set(targets_to_install ${targets_to_install} exe1)
+endif()
+
+if(RUN_TEST STREQUAL "EXEC_AND_LIB")
+ add_library(lib1 lib1.c)
+ set_property(TARGET lib1 PROPERTY ARCHIVE_OUTPUT_DIRECTORY forced-$<CONFIG>)
+ set_property(TARGET lib1 PROPERTY SUFFIX .LL)
+ set_property(TARGET lib1 PROPERTY OUTPUT_NAME lib1_$<CONFIG>)
 
-add_executable(exe1 exe1.c)
-target_link_libraries(exe1 lib1)
-set(targets_to_install ${targets_to_install} exe1 lib1)
+ add_executable(exe1 exe1.c)
+ target_link_libraries(exe1 lib1)
+ set(targets_to_install ${targets_to_install} exe1 lib1)
 endif()
 
 install(TARGETS ${targets_to_install}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
index a4f84ca..93a1afc 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
@@ -35,6 +35,9 @@ add_executable(groups
 if(TEST_PROP)
   set_target_properties(groups PROPERTIES GHS_NO_SOURCE_GROUP_FILE ON)
 endif()
+if(CMAKE_C_COMPILER_ID MATCHES "GHS")
+  target_link_options(groups PRIVATE "-non_shared")
+endif()
 source_group( gC FILES sub/testOBJ.h testOBJ.c testOBJ.h sub/testOBJ.c )
 source_group( gA FILES test1.c test1.h)
 source_group( gB test[65].c )
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule b/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
index 8b13789..c6cac69 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
@@ -1 +1 @@
-
+empty
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/object.o b/Tests/GhsMulti/GhsMultiSrcGroups/object.o
index 8b13789..c6cac69 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/object.o
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/object.o
@@ -1 +1 @@
-
+empty
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf b/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
index 8b13789..e69de29 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
@@ -1 +0,0 @@
-

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72e0c115b771fe9e3f4b5a5b6bd3bcdade77a7cb
commit 72e0c115b771fe9e3f4b5a5b6bd3bcdade77a7cb
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Tue Jan 8 23:52:12 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:42:04 2019 -0500

    GHS: Add Compiler ID detection
    
    -- Detect GHS compiler and version
       Detect ARCHITECTURE_ID for PPC / ARM / 86 targets
       Detect PLATFORM_ID for Integrity and Integrity178 platforms
       Using defines specified in the documents for the compilers: 201416 PPC / 201754 ARM / 201714 86
    -- Fallback C/CXX compiler ID to GHS if not otherwise detected and using GHS MULTI generator
       Works around issue with some GHS compilers not setting __ghs__ compiler define
    -- Tweak Compiler ID checking so major id of 002017 is not replaced with 217
    -- Prefer try_compile() library targets when testing for working GHS compilers
    -- Avoid CMake errors if reading past end of file for checking if file is PE executable

diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 2264269..033e81c 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -19,6 +19,7 @@ include:
   Embarcadero, Borland = Embarcadero (embarcadero.com)
   G95 = G95 Fortran (g95.org)
   GNU = GNU Compiler Collection (gcc.gnu.org)
+  GHS = Green Hills Software (www.ghs.com)
   HP = Hewlett-Packard Compiler (hp.com)
   IAR = IAR Systems (iar.com)
   Intel = Intel Compiler (intel.com)
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index 9b2a91f..4d0c681 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -63,6 +63,7 @@ function(compiler_id_detection outvar lang)
       Cray
       TI
       Fujitsu
+      GHS
     )
     if (lang STREQUAL C)
       list(APPEND ordered_compilers
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 1a0d8a6..4f355f3 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -31,6 +31,7 @@ if(NOT CMAKE_C_COMPILER_NAMES)
 endif()
 
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
 elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
   set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c)
   _cmake_find_compiler_path(C)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 0a0c37b..96b4209 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -30,6 +30,7 @@ if(NOT CMAKE_CXX_COMPILER_NAMES)
 endif()
 
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
 elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
   set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp)
   _cmake_find_compiler_path(CXX)
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 604ac27..d88f2ed 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -7,6 +7,7 @@
 # code.
 
 include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(CMakeTestCompilerCommon)
 
 function(CMAKE_DETERMINE_COMPILER_ABI lang src)
   if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED)
@@ -23,6 +24,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
       # from which we might detect implicit link libraries.
       list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
     endif()
+    __TestCompiler_setTryCompileTargetType()
     try_compile(CMAKE_${lang}_ABI_COMPILED
       ${CMAKE_BINARY_DIR} ${src}
       CMAKE_FLAGS ${CMAKE_FLAGS}
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index f987d9a..2a0dbd3 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -52,6 +52,13 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
     endforeach()
   endif()
 
+  # If the compiler is still unknown, fallback to GHS
+  if(NOT CMAKE_${lang}_COMPILER_ID  AND "${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
+    set(CMAKE_${lang}_COMPILER_ID GHS)
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+        "The ${lang} compiler identification is falling back to GHS.\n\n")
+  endif()
+
   # CUDA < 7.5 is missing version macros
   if(lang STREQUAL "CUDA"
      AND CMAKE_${lang}_COMPILER_ID STREQUAL "NVIDIA"
@@ -391,6 +398,40 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
       separate_arguments(CMAKE_${lang}_XCODE_ARCHS)
       set(CMAKE_${lang}_XCODE_ARCHS "${CMAKE_${lang}_XCODE_ARCHS}" PARENT_SCOPE)
     endif()
+  elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
+    set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
+    set(id_src "${src}")
+    if (GHS_PRIMARY_TARGET)
+      set(ghs_primary_target "${GHS_PRIMARY_TARGET}")
+    else()
+      set(ghs_primary_target "${CMAKE_GENERATOR_PLATFORM}_${GHS_TARGET_PLATFORM}.tgt")
+    endif()
+    if ("${GHS_TARGET_PLATFORM}" MATCHES "integrity")
+        set(bsp_name "macro GHS_BSP=${GHS_BSP_NAME}")
+        set(os_dir "macro GHS_OS=${GHS_OS_DIR}")
+    endif()
+    set(command "${CMAKE_MAKE_PROGRAM}" "-commands" "-top" "GHS_default.gpj")
+    configure_file(${CMAKE_ROOT}/Modules/CompilerId/GHS_default.gpj.in
+      ${id_dir}/GHS_default.gpj @ONLY)
+    configure_file(${CMAKE_ROOT}/Modules/CompilerId/GHS_lib.gpj.in
+      ${id_dir}/GHS_lib.gpj @ONLY)
+    execute_process(COMMAND ${command}
+      WORKING_DIRECTORY ${id_dir}
+      OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+      ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+      RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
+      )
+    # Match the compiler location line printed out.
+    set(ghs_toolpath "${CMAKE_MAKE_PROGRAM}")
+    string(REPLACE "/gbuild.exe" "/" ghs_toolpath ${ghs_toolpath})
+    string(REPLACE / "\\\\" ghs_toolpath ${ghs_toolpath})
+    if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "(${ghs_toolpath}[^ ]*)")
+      set(_comp "${CMAKE_MATCH_1}.exe")
+      if(EXISTS "${_comp}")
+        file(TO_CMAKE_PATH "${_comp}" _comp)
+        set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
+      endif()
+    endif()
   else()
     execute_process(
       COMMAND "${CMAKE_${lang}_COMPILER}"
@@ -550,7 +591,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
         set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
       endif()
       if("${info}" MATCHES "INFO:compiler_version\\[([^]\"]*)\\]")
-        string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
+        string(REGEX REPLACE "^0+([0-9]+)" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
         string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
       endif()
       if("${info}" MATCHES "INFO:compiler_version_internal\\[([^]\"]*)\\]")
@@ -602,26 +643,28 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
     if(WIN32)
       # The offset to the PE signature is stored at 0x3c.
       file(READ ${file} peoffsethex LIMIT 1 OFFSET 60 HEX)
-      string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1)
-      string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2)
-      set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}")
-      string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}")
-      string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}")
-      string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}")
-      string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}")
-      string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}")
-      string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}")
-      math(EXPR peoffset "${peoffsetexpression}")
-
-      file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX)
-      if(peheader STREQUAL "50450000a201")
-        set(ARCHITECTURE_ID "SH3")
-      elseif(peheader STREQUAL "50450000a301")
-        set(ARCHITECTURE_ID "SH3DSP")
-      elseif(peheader STREQUAL "50450000a601")
-        set(ARCHITECTURE_ID "SH4")
-      elseif(peheader STREQUAL "50450000a801")
-        set(ARCHITECTURE_ID "SH5")
+      if(NOT peoffsethex STREQUAL "")
+        string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1)
+        string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2)
+        set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}")
+        string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}")
+        string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}")
+        string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}")
+        string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}")
+        string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}")
+        string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}")
+        math(EXPR peoffset "${peoffsetexpression}")
+
+        file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX)
+        if(peheader STREQUAL "50450000a201")
+          set(ARCHITECTURE_ID "SH3")
+        elseif(peheader STREQUAL "50450000a301")
+          set(ARCHITECTURE_ID "SH3DSP")
+        elseif(peheader STREQUAL "50450000a601")
+          set(ARCHITECTURE_ID "SH4")
+        elseif(peheader STREQUAL "50450000a801")
+          set(ARCHITECTURE_ID "SH5")
+        endif()
       endif()
     endif()
 
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index c2b5aa9..3cb7f24 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -91,6 +91,14 @@
 #  define PLATFORM_ID
 # endif
 
+#elif defined(__INTEGRITY)
+# if defined(INT_178B)
+#  define PLATFORM_ID "Integrity178"
+
+# else /* regular Integrity */
+#  define PLATFORM_ID "Integrity"
+# endif
+
 #else /* unknown platform */
 # define PLATFORM_ID
 
@@ -154,6 +162,26 @@
 # else /* unknown architecture */
 #  define ARCHITECTURE_ID ""
 # endif
+
+#elif defined(__ghs__)
+# if defined(__PPC64__)
+#  define ARCHITECTURE_ID "PPC64"
+
+# elif defined(__ppc__)
+#  define ARCHITECTURE_ID "PPC"
+
+# elif defined(__ARM__)
+#  define ARCHITECTURE_ID "ARM"
+
+# elif defined(__x86_64__)
+#  define ARCHITECTURE_ID "x64"
+
+# elif defined(__i386__)
+#  define ARCHITECTURE_ID "X86"
+
+# else /* unknown architecture */
+#  define ARCHITECTURE_ID ""
+# endif
 #else
 #  define ARCHITECTURE_ID
 #endif
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index e34ae75..f74a1c6 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -22,6 +22,7 @@ unset(CMAKE_C_COMPILER_WORKS CACHE)
 # any makefiles or projects.
 if(NOT CMAKE_C_COMPILER_WORKS)
   PrintTestCompilerStatus("C" "")
+  __TestCompiler_setTryCompileTargetType()
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
     "#ifdef __cplusplus\n"
     "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
@@ -41,6 +42,7 @@ if(NOT CMAKE_C_COMPILER_WORKS)
   set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
   unset(CMAKE_C_COMPILER_WORKS CACHE)
   set(C_TEST_WAS_RUN 1)
+  __TestCompiler_restoreTryCompileTargetType()
 endif()
 
 if(NOT CMAKE_C_COMPILER_WORKS)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index e4d49ae..fe6bd25 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -22,6 +22,7 @@ unset(CMAKE_CXX_COMPILER_WORKS CACHE)
 # any makefiles or projects.
 if(NOT CMAKE_CXX_COMPILER_WORKS)
   PrintTestCompilerStatus("CXX" "")
+  __TestCompiler_setTryCompileTargetType()
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     "#ifndef __cplusplus\n"
     "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
@@ -34,6 +35,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
   set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS})
   unset(CMAKE_CXX_COMPILER_WORKS CACHE)
   set(CXX_TEST_WAS_RUN 1)
+  __TestCompiler_restoreTryCompileTargetType()
 endif()
 
 if(NOT CMAKE_CXX_COMPILER_WORKS)
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index f76076f..6ee5175 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -5,3 +5,23 @@
 function(PrintTestCompilerStatus LANG MSG)
   message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
 endfunction()
+
+# if required set the target type if not already explicitly set
+macro(__TestCompiler_setTryCompileTargetType)
+  if(NOT CMAKE_TRY_COMPILE_TARGET_TYPE)
+    if("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
+      #prefer static libraries to avoid linking issues
+      set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+      set(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE 1)
+    endif()
+  endif()
+endmacro()
+
+# restore the original value
+# -- not necessary if __TestCompiler_setTryCompileTargetType() was used in function scope
+macro(__TestCompiler_restoreTryCompileTargetType)
+  if(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE)
+    unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+    unset(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE)
+  endif()
+endmacro()
diff --git a/Modules/Compiler/GHS-DetermineCompiler.cmake b/Modules/Compiler/GHS-DetermineCompiler.cmake
index 56d24e2..368b375 100644
--- a/Modules/Compiler/GHS-DetermineCompiler.cmake
+++ b/Modules/Compiler/GHS-DetermineCompiler.cmake
@@ -1,6 +1,9 @@
-set(_compiler_id_pp_test "defined(__INTEGRITY)")
+set(_compiler_id_pp_test "defined(__ghs__)")
 
 set(_compiler_id_version_compute "
-# define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEGRITY_MAJOR_VERSION)
-# define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEGRITY_MINOR_VERSION)
-# define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEGRITY_PATCH_VERSION)")
+/* __GHS_VERSION_NUMBER = VVVVRP */
+# ifdef __GHS_VERSION_NUMBER
+# define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 100)
+# define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 10 % 10)
+# define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@(__GHS_VERSION_NUMBER      % 10)
+# endif")
diff --git a/Modules/CompilerId/GHS_default.gpj.in b/Modules/CompilerId/GHS_default.gpj.in
new file mode 100644
index 0000000..b5cea5c
--- /dev/null
+++ b/Modules/CompilerId/GHS_default.gpj.in
@@ -0,0 +1,8 @@
+#!gbuild
+ at bsp_name@
+ at os_dir@
+primaryTarget=@ghs_primary_target@
+[Project]
+     {isdefined(GHS_BSP)} -bsp $GHS_BSP
+     {isdefined(GHS_OS)} -os_dir $GHS_OS
+GHS_lib.gpj [Library]
diff --git a/Modules/CompilerId/GHS_lib.gpj.in b/Modules/CompilerId/GHS_lib.gpj.in
new file mode 100644
index 0000000..149b981
--- /dev/null
+++ b/Modules/CompilerId/GHS_lib.gpj.in
@@ -0,0 +1,3 @@
+#!gbuild
+[Library]
+ at id_src@
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 82543e7..557efec 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -104,24 +104,6 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
 
   mf->AddDefinition("CMAKE_SYSTEM_VERSION", tsp.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;
 }
 
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 7c48d04..87bd27e 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2317,6 +2317,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
       add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"" "")
       add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" "")
       add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "" "")
+      add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "" "")
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
       #unset ghs config variables
       unset(ghs_config_name)
diff --git a/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt b/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
new file mode 100644
index 0000000..222aa17
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test)
+
+message("CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}")
+message("CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}")
+message("CMAKE_C_COMPILER_VERSION = ${CMAKE_C_COMPILER_VERSION}")
+message("CMAKE_C_PLATFORM_ID = ${CMAKE_C_PLATFORM_ID}")
+message("CMAKE_C_COMPILER_ARCHITECTURE_ID = ${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
+message("CMAKE_C_COMPILER_ABI = ${CMAKE_C_COMPILER_ABI}")
+message("CMAKE_C_STANDARD_COMPUTED_DEFAULT = ${CMAKE_C_STANDARD_COMPUTED_DEFAULT}")
+
+message("CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
+message("CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
+message("CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
+message("CMAKE_CXX_PLATFORM_ID = ${CMAKE_CXX_PLATFORM_ID}")
+message("CMAKE_CXX_COMPILER_ARCHITECTURE_ID = ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
+message("CMAKE_CXX_COMPILER_ABI = ${CMAKE_CXX_COMPILER_ABI}")
+message("CMAKE_CXX_STANDARD_COMPUTED_DEFAULT = ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}")
+
+if(CMAKE_C_COMPILER AND NOT CMAKE_C_COMPILER_ID STREQUAL "GHS")
+  message(FATAL_ERROR "CMAKE_C_COMPILER_ID != GHS")
+endif()
+
+if(CMAKE_CXX_COMPILER AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "GHS")
+  message(FATAL_ERROR "CMAKE_CXX_COMPILER_ID != GHS")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiPlatform/file1.c b/Tests/GhsMulti/GhsMultiPlatform/file1.c
new file mode 100644
index 0000000..6f7c837
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiPlatform/file1.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main(void)
+{
+  printf("Testing...\n");
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=436cc5e991c7be07610d7902a5ce2a00221ca0a2
commit 436cc5e991c7be07610d7902a5ce2a00221ca0a2
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Tue Jan 8 23:52:12 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:42:00 2019 -0500

    GHS: try_compile() now uses GHS platform variables
    
    -- Forward GHS platform variables to try_compile()
       CMAKE_TRY_COMPILE_PLATFORM_VARIABLES only worked for source signature try_compile()
    -- Update tests to no longer add GHS platform variables to try_compile()
    -- Avoid linker error in GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt by building library

diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index cf9e06f..77f42a1 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -168,3 +168,6 @@ then the language standard variables are honored:
 
 Their values are used to set the corresponding target properties in
 the generated project (unless overridden by an explicit option).
+
+For the :generator:`Green Hills MULTI` generator the GHS toolset and target
+system customization cache variables are also propagated into the test project.
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 2794598..bfe671f 100644
--- a/Help/generator/Green Hills MULTI.rst	
+++ b/Help/generator/Green Hills MULTI.rst	
@@ -17,13 +17,14 @@ Both absolute and relative paths are valid. Relative paths use ``GHS_TOOLSET_ROO
 as the root. If the toolset is not specified then the latest toolset found in
 ``GHS_TOOLSET_ROOT`` will be used.
 
+Cache variables that are used for toolset and target system customization:
+
 * ``GHS_TARGET_PLATFORM``
 
   | Defaults to ``integrity``.
   | Usual values are ``integrity``, ``threadx``, ``uvelosity``, ``velosity``,
     ``vxworks``, ``standalone``.
 
-
 * ``GHS_PRIMARY_TARGET``
 
   | Sets ``primaryTarget`` entry in project file.
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index a483fd1..137b25f 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -57,6 +57,12 @@ static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
   "CMAKE_TRY_COMPILE_PLATFORM_VARIABLES";
 static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED";
 
+/* GHS Multi platform variables */
+static std::set<std::string> ghs_platform_vars{
+  "GHS_TARGET_PLATFORM", "GHS_PRIMARY_TARGET", "GHS_TOOLSET_ROOT",
+  "GHS_OS_ROOT",         "GHS_OS_DIR",         "GHS_BSP_NAME"
+};
+
 static void writeProperty(FILE* fout, std::string const& targetName,
                           std::string const& prop, std::string const& value)
 {
@@ -869,6 +875,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
     projectName = "CMAKE_TRY_COMPILE";
   }
 
+  if (this->Makefile->GetState()->UseGhsMultiIDE()) {
+    // Forward the GHS variables to the inner project cache.
+    for (std::string const& var : ghs_platform_vars) {
+      if (const char* val = this->Makefile->GetDefinition(var)) {
+        std::string flag = "-D" + var + "=" + val;
+        cmakeFlags.push_back(std::move(flag));
+      }
+    }
+  }
+
   bool erroroc = cmSystemTools::GetErrorOccuredFlag();
   cmSystemTools::ResetErrorOccuredFlag();
   std::string output;
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 25a4d21..82543e7 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -11,6 +11,7 @@
 #include "cmGhsMultiTargetGenerator.h"
 #include "cmLocalGhsMultiGenerator.h"
 #include "cmMakefile.h"
+#include "cmState.h"
 #include "cmVersion.h"
 #include "cmake.h"
 
@@ -21,6 +22,7 @@ const char* cmGlobalGhsMultiGenerator::DEFAULT_TOOLSET_ROOT = "C:/ghs";
 cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake* cm)
   : cmGlobalGenerator(cm)
 {
+  cm->GetState()->SetGhsMultiIDE(true);
 }
 
 cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator()
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index f664000..94a84e5 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -593,6 +593,16 @@ bool cmState::UseWindowsVSIDE() const
   return this->WindowsVSIDE;
 }
 
+void cmState::SetGhsMultiIDE(bool ghsMultiIDE)
+{
+  this->GhsMultiIDE = ghsMultiIDE;
+}
+
+bool cmState::UseGhsMultiIDE() const
+{
+  return this->GhsMultiIDE;
+}
+
 void cmState::SetWatcomWMake(bool watcomWMake)
 {
   this->WatcomWMake = watcomWMake;
diff --git a/Source/cmState.h b/Source/cmState.h
index abe93ed..b60eece 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -154,6 +154,8 @@ public:
   bool UseWindowsShell() const;
   void SetWindowsVSIDE(bool windowsVSIDE);
   bool UseWindowsVSIDE() const;
+  void SetGhsMultiIDE(bool ghsMultiIDE);
+  bool UseGhsMultiIDE() const;
   void SetWatcomWMake(bool watcomWMake);
   bool UseWatcomWMake() const;
   void SetMinGWMake(bool minGWMake);
@@ -206,6 +208,7 @@ private:
   bool IsGeneratorMultiConfig = false;
   bool WindowsShell = false;
   bool WindowsVSIDE = false;
+  bool GhsMultiIDE = false;
   bool WatcomWMake = false;
   bool MinGWMake = false;
   bool NMake = false;
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
index 1436cbb..4a3f5c2 100644
--- a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
@@ -14,14 +14,12 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.c
 )
 
 message("Building project")
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
 try_compile(RESULT
   ${CMAKE_CURRENT_BINARY_DIR}/build
   ${CMAKE_CURRENT_BINARY_DIR}/src
   test
-  CMAKE_FLAGS -DGHS_BSP_NAME=${GHS_BSP_NAME}
-    -DGHS_OS_ROOT=${GHS_OS_ROOT}
-    -DGHS_TOOLSET_ROOT=${GHS_TOOLSET_ROOT}
-    -DGHS_TARGET_PLATFORM=${GHS_TARGET_PLATFORM}
+  CMAKE_FLAGS
     -DRUN_TEST=${RUN_TEST}
     -DCMAKE_BUILD_TYPE=${RUN_TEST_BUILD_TYPE}
   OUTPUT_VARIABLE OUTPUT)
diff --git a/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
index 46d833b..d6d007d 100644
--- a/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
@@ -9,11 +9,6 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
 try_compile(RESULT
   ${CMAKE_CURRENT_BINARY_DIR}/build
   ${CMAKE_CURRENT_SOURCE_DIR}/test.c
-  CMAKE_FLAGS -DGHS_BSP_NAME=${GHS_BSP_NAME}
-  -DGHS_OS_ROOT=${GHS_OS_ROOT}
-  -DGHS_OS_DIR=${GHS_OS_DIR}
-  -DGHS_TOOLSET_ROOT=${GHS_TOOLSET_ROOT}
-  -DGHS_TARGET_PLATFORM=${GHS_TARGET_PLATFORM}
   OUTPUT_VARIABLE OUTPUT
   COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_library"
 )
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
index 9b23493..dfb72ce 100644
--- a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
@@ -25,11 +25,7 @@ try_compile(RESULT
   ${CMAKE_CURRENT_BINARY_DIR}/link_build
   ${CMAKE_CURRENT_BINARY_DIR}/link_src
   test
-  CMAKE_FLAGS -DGHS_BSP_NAME=${GHS_BSP_NAME}
-    -DGHS_OS_ROOT=${GHS_OS_ROOT}
-    -DGHS_OS_DIR=${GHS_OS_DIR}
-    -DGHS_TOOLSET_ROOT=${GHS_TOOLSET_ROOT}
-    -DGHS_TARGET_PLATFORM=${GHS_TARGET_PLATFORM}
+  CMAKE_FLAGS
     -DRUN_TEST=${RUN_TEST}
     -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
   OUTPUT_VARIABLE OUTPUT)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a1ec0de3d2102918284eff13763f2aa3d20d119
commit 4a1ec0de3d2102918284eff13763f2aa3d20d119
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Tue Jan 8 12:15:59 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:56 2019 -0500

    GHS: Fix toolset selection
    
    -- Allow -T to accept full or partial paths
    -- Use "C:/ghs" if GHS_TOOLSET_ROOT is empty string
    -- Put more information in error messages

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index f382f6f..2794598 100644
--- a/Help/generator/Green Hills MULTI.rst	
+++ b/Help/generator/Green Hills MULTI.rst	
@@ -12,9 +12,10 @@ 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.
+The ``-T <toolset>`` option can be used to set the directory location of the toolset.
+Both absolute and relative paths are valid. Relative paths use ``GHS_TOOLSET_ROOT``
+as the root. If the toolset is not specified then the latest toolset found in
+``GHS_TOOLSET_ROOT`` will be used.
 
 * ``GHS_TARGET_PLATFORM``
 
@@ -30,7 +31,7 @@ If the toolset is not specified then the latest toolset will be used.
 
 * ``GHS_TOOLSET_ROOT``
 
-  | Root path for ``toolset``.
+  | Root path for ``toolset`` searches.
   | Defaults to ``C:/ghs``.
 
 * ``GHS_OS_ROOT``
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 664d967..25a4d21 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -55,43 +55,44 @@ void cmGlobalGhsMultiGenerator::ComputeTargetObjectDirectory(
 bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
                                                     cmMakefile* mf)
 {
-  std::string tsp;      /* toolset path */
-  std::string tsn = ts; /* toolset name */
+  std::string tsp; /* toolset path */
 
-  GetToolset(mf, tsp, tsn);
+  this->GetToolset(mf, tsp, ts);
 
   /* no toolset was found */
-  if (tsn.empty()) {
+  if (tsp.empty()) {
     return false;
   } else if (ts.empty()) {
     std::string message;
     message =
       "Green Hills MULTI: -T <toolset> not specified; defaulting to \"";
-    message += tsn;
+    message += tsp;
     message += "\"";
     cmSystemTools::Message(message.c_str());
 
-    /* store the toolset for later use
+    /* store the full toolset for later use
      * -- already done if -T<toolset> was specified
      */
-    mf->AddCacheDefinition("CMAKE_GENERATOR_TOOLSET", tsn.c_str(),
-                           "Name of generator toolset.",
+    mf->AddCacheDefinition("CMAKE_GENERATOR_TOOLSET", tsp.c_str(),
+                           "Location of generator toolset.",
                            cmStateEnums::INTERNAL);
   }
 
   /* set the build tool to use */
+  std::string gbuild(tsp + ((tsp.back() == '/') ? "" : "/") +
+                     DEFAULT_BUILD_PROGRAM);
   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: ";
+    std::string message = "toolset build tool: ";
     message += gbuild;
-    message += "\nDoes not match the toolset used previously: ";
+    message += "\nDoes not match the previously used build tool: ";
     message += prevTool;
     message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
                "directory or choose a different binary directory.";
     cmSystemTools::Error(message.c_str());
+    return false;
   } else {
     /* store the toolset that is being used for this build */
     mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", gbuild.c_str(),
@@ -99,7 +100,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
                            true);
   }
 
-  mf->AddDefinition("CMAKE_SYSTEM_VERSION", tsn.c_str());
+  mf->AddDefinition("CMAKE_SYSTEM_VERSION", tsp.c_str());
 
   // FIXME: compiler detection not implemented
   // gbuild uses the primaryTarget setting in the top-level project
@@ -172,11 +173,11 @@ bool cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile* /*mf*/)
 }
 
 void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
-                                           std::string& ts)
+                                           const std::string& ts)
 {
   const char* ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT");
 
-  if (!ghsRoot) {
+  if (!ghsRoot || ghsRoot[0] == '\0') {
     ghsRoot = DEFAULT_TOOLSET_ROOT;
   }
   tsd = ghsRoot;
@@ -185,20 +186,29 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
     std::vector<std::string> output;
 
     // Use latest? version
+    if (tsd.back() != '/') {
+      tsd += "/";
+    }
     cmSystemTools::Glob(tsd, "comp_[^;]+", output);
 
     if (output.empty()) {
-      cmSystemTools::Error("GHS toolset not found in ", tsd.c_str());
-      ts = "";
+      std::string msg =
+        "No GHS toolsets found in GHS_TOOLSET_ROOT \"" + tsd + "\".";
+      cmSystemTools::Error(msg.c_str());
+      tsd = "";
     } else {
-      ts = output.back();
+      tsd += output.back();
     }
   } else {
-    std::string tryPath = tsd + std::string("/") + ts;
+    std::string tryPath;
+    /* CollapseCombinedPath will check if ts is an absolute path */
+    tryPath = cmSystemTools::CollapseCombinedPath(tsd, ts);
     if (!cmSystemTools::FileExists(tryPath)) {
-      cmSystemTools::Error("GHS toolset \"", ts.c_str(), "\" not found in ",
-                           tsd.c_str());
-      ts = "";
+      std::string msg = "GHS toolset \"" + tryPath + "\" not found.";
+      cmSystemTools::Error(msg.c_str());
+      tsd = "";
+    } else {
+      tsd = tryPath;
     }
   }
 }
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index d926575..9332567 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -99,7 +99,7 @@ protected:
                               std::vector<std::string>()) override;
 
 private:
-  void GetToolset(cmMakefile* mf, std::string& tsd, std::string& ts);
+  void GetToolset(cmMakefile* mf, std::string& tsd, const std::string& ts);
 
   /* top-level project */
   void OutputTopLevelProject(cmLocalGenerator* root,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a66acdef268865e5816bd56176274034769b1b5
commit 1a66acdef268865e5816bd56176274034769b1b5
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 15:10:24 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:53 2019 -0500

    GHS: Append ".gpj" to target name when generating build command
    
    -- Add test demonstrating issue
    -- In the case of executable targets the target name is usually the same as used in "-o filename"
       But for static libraries the target name is usually "-o libname.a"
       "gbuild.exe target" will build whatever target matches against even the output from the compiler or linker
       But the targets in "cmake --build . --target name" should be target names in CMakeLists.txt not the actual filenames
       So change the "name" to "name.gpj" so it matches the target name in CMakeLists.txt.
    
    Fixes #15975

diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index e850e05..664d967 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -413,7 +413,11 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
     if (targetName == "clean") {
       makeCommand.push_back("-clean");
     } else {
-      makeCommand.push_back(targetName);
+      if (targetName.compare(targetName.size() - 4, 4, ".gpj") == 0) {
+        makeCommand.push_back(targetName);
+      } else {
+        makeCommand.push_back(targetName + ".gpj");
+      }
     }
   }
 }
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 99f5a8f..7c48d04 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2316,6 +2316,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
         "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake")
       add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"" "")
       add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" "")
+      add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "" "")
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
       #unset ghs config variables
       unset(ghs_config_name)
diff --git a/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
new file mode 100644
index 0000000..46d833b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+try_compile(RESULT
+  ${CMAKE_CURRENT_BINARY_DIR}/build
+  ${CMAKE_CURRENT_SOURCE_DIR}/test.c
+  CMAKE_FLAGS -DGHS_BSP_NAME=${GHS_BSP_NAME}
+  -DGHS_OS_ROOT=${GHS_OS_ROOT}
+  -DGHS_OS_DIR=${GHS_OS_DIR}
+  -DGHS_TOOLSET_ROOT=${GHS_TOOLSET_ROOT}
+  -DGHS_TARGET_PLATFORM=${GHS_TARGET_PLATFORM}
+  OUTPUT_VARIABLE OUTPUT
+  COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_library"
+)
+
+message(STATUS "Output from build:\n${OUTPUT}")
+
+if(NOT RESULT)
+  message(SEND_ERROR "try_compile() failed")
+endif()
+
+if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/test_library")
+  if (IS_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_library")
+    message(SEND_ERROR "library is folder !")
+  else()
+    message(STATUS "library seems okay")
+  endif()
+else()
+  message(SEND_ERROR "library is not found !")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiCopyFile/test.c b/Tests/GhsMulti/GhsMultiCopyFile/test.c
new file mode 100644
index 0000000..5c657b5
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCopyFile/test.c
@@ -0,0 +1,4 @@
+int lib(int x)
+{
+  return -x;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c9e47d7cdb498f9bc29231587030e0840c9f00c
commit 0c9e47d7cdb498f9bc29231587030e0840c9f00c
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:23 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:49 2019 -0500

    GHS: Integrity Application updates
    
    -- Check the property "ghs_integrity_app" on executables to set [INTEGRITY Application]
       If the property is not set then check if an integrate file is one of the source files (.int file).
       Dynamic Downloads that do not have an integrate file can use this property along with setting
       the compiler flag "-dynamic".
    
    -- Remove parsing for -dynamic flag; it is only used to print a comment
       The MULTI GUI will show if it is a Monolith or Dynamic Download application
    
    -- Use project references to specify which executables are part of the Integrity Application
       Usually Implicit Dependency Analysis will ensure that executable targets
       become part of the application.  This does not work for Dynamic Download without integrate files.
       Use `add_dependencies(dd vas)` to mark that the vas target is part of dd target.
    
    -- Update file locations in the Integrate files.

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 4ee1427..f382f6f 100644
--- a/Help/generator/Green Hills MULTI.rst	
+++ b/Help/generator/Green Hills MULTI.rst	
@@ -18,37 +18,46 @@ 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``.
+  | Defaults 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``.
+  | Sets ``primaryTarget`` entry in project file.
+  | Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
 
 * ``GHS_TOOLSET_ROOT``
 
-Default to ``C:/ghs``.  Root path for ``toolset``.
+  | Root path for ``toolset``.
+  | Defaults to ``C:/ghs``.
 
 * ``GHS_OS_ROOT``
 
-Default to ``C:/ghs``.  Root path for RTOS searches.
+  | Root path for RTOS searches.
+  | Defaults to ``C:/ghs``.
 
 * ``GHS_OS_DIR``
 
-Default to latest platform OS installation at ``GHS_OS_ROOT``.  Set this value if
-a specific RTOS is to be used.
+  | Sets ``-os_dir`` entry in project file.
+  | Defaults 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.
+  | Sets ``-bsp`` entry in project file.
+  | Defaults to ``sim<arch>`` for ``integrity`` platforms.
 
 Customizations are available through the following cache variables:
 
 * ``GHS_CUSTOMIZATION``
 * ``GHS_GPJ_MACROS``
 
+The following properties are available:
+
+* :prop_tgt:`GHS_INTEGRITY_APP`
+
 .. note::
   This generator is deemed experimental as of CMake |release|
   and is still a work in progress.  Future versions of CMake
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index df8f12c..3a80887 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -193,6 +193,7 @@ Properties on Targets
    /prop_tgt/FRAMEWORK
    /prop_tgt/FRAMEWORK_VERSION
    /prop_tgt/GENERATOR_FILE_NAME
+   /prop_tgt/GHS_INTEGRITY_APP
    /prop_tgt/GNUtoMS
    /prop_tgt/HAS_CXX
    /prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
diff --git a/Help/prop_tgt/GHS_INTEGRITY_APP.rst b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
new file mode 100644
index 0000000..7643038
--- /dev/null
+++ b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
@@ -0,0 +1,10 @@
+GHS_INTEGRITY_APP
+-----------------
+
+``ON`` / ``OFF`` boolean to determine if an executable target should
+be treated as an `Integrity Application`.
+
+If no value is set and if a `.int` file is added as a source file to the
+executable target it will be treated as an `Integrity Application`.
+
+Supported on :generator:`Green Hills MULTI`.
diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst
index 0f91be8..fe3b17e 100644
--- a/Help/variable/GHS-MULTI.rst
+++ b/Help/variable/GHS-MULTI.rst
@@ -1,4 +1,4 @@
 GHS-MULTI
 ---------
 
-True when using Green Hills MULTI
+``True`` when using :generator:`Green Hills MULTI` generator.
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 8da21c6..4588901 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -13,15 +13,11 @@
 #include "cmSourceGroup.h"
 #include "cmTarget.h"
 
-std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
-
 cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
   : GeneratorTarget(target)
   , LocalGenerator(
       static_cast<cmLocalGhsMultiGenerator*>(target->GetLocalGenerator()))
   , Makefile(target->Target->GetMakefile())
-  , TargetGroup(DetermineIfTargetGroup(target))
-  , DynamicDownload(false)
   , Name(target->GetName())
 {
   // Store the configuration name that is being used
@@ -50,8 +46,7 @@ void cmGhsMultiTargetGenerator::Generate()
       this->GeneratorTarget->GetExecutableNames(
         targetName, this->TargetNameReal, targetNameImport, targetNamePDB,
         this->ConfigName);
-      if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
-            this->GeneratorTarget)) {
+      if (cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()) {
         this->TagType = GhsMultiGpj::INTERGRITY_APPLICATION;
       } else {
         this->TagType = GhsMultiGpj::PROGRAM;
@@ -126,11 +121,7 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
 
   const std::string language(
     this->GeneratorTarget->GetLinkerLanguage(this->ConfigName));
-  this->DynamicDownload =
-    this->DetermineIfDynamicDownload(this->ConfigName, language);
-  if (this->DynamicDownload) {
-    fout << "#component integrity_dynamic_download" << std::endl;
-  }
+
   this->WriteTargetSpecifics(fout, this->ConfigName);
   this->SetCompilerFlags(this->ConfigName, language);
   this->WriteCompilerFlags(fout, this->ConfigName, language);
@@ -139,7 +130,7 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
   this->WriteTargetLinkLine(fout, this->ConfigName);
   this->WriteCustomCommands(fout);
   this->WriteSources(fout);
-
+  this->WriteReferences(fout);
   fout.Close();
 }
 
@@ -541,36 +532,49 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
     }
   }
 }
-
-bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
-  const cmGeneratorTarget* target)
+void cmGhsMultiTargetGenerator::WriteReferences(std::ostream& fout)
 {
-  bool output = false;
-  std::vector<cmSourceFile*> sources;
-  std::string config =
-    target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
-  target->GetSourceFiles(sources, config);
-  for (std::vector<cmSourceFile*>::const_iterator sources_i = sources.begin();
-       sources.end() != sources_i; ++sources_i) {
-    if ("int" == (*sources_i)->GetExtension()) {
-      output = true;
-    }
+  // This only applies to INTEGRITY Applications
+  if (this->TagType != GhsMultiGpj::INTERGRITY_APPLICATION) {
+    return;
+  }
+
+  // Get the targets that this one depends upon
+  cmTargetDependSet unordered =
+    this->GetGlobalGenerator()->GetTargetDirectDepends(this->GeneratorTarget);
+  cmGlobalGhsMultiGenerator::OrderedTargetDependSet ordered(unordered,
+                                                            this->Name);
+  for (auto& t : ordered) {
+    std::string tname = t->GetName();
+    std::string tpath = t->LocalGenerator->GetCurrentBinaryDirectory();
+    std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
+    std::string outpath =
+      this->LocalGenerator->ConvertToRelativePath(rootpath, tpath) + "/" +
+      tname + "REF" + cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+
+    fout << outpath;
+    fout << "    ";
+    GhsMultiGpj::WriteGpjTag(GhsMultiGpj::REFERENCE, fout);
+
+    // Tell the global generator that a refernce project needs to be created
+    t->Target->SetProperty("GHS_REFERENCE_PROJECT", "ON");
   }
-  return output;
 }
 
-bool cmGhsMultiTargetGenerator::DetermineIfDynamicDownload(
-  std::string const& config, const std::string& language)
+bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp(void)
 {
-  std::vector<std::string> options;
-  bool output = false;
-  this->GeneratorTarget->GetCompileOptions(options, config, language);
-  for (std::vector<std::string>::const_iterator options_i = options.begin();
-       options_i != options.end(); ++options_i) {
-    std::string option = *options_i;
-    if (this->DDOption == option) {
-      output = true;
+  const char* p = this->GeneratorTarget->GetProperty("ghs_integrity_app");
+  if (p) {
+    return cmSystemTools::IsOn(
+      this->GeneratorTarget->GetProperty("ghs_integrity_app"));
+  } else {
+    std::vector<cmSourceFile*> sources;
+    this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
+    for (auto& sf : sources) {
+      if ("int" == sf->GetExtension()) {
+        return true;
+      }
     }
+    return false;
   }
-  return output;
 }
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 0ab5cc3..a241cc6 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -29,8 +29,6 @@ private:
 
   void GenerateTarget();
 
-  bool IsTargetGroup() const { return this->TargetGroup; }
-
   void WriteTargetSpecifics(std::ostream& fout, const std::string& config);
 
   void WriteCompilerFlags(std::ostream& fout, const std::string& config,
@@ -54,19 +52,14 @@ private:
   void WriteSources(std::ostream& fout_proj);
   void WriteSourceProperty(std::ostream& fout, const cmSourceFile* sf,
                            std::string propName, std::string propFlag);
+  void WriteReferences(std::ostream& fout);
   static void WriteObjectLangOverride(std::ostream& fout,
                                       const cmSourceFile* sourceFile);
 
-  static bool DetermineIfTargetGroup(const cmGeneratorTarget* target);
-  bool DetermineIfDynamicDownload(std::string const& config,
-                                  const std::string& language);
-
+  bool DetermineIfIntegrityApp(void);
   cmGeneratorTarget* GeneratorTarget;
   cmLocalGhsMultiGenerator* LocalGenerator;
   cmMakefile* Makefile;
-  bool TargetGroup;
-  bool DynamicDownload;
-  static std::string const DDOption;
   std::map<std::string, std::string> FlagsByLanguage;
   std::map<std::string, std::string> DefinesByLanguage;
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 85c2345..a5c90bf 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -302,7 +302,8 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
     for (cmGeneratorTarget* target : targets) {
       if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
           target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
-          target->GetType() == cmStateEnums::TargetType::UTILITY) {
+          target->GetType() == cmStateEnums::TargetType::UTILITY ||
+          cmSystemTools::IsOn(target->GetProperty("ghs_integrity_app"))) {
         continue;
       }
 
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index f2f43e3..e850e05 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -315,8 +315,26 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(
       if (cmSystemTools::IsOn(target->GetProperty("EXCLUDE_FROM_ALL"))) {
         fout << "{comment} ";
       }
-      fout << dir << projName << FILE_EXTENSION;
+      std::string projFile = dir + projName + FILE_EXTENSION;
+      fout << projFile;
       fout << " " << projType << std::endl;
+
+      if (cmSystemTools::IsOn(target->GetProperty("GHS_REFERENCE_PROJECT"))) {
+        // create reference project
+        std::string fname = dir;
+        fname += target->GetName();
+        fname += "REF";
+        fname += FILE_EXTENSION;
+
+        cmGeneratedFileStream fref(fname.c_str());
+        fref.SetCopyIfDifferent(true);
+
+        this->WriteFileHeader(fref);
+        GhsMultiGpj::WriteGpjTag(GhsMultiGpj::REFERENCE, fref);
+        fref << "    :reference=" << projFile << std::endl;
+
+        fref.Close();
+      }
     }
   }
 }
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f06bfbf..99f5a8f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2292,6 +2292,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
       if (NOT ghs_skip_integrity AND (NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity"))
         add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "" "")
         add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "" "")
+        add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "" "")
       endif ()
       add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "" "")
       add_test_GhsMulti_rename_install(SINGLE_EXEC)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
new file mode 100644
index 0000000..3d0642d
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+# create virtual AS
+add_executable(vas exe.c)
+target_link_libraries(vas lib)
+add_library(lib func.c)
+
+# create dynamic download INTEGRITY application
+add_executable(dynamic)
+set_target_properties(dynamic PROPERTIES ghs_integrity_app ON)
+target_compile_options(dynamic PRIVATE -dynamic)
+add_dependencies(dynamic vas)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c
new file mode 100644
index 0000000..29ad70a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c
@@ -0,0 +1,5 @@
+extern int func(void);
+int main(void)
+{
+  return func();
+}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c
new file mode 100644
index 0000000..b35e9cc
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c
@@ -0,0 +1,4 @@
+int func(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
index 9e22b5e..5035d58 100644
--- a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
@@ -7,6 +7,6 @@ Kernel
 EndKernel
 
 AddressSpace        App
-  Filename      "App/App.as"
+  Filename          "App/App"
   Language C
 EndAddressSpace
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
index 161345b..361793a 100644
--- a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
@@ -1,8 +1,8 @@
 Kernel
-  Filename        kernel/kernel.as
+  Filename        kernel
 EndKernel
 
 AddressSpace      App
-  Filename        "vas/vas.as"
+  Filename        vas
   Language C
 EndAddressSpace

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80443184317e97999da63d71549aa1b89997dc3d
commit 80443184317e97999da63d71549aa1b89997dc3d
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:23 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:45 2019 -0500

    GHS: Add support for some of the source file properties
    
    -- INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS, and COMPILE_OPTIONS

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 72f308a..8da21c6 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -367,6 +367,21 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
   }
 }
 
+void cmGhsMultiTargetGenerator::WriteSourceProperty(std::ostream& fout,
+                                                    const cmSourceFile* sf,
+                                                    std::string propName,
+                                                    std::string propFlag)
+{
+  const char* prop = sf->GetProperty(propName);
+  if (prop) {
+    std::vector<std::string> list;
+    cmSystemTools::ExpandListArgument(prop, list);
+    for (auto& p : list) {
+      fout << "    " << propFlag << p << std::endl;
+    }
+  }
+}
+
 void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
 {
   /* vector of all sources for this target */
@@ -494,6 +509,11 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
           "bsp" != si->GetExtension()) {
         this->WriteObjectLangOverride(*fout, si);
       }
+
+      this->WriteSourceProperty(*fout, si, "INCLUDE_DIRECTORIES", "-I");
+      this->WriteSourceProperty(*fout, si, "COMPILE_DEFINITIONS", "-D");
+      this->WriteSourceProperty(*fout, si, "COMPILE_OPTIONS", "");
+
       /* to avoid clutter in the gui only print out the objectName if it has
        * been renamed */
       std::string objectName = this->GeneratorTarget->GetObjectName(si);
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index c713cc4..0ab5cc3 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -52,7 +52,8 @@ private:
     std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
     cmTarget::CustomCommandType commandType);
   void WriteSources(std::ostream& fout_proj);
-
+  void WriteSourceProperty(std::ostream& fout, const cmSourceFile* sf,
+                           std::string propName, std::string propFlag);
   static void WriteObjectLangOverride(std::ostream& fout,
                                       const cmSourceFile* sourceFile);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73092b2213495e06ef2ecfbf5fcca850874d6c88
commit 73092b2213495e06ef2ecfbf5fcca850874d6c88
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:22 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:42 2019 -0500

    GHS: Add support for object libraries

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 5e6224f..72f308a 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -76,10 +76,15 @@ void cmGhsMultiTargetGenerator::Generate()
       return;
     }
     case cmStateEnums::OBJECT_LIBRARY: {
-      std::string msg = "add_library(<name> OBJECT ...) not supported: ";
-      msg += this->Name;
-      cmSystemTools::Message(msg.c_str());
-      return;
+      std::string targetName;
+      std::string targetNameSO;
+      std::string targetNameImport;
+      std::string targetNamePDB;
+      this->GeneratorTarget->GetLibraryNames(
+        targetName, targetNameSO, this->TargetNameReal, targetNameImport,
+        targetNamePDB, this->ConfigName);
+      this->TagType = GhsMultiGpj::SUBPROJECT;
+      break;
     }
     case cmStateEnums::MODULE_LIBRARY: {
       std::string msg = "add_library(<name> MODULE ...) not supported: ";
@@ -151,11 +156,13 @@ void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
   std::string outpath;
   std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
 
-  // set target binary file destination
-  outpath = this->GeneratorTarget->GetDirectory(config);
-  outpath = this->LocalGenerator->ConvertToRelativePath(rootpath, outpath);
-  fout << "    :binDirRelative=\"" << outpath << "\"" << std::endl;
-  fout << "    -o \"" << this->TargetNameReal << "\"" << std::endl;
+  if (this->TagType != GhsMultiGpj::SUBPROJECT) {
+    // set target binary file destination
+    outpath = this->GeneratorTarget->GetDirectory(config);
+    outpath = this->LocalGenerator->ConvertToRelativePath(rootpath, outpath);
+    fout << "    :binDirRelative=\"" << outpath << "\"" << std::endl;
+    fout << "    -o \"" << this->TargetNameReal << "\"" << std::endl;
+  }
 
   // set target object file destination
   outpath = this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
@@ -360,52 +367,6 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
   }
 }
 
-std::map<const cmSourceFile*, std::string>
-cmGhsMultiTargetGenerator::GetObjectNames(
-  std::vector<cmSourceFile*>* const objectSources,
-  cmLocalGhsMultiGenerator* const localGhsMultiGenerator,
-  cmGeneratorTarget* const generatorTarget)
-{
-  std::map<std::string, std::vector<cmSourceFile*>> filenameToSource;
-  std::map<cmSourceFile*, std::string> sourceToFilename;
-  for (std::vector<cmSourceFile*>::const_iterator sf = objectSources->begin();
-       sf != objectSources->end(); ++sf) {
-    const std::string filename =
-      cmSystemTools::GetFilenameName((*sf)->GetFullPath());
-    const std::string lower_filename = cmSystemTools::LowerCase(filename);
-    filenameToSource[lower_filename].push_back(*sf);
-    sourceToFilename[*sf] = lower_filename;
-  }
-
-  std::vector<cmSourceFile*> duplicateSources;
-  for (std::map<std::string, std::vector<cmSourceFile*>>::const_iterator
-         msvSourceI = filenameToSource.begin();
-       msvSourceI != filenameToSource.end(); ++msvSourceI) {
-    if (msvSourceI->second.size() > 1) {
-      duplicateSources.insert(duplicateSources.end(),
-                              msvSourceI->second.begin(),
-                              msvSourceI->second.end());
-    }
-  }
-
-  std::map<const cmSourceFile*, std::string> objectNamesCorrected;
-
-  for (std::vector<cmSourceFile*>::const_iterator sf =
-         duplicateSources.begin();
-       sf != duplicateSources.end(); ++sf) {
-    std::string const longestObjectDirectory(
-      cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
-        localGhsMultiGenerator, generatorTarget, *sf));
-    std::string objFilenameName =
-      localGhsMultiGenerator->GetObjectFileNameWithoutTarget(
-        **sf, longestObjectDirectory);
-    cmsys::SystemTools::ReplaceString(objFilenameName, "/", "_");
-    objectNamesCorrected[*sf] = objFilenameName;
-  }
-
-  return objectNamesCorrected;
-}
-
 void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
 {
   /* vector of all sources for this target */
@@ -473,11 +434,6 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
               });
   }
 
-  /* get all the object names for these sources */
-  std::map<const cmSourceFile*, std::string> objectNames =
-    cmGhsMultiTargetGenerator::GetObjectNames(&sources, this->LocalGenerator,
-                                              this->GeneratorTarget);
-
   /* list of open project files */
   std::vector<cmGeneratedFileStream*> gfiles;
 
@@ -537,10 +493,13 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
       if ("ld" != si->GetExtension() && "int" != si->GetExtension() &&
           "bsp" != si->GetExtension()) {
         this->WriteObjectLangOverride(*fout, si);
-        if (objectNames.end() != objectNames.find(si)) {
-          *fout << "    -o \"" << objectNames.find(si)->second << "\""
-                << std::endl;
-        }
+      }
+      /* to avoid clutter in the gui only print out the objectName if it has
+       * been renamed */
+      std::string objectName = this->GeneratorTarget->GetObjectName(si);
+      if (!objectName.empty() &&
+          this->GeneratorTarget->HasExplicitObjectName(si)) {
+        *fout << "    -o " << objectName << std::endl;
       }
     }
   }
@@ -563,30 +522,6 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
   }
 }
 
-std::string cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
-  cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
-  cmGeneratorTarget* const generatorTarget, cmSourceFile* const sourceFile)
-{
-  std::string dir_max;
-  dir_max +=
-    localGhsMultiGenerator->GetMakefile()->GetCurrentBinaryDirectory();
-  dir_max += "/";
-  dir_max += generatorTarget->Target->GetName();
-  dir_max += "/";
-  std::vector<cmSourceGroup> sourceGroups(
-    localGhsMultiGenerator->GetMakefile()->GetSourceGroups());
-  std::string const& sourceFullPath = sourceFile->GetFullPath();
-  cmSourceGroup* sourceGroup =
-    localGhsMultiGenerator->GetMakefile()->FindSourceGroup(sourceFullPath,
-                                                           sourceGroups);
-  std::string const& sgPath = sourceGroup->GetFullName();
-  dir_max += sgPath;
-  dir_max += "/Objs/libs/";
-  dir_max += generatorTarget->Target->GetName();
-  dir_max += "/";
-  return dir_max;
-}
-
 bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
   const cmGeneratorTarget* target)
 {
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 5d67112..c713cc4 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -52,17 +52,10 @@ private:
     std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
     cmTarget::CustomCommandType commandType);
   void WriteSources(std::ostream& fout_proj);
-  static std::map<const cmSourceFile*, std::string> GetObjectNames(
-    std::vector<cmSourceFile*>* objectSources,
-    cmLocalGhsMultiGenerator* localGhsMultiGenerator,
-    cmGeneratorTarget* generatorTarget);
+
   static void WriteObjectLangOverride(std::ostream& fout,
                                       const cmSourceFile* sourceFile);
 
-  static std::string ComputeLongestObjectDirectory(
-    cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
-    cmGeneratorTarget* generatorTarget, cmSourceFile* const sourceFile);
-
   static bool DetermineIfTargetGroup(const cmGeneratorTarget* target);
   bool DetermineIfDynamicDownload(std::string const& config,
                                   const std::string& language);
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index b539a1c..125e8b5 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -7,6 +7,7 @@
 #include "cmGhsMultiTargetGenerator.h"
 #include "cmGlobalGhsMultiGenerator.h"
 #include "cmMakefile.h"
+#include "cmSourceFile.h"
 
 cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator(cmGlobalGenerator* gg,
                                                    cmMakefile* mf)
@@ -56,3 +57,44 @@ void cmLocalGhsMultiGenerator::Generate()
     }
   }
 }
+
+void cmLocalGhsMultiGenerator::ComputeObjectFilenames(
+  std::map<cmSourceFile const*, std::string>& mapping,
+  cmGeneratorTarget const* gt)
+{
+  std::string dir_max;
+  dir_max += this->GetCurrentBinaryDirectory();
+  dir_max += "/";
+  dir_max += this->GetTargetDirectory(gt);
+  dir_max += "/";
+
+  // Count the number of object files with each name.  Note that
+  // filesystem may not be case sensitive.
+  std::map<std::string, int> counts;
+
+  for (auto const& si : mapping) {
+    cmSourceFile const* sf = si.first;
+    std::string objectNameLower = cmSystemTools::LowerCase(
+      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
+    objectNameLower += this->GlobalGenerator->GetLanguageOutputExtension(*sf);
+    counts[objectNameLower] += 1;
+  }
+
+  // For all source files producing duplicate names we need unique
+  // object name computation.
+  for (auto& si : mapping) {
+    cmSourceFile const* sf = si.first;
+    std::string objectName =
+      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
+    objectName += this->GlobalGenerator->GetLanguageOutputExtension(*sf);
+
+    if (counts[cmSystemTools::LowerCase(objectName)] > 1) {
+      const_cast<cmGeneratorTarget*>(gt)->AddExplicitObjectName(sf);
+      bool keptSourceExtension;
+      objectName = this->GetObjectFileNameWithoutTarget(*sf, dir_max,
+                                                        &keptSourceExtension);
+      cmsys::SystemTools::ReplaceString(objectName, "/", "_");
+    }
+    si.second = objectName;
+  }
+}
diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h
index 1f55420..d5bec42 100644
--- a/Source/cmLocalGhsMultiGenerator.h
+++ b/Source/cmLocalGhsMultiGenerator.h
@@ -28,6 +28,10 @@ public:
   std::string GetTargetDirectory(
     cmGeneratorTarget const* target) const override;
 
+  void ComputeObjectFilenames(
+    std::map<cmSourceFile const*, std::string>& mapping,
+    cmGeneratorTarget const* gt = nullptr) override;
+
 private:
   void GenerateTargetsDepthFirst(cmGeneratorTarget* target,
                                  std::vector<cmGeneratorTarget*>& remaining);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14f3ba205989a422f1668073a325b057cece0b32
commit 14f3ba205989a422f1668073a325b057cece0b32
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:22 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:38 2019 -0500

    GHS: EXCLUDE_FROM_ALL updates
    
    -- Excluded targets should be generated but not included in build ALL
    -- Use the correct source list for this configuration when writing sources

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 0cd6312..5e6224f 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -108,56 +108,34 @@ void cmGhsMultiTargetGenerator::Generate()
 
 void cmGhsMultiTargetGenerator::GenerateTarget()
 {
-  // Skip if empty or not included in build
-  if (!this->GetSources().empty() && this->IncludeThisTarget()) {
-
-    // Open the filestream in copy-if-different mode.
-    std::string fname = this->LocalGenerator->GetCurrentBinaryDirectory();
-    fname += "/";
-    fname += this->Name;
-    fname += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
-    cmGeneratedFileStream fout(fname.c_str());
-    fout.SetCopyIfDifferent(true);
-
-    this->GetGlobalGenerator()->WriteFileHeader(fout);
-    GhsMultiGpj::WriteGpjTag(this->TagType, fout);
-    const std::string language(
-      this->GeneratorTarget->GetLinkerLanguage(this->ConfigName));
-    this->DynamicDownload =
-      this->DetermineIfDynamicDownload(this->ConfigName, language);
-    if (this->DynamicDownload) {
-      fout << "#component integrity_dynamic_download" << std::endl;
-    }
-    this->WriteTargetSpecifics(fout, this->ConfigName);
-    this->SetCompilerFlags(this->ConfigName, language);
-    this->WriteCompilerFlags(fout, this->ConfigName, language);
-    this->WriteCompilerDefinitions(fout, this->ConfigName, language);
-    this->WriteIncludes(fout, this->ConfigName, language);
-    this->WriteTargetLinkLine(fout, this->ConfigName);
-    this->WriteCustomCommands(fout);
-    this->WriteSources(fout);
-
-    fout.Close();
-  }
-}
-
-bool cmGhsMultiTargetGenerator::IncludeThisTarget()
-{
-  bool output = true;
-  char const* excludeFromAll =
-    this->GeneratorTarget->GetProperty("EXCLUDE_FROM_ALL");
-  if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
-      '\0' == excludeFromAll[1]) {
-    output = false;
+  // Open the filestream in copy-if-different mode.
+  std::string fname = this->LocalGenerator->GetCurrentBinaryDirectory();
+  fname += "/";
+  fname += this->Name;
+  fname += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+  cmGeneratedFileStream fout(fname.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  this->GetGlobalGenerator()->WriteFileHeader(fout);
+  GhsMultiGpj::WriteGpjTag(this->TagType, fout);
+
+  const std::string language(
+    this->GeneratorTarget->GetLinkerLanguage(this->ConfigName));
+  this->DynamicDownload =
+    this->DetermineIfDynamicDownload(this->ConfigName, language);
+  if (this->DynamicDownload) {
+    fout << "#component integrity_dynamic_download" << std::endl;
   }
-  return output;
-}
-
-std::vector<cmSourceFile*> cmGhsMultiTargetGenerator::GetSources() const
-{
-  std::vector<cmSourceFile*> output;
-  this->GeneratorTarget->GetSourceFiles(output, this->ConfigName);
-  return output;
+  this->WriteTargetSpecifics(fout, this->ConfigName);
+  this->SetCompilerFlags(this->ConfigName, language);
+  this->WriteCompilerFlags(fout, this->ConfigName, language);
+  this->WriteCompilerDefinitions(fout, this->ConfigName, language);
+  this->WriteIncludes(fout, this->ConfigName, language);
+  this->WriteTargetLinkLine(fout, this->ConfigName);
+  this->WriteCustomCommands(fout);
+  this->WriteSources(fout);
+
+  fout.Close();
 }
 
 cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
@@ -431,7 +409,8 @@ cmGhsMultiTargetGenerator::GetObjectNames(
 void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
 {
   /* vector of all sources for this target */
-  std::vector<cmSourceFile*> sources = this->GetSources();
+  std::vector<cmSourceFile*> sources;
+  this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
 
   /* vector of all groups defined for this target
    * -- but the vector is not expanded with sub groups or in any useful order
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 343044a..5d67112 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -24,9 +24,6 @@ public:
 
   virtual void Generate();
 
-  bool IncludeThisTarget();
-  std::vector<cmSourceFile*> GetSources() const;
-
 private:
   cmGlobalGhsMultiGenerator* GetGlobalGenerator() const;
 
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 452a610..f2f43e3 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -311,6 +311,10 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(
           dir += "/";
         }
       }
+
+      if (cmSystemTools::IsOn(target->GetProperty("EXCLUDE_FROM_ALL"))) {
+        fout << "{comment} ";
+      }
       fout << dir << projName << FILE_EXTENSION;
       fout << " " << projType << std::endl;
     }
@@ -441,21 +445,6 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(std::ostream& fout)
   }
 }
 
-bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmGeneratorTarget* tgt)
-{
-  const std::string config =
-    tgt->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
-  std::vector<cmSourceFile*> tgtSources;
-  tgt->GetSourceFiles(tgtSources, config);
-  bool tgtInBuild = true;
-  char const* excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL");
-  if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
-      '\0' == excludeFromAll[1]) {
-    tgtInBuild = false;
-  }
-  return !tgtSources.empty() && tgtInBuild;
-}
-
 std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const& str)
 {
   std::string result;
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 71c0b48..d926575 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -111,8 +111,6 @@ private:
   void WriteSubProjects(std::ostream& fout, cmLocalGenerator* root,
                         std::vector<cmLocalGenerator*>& generators);
 
-  bool IsTgtForBuild(const cmGeneratorTarget* tgt);
-
   std::string trimQuotes(std::string const& str);
 
   static const char* DEFAULT_BUILD_PROGRAM;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=702121c5f3eceeb6b74ede845f1e1297cf113c47
commit 702121c5f3eceeb6b74ede845f1e1297cf113c47
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:22 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:35 2019 -0500

    GHS: Use the correct compiler flags for CMAKE_BUILD_TYPE
    
    -- Do not use CMAKE_C_FLAGS_RELEASE flags when CMAKE_BUILD_TYPE is empty
       if CMAKE_BUILD_TYPE was not set the generator would use Release settings
       this does not match the documented behavior of CMAKE_BUILD_TYPE
    
    -- CMAKE_C_FLAGS_<CONFIG> not used when -kernel is present
       Fixes issue where CMAKE_C_FLAGS_<CONFIG> is ignored when -kernel option is present as a compiler option
       When the -kernel option is added to an executable it uses a different set of language flags
       This does not occur -kernel=<type> is used or if it is added as part of a link flag
       The variables CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG> are removed
       NOTE: By default this only added the flag -ldebug which links in the debugger library.
    
    -- Separate compiler options by newlines

diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index e464b0c..122be3a 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -482,11 +482,6 @@ Variables for Languages
    /variable/CMAKE_LANG_FLAGS_RELEASE_INIT
    /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO
    /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT
-   /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG
-   /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG
-   /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL
-   /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE
-   /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO
    /variable/CMAKE_LANG_IGNORE_EXTENSIONS
    /variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES
    /variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
deleted file mode 100644
index 8ed1c02..0000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>
---------------------------------------
-
-GHS kernel flags for language ``<LANG>`` when building for the ``<CONFIG>``
-configuration.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
deleted file mode 100644
index 4fea67a..0000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_DEBUG
------------------------------------
-
-This variable is the ``Debug`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
deleted file mode 100644
index 31f87f2..0000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_MINSIZEREL
-----------------------------------------
-
-This variable is the ``MinSizeRel`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
deleted file mode 100644
index 1acd198..0000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELEASE
--------------------------------------
-
-This variable is the ``Release`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
deleted file mode 100644
index ac1b6bc..0000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELWITHDEBINFO
---------------------------------------------
-
-This variable is the ``RelWithDebInfo`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake
index c30bdec..a825b0b 100644
--- a/Modules/Compiler/GHS-C.cmake
+++ b/Modules/Compiler/GHS-C.cmake
@@ -8,23 +8,3 @@ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -Odebug -g")
 string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -Ospace")
 string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -O")
 string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -O -g")
-
-set(CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT "-ldebug ${CMAKE_C_FLAGS_DEBUG_INIT}")
-set(CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT}")
-set(CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}")
-set(CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT
-  "-ldebug ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}")
-
-if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
-  set (CMAKE_C_GHS_KERNEL_FLAGS_DEBUG "${CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT}"
-    CACHE STRING "Kernel flags used by the compiler during debug builds.")
-  set (CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL
-    "${CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING
-    "Kernel flags used by the compiler during release builds for minimum size.")
-  set (CMAKE_C_GHS_KERNEL_FLAGS_RELEASE
-    "${CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT}"
-    CACHE STRING "Kernel flags used by the compiler during release builds.")
-  set (CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO
-    "${CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
-    "Kernel flags used by the compiler during release builds with debug info.")
-endif()
diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake
index b3018a7..07b5044 100644
--- a/Modules/Compiler/GHS-CXX.cmake
+++ b/Modules/Compiler/GHS-CXX.cmake
@@ -8,27 +8,3 @@ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -Odebug -g")
 string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -Ospace")
 string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -O")
 string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -O -g")
-
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT
-  "-ldebug ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT
-  "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}")
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT
-  "${CMAKE_CXX_FLAGS_RELEASE_INIT}")
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT
-  "-ldebug ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}")
-
-if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
-  set (CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG
-    "${CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT}"
-    CACHE STRING "Kernel flags used by the compiler during debug builds.")
-  set (CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL
-    "${CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING
-    "Kernel flags used by the compiler during release builds for minimum size.")
-  set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE
-    "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT}"
-    CACHE STRING "Kernel flags used by the compiler during release builds.")
-  set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO
-    "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
-    "Kernel flags used by the compiler during release builds with debug info.")
-endif()
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 305e494..0cd6312 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -121,25 +121,19 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
 
     this->GetGlobalGenerator()->WriteFileHeader(fout);
     GhsMultiGpj::WriteGpjTag(this->TagType, fout);
-
-    std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-    if (0 == config.length()) {
-      config = "RELEASE";
-    }
     const std::string language(
-      this->GeneratorTarget->GetLinkerLanguage(config));
-    config = cmSystemTools::UpperCase(config);
-    this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
+      this->GeneratorTarget->GetLinkerLanguage(this->ConfigName));
+    this->DynamicDownload =
+      this->DetermineIfDynamicDownload(this->ConfigName, language);
     if (this->DynamicDownload) {
       fout << "#component integrity_dynamic_download" << std::endl;
     }
-    bool const notKernel = this->IsNotKernel(config, language);
-    this->WriteTargetSpecifics(fout, config, notKernel);
-    this->SetCompilerFlags(config, language, notKernel);
-    this->WriteCompilerFlags(fout, config, language);
-    this->WriteCompilerDefinitions(fout, config, language);
-    this->WriteIncludes(fout, config, language);
-    this->WriteTargetLinkLine(fout, config);
+    this->WriteTargetSpecifics(fout, this->ConfigName);
+    this->SetCompilerFlags(this->ConfigName, language);
+    this->WriteCompilerFlags(fout, this->ConfigName, language);
+    this->WriteCompilerDefinitions(fout, this->ConfigName, language);
+    this->WriteIncludes(fout, this->ConfigName, language);
+    this->WriteTargetLinkLine(fout, this->ConfigName);
     this->WriteCustomCommands(fout);
     this->WriteSources(fout);
 
@@ -162,8 +156,7 @@ bool cmGhsMultiTargetGenerator::IncludeThisTarget()
 std::vector<cmSourceFile*> cmGhsMultiTargetGenerator::GetSources() const
 {
   std::vector<cmSourceFile*> output;
-  std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
-  this->GeneratorTarget->GetSourceFiles(output, config);
+  this->GeneratorTarget->GetSourceFiles(output, this->ConfigName);
   return output;
 }
 
@@ -175,8 +168,7 @@ cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
 }
 
 void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
-                                                     const std::string& config,
-                                                     bool const notKernel)
+                                                     const std::string& config)
 {
   std::string outpath;
   std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
@@ -193,8 +185,7 @@ void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
 }
 
 void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
-                                                 const std::string& language,
-                                                 bool const notKernel)
+                                                 const std::string& language)
 {
   std::map<std::string, std::string>::iterator i =
     this->FlagsByLanguage.find(language);
@@ -202,14 +193,9 @@ void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
     std::string flags;
     const char* lang = language.c_str();
 
-    if (notKernel) {
-      this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
-                                             lang, config);
-    } else {
-      this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
-                                             lang + std::string("_GHS_KERNEL"),
-                                             config);
-    }
+    this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget, lang,
+                                           config);
+
     this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget, lang,
                                           config);
     this->LocalGenerator->AddVisibilityPresetFlags(
@@ -260,7 +246,11 @@ void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::ostream& fout,
     this->FlagsByLanguage.find(language);
   if (flagsByLangI != this->FlagsByLanguage.end()) {
     if (!flagsByLangI->second.empty()) {
-      fout << "    " << flagsByLangI->second << std::endl;
+      std::vector<std::string> ghsCompFlags =
+        cmSystemTools::ParseArguments(flagsByLangI->second.c_str());
+      for (auto& f : ghsCompFlags) {
+        fout << "    " << f << std::endl;
+      }
     }
   }
 }
@@ -618,17 +608,6 @@ std::string cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
   return dir_max;
 }
 
-bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const& config,
-                                            const std::string& language)
-{
-  bool output;
-  std::vector<std::string> options;
-  this->GeneratorTarget->GetCompileOptions(options, config, language);
-  output =
-    options.end() == std::find(options.begin(), options.end(), "-kernel");
-  return output;
-}
-
 bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
   const cmGeneratorTarget* target)
 {
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 358e1f4..343044a 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -34,15 +34,16 @@ private:
 
   bool IsTargetGroup() const { return this->TargetGroup; }
 
-  void WriteTargetSpecifics(std::ostream& fout, const std::string& config,
-                            bool notKernel);
+  void WriteTargetSpecifics(std::ostream& fout, const std::string& config);
+
   void WriteCompilerFlags(std::ostream& fout, const std::string& config,
                           const std::string& language);
   void WriteCompilerDefinitions(std::ostream& fout, const std::string& config,
                                 const std::string& language);
 
-  void SetCompilerFlags(std::string const& config, const std::string& language,
-                        bool const notKernel);
+  void SetCompilerFlags(std::string const& config,
+                        const std::string& language);
+
   std::string GetDefines(const std::string& langugae,
                          std::string const& config);
 
@@ -65,7 +66,6 @@ private:
     cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
     cmGeneratorTarget* generatorTarget, cmSourceFile* const sourceFile);
 
-  bool IsNotKernel(std::string const& config, const std::string& language);
   static bool DetermineIfTargetGroup(const cmGeneratorTarget* target);
   bool DetermineIfDynamicDownload(std::string const& config,
                                   const std::string& language);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2a72ec72d609547d2278701a56237822c0dcc92
commit b2a72ec72d609547d2278701a56237822c0dcc92
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:22 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:31 2019 -0500

    GHS: Cleanup unused file handling functions and file output updates
    
    -- File handling cleanup
    -- Rename some functions to clarify what they do
    -- Update to source file path conversion; only perform conversion when using windows

diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx
index c0f37ba..c1f0742 100644
--- a/Source/cmGhsMultiGpj.cxx
+++ b/Source/cmGhsMultiGpj.cxx
@@ -29,10 +29,9 @@ const char* GhsMultiGpj::GetGpjTag(Types const gpjType)
   return tag;
 }
 
-void GhsMultiGpj::WriteGpjTag(Types const gpjType,
-                              cmGeneratedFileStream* const filestream)
+void GhsMultiGpj::WriteGpjTag(Types const gpjType, std::ostream& fout)
 {
   char const* tag;
   tag = GhsMultiGpj::GetGpjTag(gpjType);
-  *filestream << tag << std::endl;
+  fout << tag << std::endl;
 }
diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h
index 014f6b6..6d59225 100644
--- a/Source/cmGhsMultiGpj.h
+++ b/Source/cmGhsMultiGpj.h
@@ -4,6 +4,7 @@
 #define cmGhsMultiGpj_h
 
 #include "cmConfigure.h" // IWYU pragma: keep
+#include <iosfwd>
 
 class cmGeneratedFileStream;
 
@@ -20,8 +21,7 @@ public:
     SUBPROJECT
   };
 
-  static void WriteGpjTag(Types const gpjType,
-                          cmGeneratedFileStream* filestream);
+  static void WriteGpjTag(Types const gpjType, std::ostream& fout);
 
   static const char* GetGpjTag(Types const gpjType);
 };
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index a58e59a..305e494 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -24,19 +24,6 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
   , DynamicDownload(false)
   , Name(target->GetName())
 {
-  this->RelBuildFilePath = this->GetRelBuildFilePath(target);
-
-  this->RelOutputFileName = this->RelBuildFilePath + target->GetName() + ".a";
-
-  this->RelBuildFileName = this->RelBuildFilePath;
-  this->RelBuildFileName += this->GetBuildFileName(target);
-
-  std::string absPathToRoot = this->GetAbsPathToRoot(target);
-  absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
-  this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
-  this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
-  this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName;
-
   // Store the configuration name that is being used
   if (const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) {
     // Use the build type given by the user.
@@ -49,64 +36,6 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
 
 cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
 {
-  cmDeleteAll(this->FolderBuildStreams);
-}
-
-std::string cmGhsMultiTargetGenerator::GetRelBuildFilePath(
-  const cmGeneratorTarget* target)
-{
-  std::string output = target->GetEffectiveFolderName();
-  cmSystemTools::ConvertToUnixSlashes(output);
-  if (!output.empty()) {
-    output += "/";
-  }
-  output += target->GetName() + "/";
-  return output;
-}
-
-std::string cmGhsMultiTargetGenerator::GetAbsPathToRoot(
-  const cmGeneratorTarget* target)
-{
-  return target->GetLocalGenerator()->GetBinaryDirectory();
-}
-
-std::string cmGhsMultiTargetGenerator::GetAbsBuildFilePath(
-  const cmGeneratorTarget* target)
-{
-  std::string output;
-  output = cmGhsMultiTargetGenerator::GetAbsPathToRoot(target);
-  output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output);
-  output += cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
-  return output;
-}
-
-std::string cmGhsMultiTargetGenerator::GetRelBuildFileName(
-  const cmGeneratorTarget* target)
-{
-  std::string output;
-  output = cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
-  output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output);
-  output += cmGhsMultiTargetGenerator::GetBuildFileName(target);
-  return output;
-}
-
-std::string cmGhsMultiTargetGenerator::GetBuildFileName(
-  const cmGeneratorTarget* target)
-{
-  std::string output;
-  output = target->GetName();
-  output += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
-  return output;
-}
-
-std::string cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(
-  std::string const& input)
-{
-  std::string output(input);
-  if (!cmHasLiteralSuffix(output, "/")) {
-    output += "/";
-  }
-  return output;
 }
 
 void cmGhsMultiTargetGenerator::Generate()
@@ -190,7 +119,8 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
     cmGeneratedFileStream fout(fname.c_str());
     fout.SetCopyIfDifferent(true);
 
-    cmGlobalGhsMultiGenerator::OpenBuildFileStream(&fout);
+    this->GetGlobalGenerator()->WriteFileHeader(fout);
+    GhsMultiGpj::WriteGpjTag(this->TagType, fout);
 
     std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
     if (0 == config.length()) {
@@ -203,9 +133,6 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
     if (this->DynamicDownload) {
       fout << "#component integrity_dynamic_download" << std::endl;
     }
-    GhsMultiGpj::WriteGpjTag(this->TagType, &fout);
-    cmGlobalGhsMultiGenerator::WriteDisclaimer(&fout);
-
     bool const notKernel = this->IsNotKernel(config, language);
     this->WriteTargetSpecifics(fout, config, notKernel);
     this->SetCompilerFlags(config, language, notKernel);
@@ -614,11 +541,10 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
       f->SetCopyIfDifferent(true);
       gfiles.push_back(f);
       fout = f;
-      cmGlobalGhsMultiGenerator::OpenBuildFileStream(f);
-      *fout << "[Subproject]" << std::endl;
-      cmGlobalGhsMultiGenerator::WriteDisclaimer(f);
+      this->GetGlobalGenerator()->WriteFileHeader(*f);
+      GhsMultiGpj::WriteGpjTag(GhsMultiGpj::SUBPROJECT, *f);
       fout_proj << lpath << " ";
-      fout_proj << "[Subproject]" << std::endl;
+      GhsMultiGpj::WriteGpjTag(GhsMultiGpj::SUBPROJECT, fout_proj);
     }
 
     if (useProjectFile) {
@@ -631,21 +557,17 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
 
     /* output rule for each source file */
     for (const cmSourceFile* si : groupFiles[sg]) {
-      std::string fullSourcePath(si->GetFullPath());
 
-      if (si->GetExtension() == "int" || si->GetExtension() == "bsp") {
-        *fout << fullSourcePath << std::endl;
-      } else {
-        // WORKAROUND: GHS MULTI needs the path to use backslashes without
-        // quotes
-        //  to open files in search as of version 6.1.6
-        cmsys::SystemTools::ReplaceString(fullSourcePath, "/", "\\");
-        *fout << fullSourcePath << std::endl;
-      }
+      // Convert filename to native system
+      // WORKAROUND: GHS MULTI 6.1.4 and 6.1.6 are known to need backslash on
+      // windows when opening some files from the search window.
+      std::string fname(si->GetFullPath());
+      cmSystemTools::ConvertToOutputSlashes(fname);
+      *fout << fname << std::endl;
 
       if ("ld" != si->GetExtension() && "int" != si->GetExtension() &&
           "bsp" != si->GetExtension()) {
-        this->WriteObjectLangOverride(fout, si);
+        this->WriteObjectLangOverride(*fout, si);
         if (objectNames.end() != objectNames.find(si)) {
           *fout << "    -o \"" << objectNames.find(si)->second << "\""
                 << std::endl;
@@ -660,65 +582,18 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
 }
 
 void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
-  std::ostream* fout, const cmSourceFile* sourceFile)
+  std::ostream& fout, const cmSourceFile* sourceFile)
 {
   const char* rawLangProp = sourceFile->GetProperty("LANGUAGE");
   if (NULL != rawLangProp) {
     std::string sourceLangProp(rawLangProp);
     std::string extension(sourceFile->GetExtension());
     if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) {
-      *fout << "    -dotciscxx" << std::endl;
+      fout << "    -dotciscxx" << std::endl;
     }
   }
 }
 
-std::string cmGhsMultiTargetGenerator::GetOutputDirectory(
-  const std::string& config) const
-{
-  std::string outputDir(AbsBuildFilePath);
-
-  const char* runtimeOutputProp =
-    this->GeneratorTarget->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
-  if (NULL != runtimeOutputProp) {
-    outputDir = runtimeOutputProp;
-  }
-
-  std::string configCapped(cmSystemTools::UpperCase(config));
-  const char* runtimeOutputSProp = this->GeneratorTarget->GetProperty(
-    "RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
-  if (NULL != runtimeOutputSProp) {
-    outputDir = runtimeOutputSProp;
-  }
-  cmSystemTools::ConvertToUnixSlashes(outputDir);
-
-  if (!outputDir.empty()) {
-    outputDir += "/";
-  }
-
-  return outputDir;
-}
-
-std::string cmGhsMultiTargetGenerator::GetOutputFilename(
-  const std::string& config) const
-{
-  std::string outputFilename(this->GeneratorTarget->GetName());
-
-  const char* outputNameProp =
-    this->GeneratorTarget->GetProperty("OUTPUT_NAME");
-  if (NULL != outputNameProp) {
-    outputFilename = outputNameProp;
-  }
-
-  std::string configCapped(cmSystemTools::UpperCase(config));
-  const char* outputNameSProp =
-    this->GeneratorTarget->GetProperty(configCapped + "_OUTPUT_NAME");
-  if (NULL != outputNameSProp) {
-    outputFilename = outputNameSProp;
-  }
-
-  return outputFilename;
-}
-
 std::string cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
   cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
   cmGeneratorTarget* const generatorTarget, cmSourceFile* const sourceFile)
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index df1c683..358e1f4 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -26,36 +26,10 @@ public:
 
   bool IncludeThisTarget();
   std::vector<cmSourceFile*> GetSources() const;
-  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();
-  }
-
-  static std::string GetRelBuildFilePath(const cmGeneratorTarget* target);
-  static std::string GetAbsPathToRoot(const cmGeneratorTarget* target);
-  static std::string GetAbsBuildFilePath(const cmGeneratorTarget* target);
-  static std::string GetRelBuildFileName(const cmGeneratorTarget* target);
-  static std::string GetBuildFileName(const cmGeneratorTarget* target);
-  static std::string AddSlashIfNeededToPath(std::string const& input);
 
 private:
   cmGlobalGhsMultiGenerator* GetGlobalGenerator() const;
-  cmGeneratedFileStream* GetFolderBuildStreams()
-  {
-    return this->FolderBuildStreams[""];
-  };
+
   void GenerateTarget();
 
   bool IsTargetGroup() const { return this->TargetGroup; }
@@ -84,10 +58,9 @@ private:
     std::vector<cmSourceFile*>* objectSources,
     cmLocalGhsMultiGenerator* localGhsMultiGenerator,
     cmGeneratorTarget* generatorTarget);
-  static void WriteObjectLangOverride(std::ostream* fout,
+  static void WriteObjectLangOverride(std::ostream& fout,
                                       const cmSourceFile* sourceFile);
-  std::string GetOutputDirectory(const std::string& config) const;
-  std::string GetOutputFilename(const std::string& config) const;
+
   static std::string ComputeLongestObjectDirectory(
     cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
     cmGeneratorTarget* generatorTarget, cmSourceFile* const sourceFile);
@@ -100,13 +73,6 @@ private:
   cmGeneratorTarget* GeneratorTarget;
   cmLocalGhsMultiGenerator* LocalGenerator;
   cmMakefile* Makefile;
-  std::string AbsBuildFilePath;
-  std::string RelBuildFilePath;
-  std::string AbsBuildFileName;
-  std::string RelBuildFileName;
-  std::string RelOutputFileName;
-  std::string AbsOutputFileName;
-  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 7d1e594..452a610 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -25,7 +25,6 @@ cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake* cm)
 
 cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator()
 {
-  cmDeleteAll(TargetFolderBuildStreams);
 }
 
 cmLocalGenerator* cmGlobalGhsMultiGenerator::CreateLocalGenerator(
@@ -204,40 +203,28 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
   }
 }
 
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
-  std::string const& filepath, cmGeneratedFileStream** filestream)
-{
-  // Get a stream where to generate things.
-  if (NULL == *filestream) {
-    *filestream = new cmGeneratedFileStream(filepath.c_str());
-    if (NULL != *filestream) {
-      OpenBuildFileStream(*filestream);
-    }
-  }
-}
-
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
-  cmGeneratedFileStream* filestream)
-{
-  *filestream << "#!gbuild" << std::endl;
-}
-/* temporary until all file handling is cleaned up */
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream(std::ostream& fout)
+void cmGlobalGhsMultiGenerator::WriteFileHeader(std::ostream& fout)
 {
   fout << "#!gbuild" << std::endl;
+  fout << "#" << std::endl
+       << "# CMAKE generated file: DO NOT EDIT!" << std::endl
+       << "# Generated by \"" << this->GetActualName() << "\""
+       << " Generator, CMake Version " << cmVersion::GetMajorVersion() << "."
+       << cmVersion::GetMinorVersion() << std::endl
+       << "#" << std::endl
+       << std::endl;
 }
 
 void cmGlobalGhsMultiGenerator::WriteTopLevelProject(
   std::ostream& fout, cmLocalGenerator* root,
   std::vector<cmLocalGenerator*>& generators)
 {
-  OpenBuildFileStream(fout);
+  WriteFileHeader(fout);
 
   this->WriteMacros(fout);
   this->WriteHighLevelDirectives(fout);
-  // GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, &fout);
-  fout << "[Project]" << std::endl;
-  this->WriteDisclaimer(&fout);
+  GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, fout);
+
   fout << "# Top Level Project File" << std::endl;
 
   // Specify BSP option if supplied by user
@@ -330,17 +317,6 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(
   }
 }
 
-void cmGlobalGhsMultiGenerator::CloseBuildFileStream(
-  cmGeneratedFileStream** filestream)
-{
-  if (filestream) {
-    delete *filestream;
-    *filestream = NULL;
-  } else {
-    cmSystemTools::Error("Build file stream was not open.");
-  }
-}
-
 void cmGlobalGhsMultiGenerator::Generate()
 {
   // first do the superclass method
@@ -465,116 +441,6 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(std::ostream& fout)
   }
 }
 
-void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream* os)
-{
-  (*os) << "#" << std::endl
-        << "# CMAKE generated file: DO NOT EDIT!" << std::endl
-        << "# Generated by \"" << GetActualName() << "\""
-        << " Generator, CMake Version " << cmVersion::GetMajorVersion() << "."
-        << cmVersion::GetMinorVersion() << std::endl
-        << "#" << std::endl;
-}
-
-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)
-{
-  std::string workingPath(path);
-  cmSystemTools::ConvertToUnixSlashes(workingPath);
-  std::vector<std::string> splitPath = cmSystemTools::SplitString(workingPath);
-  std::string workingRelPath(relPath);
-  cmSystemTools::ConvertToUnixSlashes(workingRelPath);
-  if (!workingRelPath.empty()) {
-    workingRelPath += "/";
-  }
-  std::string pathUpTo;
-  for (std::vector<std::string>::const_iterator splitPathI = splitPath.begin();
-       splitPath.end() != splitPathI; ++splitPathI) {
-    pathUpTo += *splitPathI;
-    if (targetFolderBuildStreams->end() ==
-        targetFolderBuildStreams->find(pathUpTo)) {
-      AddFilesUpToPathNewBuildFile(
-        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);
-    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)
-{
-  // create folders up to file path
-  std::string absPath = std::string(homeOutputDirectory) + "/" + relPath;
-  std::string newPath = absPath + pathUpTo;
-  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]);
-  WriteDisclaimer((*targetFolderBuildStreams)[pathUpTo]);
-
-  // Add to main build file
-  if (isFirst) {
-    *mainBuildFile << relFilename << " ";
-    GhsMultiGpj::WriteGpjTag(projType, mainBuildFile);
-  }
-}
-
-void cmGlobalGhsMultiGenerator::AddFilesUpToPathAppendNextFile(
-  std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
-  std::string const& pathUpTo,
-  std::vector<std::string>::const_iterator splitPathI,
-  std::vector<std::string>::const_iterator end,
-  GhsMultiGpj::Types const projType)
-{
-  std::vector<std::string>::const_iterator splitPathNextI = splitPathI + 1;
-  if (end != splitPathNextI &&
-      targetFolderBuildStreams->end() ==
-        targetFolderBuildStreams->find(pathUpTo + "/" + *splitPathNextI)) {
-    std::string nextFilename(*splitPathNextI);
-    nextFilename = GetFileNameFromPath(nextFilename);
-    *(*targetFolderBuildStreams)[pathUpTo] << nextFilename << " ";
-    GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]);
-  }
-}
-
-std::string cmGlobalGhsMultiGenerator::GetFileNameFromPath(
-  std::string const& path)
-{
-  std::string output(path);
-  if (!path.empty()) {
-    cmSystemTools::ConvertToUnixSlashes(output);
-    std::vector<std::string> splitPath = cmSystemTools::SplitString(output);
-    output += "/" + splitPath.back() + FILE_EXTENSION;
-  }
-  return output;
-}
-
 bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmGeneratorTarget* tgt)
 {
   const std::string config =
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index d992f89..71c0b48 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -65,29 +65,8 @@ public:
 
   void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const override;
 
-  cmGeneratedFileStream* GetBuildFileStream()
-  {
-    return this->TargetFolderBuildStreams[""];
-  }
-
-  static void OpenBuildFileStream(std::string const& filepath,
-                                  cmGeneratedFileStream** filestream);
-  static void OpenBuildFileStream(cmGeneratedFileStream* filestream);
-  void OpenBuildFileStream(std::ostream& fout);
-  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 this->LibDirs; }
-
-  static void AddFilesUpToPath(
-    cmGeneratedFileStream* mainBuildFile,
-    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 std::string trimQuotes(std::string const& str);
+  // Write the common disclaimer text at the top of each build file.
+  void WriteFileHeader(std::ostream& fout);
 
   // Target dependency sorting
   class TargetSet : public std::set<cmGeneratorTarget const*>
@@ -132,24 +111,9 @@ private:
   void WriteSubProjects(std::ostream& fout, cmLocalGenerator* root,
                         std::vector<cmLocalGenerator*>& generators);
 
-  static void AddFilesUpToPathNewBuildFile(
-    cmGeneratedFileStream* mainBuildFile,
-    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::string const& pathUpTo,
-    std::vector<std::string>::const_iterator splitPathI,
-    std::vector<std::string>::const_iterator end, GhsMultiGpj::Types projType);
-  static std::string GetFileNameFromPath(std::string const& path);
-
   bool IsTgtForBuild(const cmGeneratorTarget* tgt);
 
-  std::vector<cmGeneratedFileStream*> TargetSubProjects;
-  std::map<std::string, cmGeneratedFileStream*> TargetFolderBuildStreams;
-
-  std::vector<std::string> LibDirs;
+  std::string trimQuotes(std::string const& str);
 
   static const char* DEFAULT_BUILD_PROGRAM;
   static const char* DEFAULT_TOOLSET_ROOT;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=595932c4f0570ab6bdef0a50a321877ffa9c50e4
commit 595932c4f0570ab6bdef0a50a321877ffa9c50e4
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:21 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:27 2019 -0500

    GHS: Update the link line processing
    
    -- add missing executable linker libs from:
       CMAKE_C_STANDARD_LIBRARIES
    -- add missed transitive link libraries
    -- add skipped library linker options
    -- The linker expects -l../relative/path/to/lib.a to be relative to the top-level project
       Because there can be multiple top-level projects convert the path to an absolute path to target

diff --git a/Modules/Compiler/GHS.cmake b/Modules/Compiler/GHS.cmake
index 0583a23..b41c3eb 100644
--- a/Modules/Compiler/GHS.cmake
+++ b/Modules/Compiler/GHS.cmake
@@ -4,5 +4,5 @@ endif()
 set(__COMPILER_GHS 1)
 
 set(CMAKE_EXECUTABLE_SUFFIX "")
-set(CMAKE_LIBRARY_PATH_TERMINATOR "\n")
-set(CMAKE_LIBRARY_PATH_FLAG "  -L")
+set(CMAKE_LIBRARY_PATH_TERMINATOR "")
+set(CMAKE_LIBRARY_PATH_FLAG "")
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 7d2af09..a58e59a 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -212,9 +212,7 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
     this->WriteCompilerFlags(fout, config, language);
     this->WriteCompilerDefinitions(fout, config, language);
     this->WriteIncludes(fout, config, language);
-    if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
-      this->WriteTargetLinkLibraries(fout, config, language);
-    }
+    this->WriteTargetLinkLine(fout, config);
     this->WriteCustomCommands(fout);
     this->WriteSources(fout);
 
@@ -367,59 +365,55 @@ void cmGhsMultiTargetGenerator::WriteIncludes(std::ostream& fout,
   }
 }
 
-void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
-  std::ostream& fout, std::string const& config, std::string const& language)
+void cmGhsMultiTargetGenerator::WriteTargetLinkLine(std::ostream& fout,
+                                                    std::string const& config)
 {
-  // library directories
-  cmTargetDependSet tds =
-    this->GetGlobalGenerator()->GetTargetDirectDepends(this->GeneratorTarget);
-  for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
-       ++tdsI) {
-    const cmGeneratorTarget* tg = *tdsI;
-    fout << "    -L\"" << GetAbsBuildFilePath(tg) << "\"" << std::endl;
-  }
-  // library targets
-  cmTarget::LinkLibraryVectorType llv =
-    this->GeneratorTarget->Target->GetOriginalLinkLibraries();
-  for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin();
-       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) {
-      libName = tg->GetName() + ".a";
-    }
-    fout << "    -l\"" << libName << "\"" << std::endl;
+  if (this->TagType == GhsMultiGpj::INTERGRITY_APPLICATION) {
+    return;
   }
 
-  if (!this->TargetGroup) {
-    std::string linkLibraries;
-    std::string flags;
-    std::string linkFlags;
-    std::string frameworkPath;
-    std::string linkPath;
-    std::string createRule =
-      this->GeneratorTarget->GetCreateRuleVariable(language, config);
-    bool useWatcomQuote =
-      this->Makefile->IsOn(createRule + "_USE_WATCOM_QUOTE");
-    std::unique_ptr<cmLinkLineComputer> linkLineComputer(
-      this->GetGlobalGenerator()->CreateLinkLineComputer(
-        this->LocalGenerator,
-        this->LocalGenerator->GetStateSnapshot().GetDirectory()));
-    linkLineComputer->SetUseWatcomQuote(useWatcomQuote);
-
-    this->LocalGenerator->GetTargetFlags(
-      linkLineComputer.get(), config, linkLibraries, flags, linkFlags,
-      frameworkPath, linkPath, this->GeneratorTarget);
-    linkFlags = cmSystemTools::TrimWhitespace(linkFlags);
-
-    if (!linkPath.empty()) {
-      linkPath = " " + linkPath.substr(0U, linkPath.size() - 1U);
-      fout << linkPath;
-    }
+  std::string linkLibraries;
+  std::string flags;
+  std::string linkFlags;
+  std::string frameworkPath;
+  std::string linkPath;
+
+  std::unique_ptr<cmLinkLineComputer> linkLineComputer(
+    this->GetGlobalGenerator()->CreateLinkLineComputer(
+      this->LocalGenerator,
+      this->LocalGenerator->GetStateSnapshot().GetDirectory()));
+
+  this->LocalGenerator->GetTargetFlags(
+    linkLineComputer.get(), config, linkLibraries, flags, linkFlags,
+    frameworkPath, linkPath, this->GeneratorTarget);
 
-    if (!linkFlags.empty()) {
-      fout << "    " << linkFlags << std::endl;
+  // write out link options
+  std::vector<std::string> lopts =
+    cmSystemTools::ParseArguments(linkFlags.c_str());
+  for (auto& l : lopts) {
+    fout << "    " << l << std::endl;
+  }
+
+  // write out link search paths
+  // must be quoted for paths that contain spaces
+  std::vector<std::string> lpath =
+    cmSystemTools::ParseArguments(linkPath.c_str());
+  for (auto& l : lpath) {
+    fout << "    -L\"" << l << "\"" << std::endl;
+  }
+
+  // write out link libs
+  // must be quoted for filepaths that contains spaces
+  std::string cbd = this->LocalGenerator->GetCurrentBinaryDirectory();
+
+  std::vector<std::string> llibs =
+    cmSystemTools::ParseArguments(linkLibraries.c_str());
+  for (auto& l : llibs) {
+    if (l.compare(0, 2, "-l") == 0) {
+      fout << "    \"" << l << "\"" << std::endl;
+    } else {
+      std::string rl = cmSystemTools::CollapseCombinedPath(cbd, l);
+      fout << "    -l\"" << rl << "\"" << std::endl;
     }
   }
 }
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 4523498..df1c683 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -74,8 +74,7 @@ private:
 
   void WriteIncludes(std::ostream& fout, const std::string& config,
                      const std::string& language);
-  void WriteTargetLinkLibraries(std::ostream& fout, std::string const& config,
-                                std::string const& language);
+  void WriteTargetLinkLine(std::ostream& fout, std::string const& config);
   void WriteCustomCommands(std::ostream& fout);
   void WriteCustomCommandsHelper(
     std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ed2d6b46f9fb8f0742ce60bef16f1d636008136
commit 2ed2d6b46f9fb8f0742ce60bef16f1d636008136
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:21 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:24 2019 -0500

    GHS: Place build system outputs per target output directives
    
    -- Set output and object file locations
    -- Suffixes are no longer being forced but will now follow the target properties
       By default GHS tools have no suffix for executable files so
       CMAKE_EXECUTABLE_SUFFIX was changed to meet this behavior
    -- Remove #if 0 blocked out code; it has been replaced.
       Forcing the -relprog option has been removed from non-kernel executable targets.
       The default value of this option (if it is even available) is determined by the
       tool-chain for the specified target and platform (Some tool-chains default to
       -locatedprogram).  The use of -relprog can have unexpected results as it cannot
       always produce a fully relocated executable.
    -- Clarify use of CMAKE_BUILD_TYPE to control build configuration

diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 1b4960d..4ee1427 100644
--- a/Help/generator/Green Hills MULTI.rst	
+++ b/Help/generator/Green Hills MULTI.rst	
@@ -3,6 +3,9 @@ Green Hills MULTI
 
 Generates Green Hills MULTI project files (experimental, work-in-progress).
 
+The buildsystem has predetermined build-configuration settings that can be controlled
+via the :variable:`CMAKE_BUILD_TYPE` variable.
+
 Customizations that are used to pick toolset and target system:
 
 The ``-A <arch>`` can be supplied for setting the target architecture.
diff --git a/Modules/Compiler/GHS.cmake b/Modules/Compiler/GHS.cmake
index e6a867d..0583a23 100644
--- a/Modules/Compiler/GHS.cmake
+++ b/Modules/Compiler/GHS.cmake
@@ -3,6 +3,6 @@ if(__COMPILER_GHS)
 endif()
 set(__COMPILER_GHS 1)
 
-set(CMAKE_EXECUTABLE_SUFFIX ".as")
+set(CMAKE_EXECUTABLE_SUFFIX "")
 set(CMAKE_LIBRARY_PATH_TERMINATOR "\n")
 set(CMAKE_LIBRARY_PATH_FLAG "  -L")
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 0e0607d..7d2af09 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGhsMultiTargetGenerator.h"
 
+#include "cmComputeLinkInformation.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorTarget.h"
 #include "cmGlobalGhsMultiGenerator.h"
@@ -35,6 +36,15 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
   this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
   this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
   this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName;
+
+  // Store the configuration name that is being used
+  if (const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) {
+    // Use the build type given by the user.
+    this->ConfigName = config;
+  } else {
+    // No configuration type given.
+    this->ConfigName.clear();
+  }
 }
 
 cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
@@ -104,6 +114,13 @@ void cmGhsMultiTargetGenerator::Generate()
   // Determine type of target for this project
   switch (this->GeneratorTarget->GetType()) {
     case cmStateEnums::EXECUTABLE: {
+      // Get the name of the executable to generate.
+      std::string targetName;
+      std::string targetNameImport;
+      std::string targetNamePDB;
+      this->GeneratorTarget->GetExecutableNames(
+        targetName, this->TargetNameReal, targetNameImport, targetNamePDB,
+        this->ConfigName);
       if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
             this->GeneratorTarget)) {
         this->TagType = GhsMultiGpj::INTERGRITY_APPLICATION;
@@ -113,6 +130,13 @@ void cmGhsMultiTargetGenerator::Generate()
       break;
     }
     case cmStateEnums::STATIC_LIBRARY: {
+      std::string targetName;
+      std::string targetNameSO;
+      std::string targetNameImport;
+      std::string targetNamePDB;
+      this->GeneratorTarget->GetLibraryNames(
+        targetName, targetNameSO, this->TargetNameReal, targetNameImport,
+        targetNamePDB, this->ConfigName);
       this->TagType = GhsMultiGpj::LIBRARY;
       break;
     }
@@ -143,6 +167,7 @@ void cmGhsMultiTargetGenerator::Generate()
     default:
       return;
   }
+
   // Tell the global generator the name of the project file
   this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME",
                                              this->Name.c_str());
@@ -182,7 +207,7 @@ void cmGhsMultiTargetGenerator::GenerateTarget()
     cmGlobalGhsMultiGenerator::WriteDisclaimer(&fout);
 
     bool const notKernel = this->IsNotKernel(config, language);
-    this->WriteTypeSpecifics(fout, config, notKernel);
+    this->WriteTargetSpecifics(fout, config, notKernel);
     this->SetCompilerFlags(config, language, notKernel);
     this->WriteCompilerFlags(fout, config, language);
     this->WriteCompilerDefinitions(fout, config, language);
@@ -224,34 +249,22 @@ cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
     this->LocalGenerator->GetGlobalGenerator());
 }
 
-void cmGhsMultiTargetGenerator::WriteTypeSpecifics(std::ostream& fout,
-                                                   const std::string& config,
-                                                   bool const notKernel)
+void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
+                                                     const std::string& config,
+                                                     bool const notKernel)
 {
-  std::string outputDir(this->GetOutputDirectory(config));
-  std::string outputFilename(this->GetOutputFilename(config));
-
-  if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
-    std::string const& static_library_suffix =
-      this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
-    fout << "    -o \"" << outputDir << outputFilename << static_library_suffix
-         << "\"" << std::endl;
-  } else if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
-    if (notKernel && !this->IsTargetGroup()) {
-      fout << "    -relprog" << std::endl;
-    }
-    if (this->IsTargetGroup()) {
-      fout << "    -o \"" << outputDir << outputFilename << ".elf\""
-           << std::endl;
-      fout << "    :extraOutputFile=\"" << outputDir << outputFilename
-           << ".elf.ael\"" << std::endl;
-    } else {
-      std::string const executable_suffix =
-        this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
-      fout << "    -o \"" << outputDir << outputFilename << executable_suffix
-           << "\"" << std::endl;
-    }
-  }
+  std::string outpath;
+  std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
+
+  // set target binary file destination
+  outpath = this->GeneratorTarget->GetDirectory(config);
+  outpath = this->LocalGenerator->ConvertToRelativePath(rootpath, outpath);
+  fout << "    :binDirRelative=\"" << outpath << "\"" << std::endl;
+  fout << "    -o \"" << this->TargetNameReal << "\"" << std::endl;
+
+  // set target object file destination
+  outpath = this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
+  fout << "    :outputDirRelative=\"" << outpath << "\"" << std::endl;
 }
 
 void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
@@ -643,8 +656,6 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
           *fout << "    -o \"" << objectNames.find(si)->second << "\""
                 << std::endl;
         }
-
-        this->WriteObjectDir(*fout, this->AbsBuildFilePath);
       }
     }
   }
@@ -667,18 +678,6 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
   }
 }
 
-void cmGhsMultiTargetGenerator::WriteObjectDir(std::ostream& fout,
-                                               std::string const& dir)
-{
-  std::string workingDir(dir);
-  cmSystemTools::ConvertToUnixSlashes(workingDir);
-  if (!workingDir.empty()) {
-    workingDir += "/";
-  }
-  workingDir += "Objs";
-  fout << "    -object_dir=\"" << workingDir << "\"" << std::endl;
-}
-
 std::string cmGhsMultiTargetGenerator::GetOutputDirectory(
   const std::string& config) const
 {
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 6ba110a..4523498 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -60,8 +60,8 @@ private:
 
   bool IsTargetGroup() const { return this->TargetGroup; }
 
-  void WriteTypeSpecifics(std::ostream& fout, const std::string& config,
-                          bool notKernel);
+  void WriteTargetSpecifics(std::ostream& fout, const std::string& config,
+                            bool notKernel);
   void WriteCompilerFlags(std::ostream& fout, const std::string& config,
                           const std::string& language);
   void WriteCompilerDefinitions(std::ostream& fout, const std::string& config,
@@ -87,7 +87,6 @@ private:
     cmGeneratorTarget* generatorTarget);
   static void WriteObjectLangOverride(std::ostream* fout,
                                       const cmSourceFile* sourceFile);
-  static void WriteObjectDir(std::ostream& fout, std::string const& dir);
   std::string GetOutputDirectory(const std::string& config) const;
   std::string GetOutputFilename(const std::string& config) const;
   static std::string ComputeLongestObjectDirectory(
@@ -115,8 +114,10 @@ private:
   std::map<std::string, std::string> FlagsByLanguage;
   std::map<std::string, std::string> DefinesByLanguage;
 
+  std::string TargetNameReal;
   GhsMultiGpj::Types TagType;
   std::string const Name;
+  std::string ConfigName; /* CMAKE_BUILD_TYPE */
 };
 
 #endif // ! cmGhsMultiTargetGenerator_h
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index f0f1154..7d1e594 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -41,6 +41,18 @@ void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry& entry)
     "Generates Green Hills MULTI files (experimental, work-in-progress).";
 }
 
+void cmGlobalGhsMultiGenerator::ComputeTargetObjectDirectory(
+  cmGeneratorTarget* gt) const
+{
+  // Compute full path to object file directory for this target.
+  std::string dir;
+  dir += gt->LocalGenerator->GetCurrentBinaryDirectory();
+  dir += "/";
+  dir += gt->LocalGenerator->GetTargetDirectory(gt);
+  dir += "/";
+  gt->ObjectDirectory = dir;
+}
+
 bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
                                                     cmMakefile* mf)
 {
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 8b81ba3..d992f89 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -63,6 +63,8 @@ public:
    */
   bool FindMakeProgram(cmMakefile* mf) override;
 
+  void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const override;
+
   cmGeneratedFileStream* GetBuildFileStream()
   {
     return this->TargetFolderBuildStreams[""];
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 3679c3e..b539a1c 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -18,6 +18,15 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator()
 {
 }
 
+std::string cmLocalGhsMultiGenerator::GetTargetDirectory(
+  cmGeneratorTarget const* target) const
+{
+  std::string dir;
+  dir += target->GetName();
+  dir += ".dir";
+  return dir;
+}
+
 void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst(
   cmGeneratorTarget* target, std::vector<cmGeneratorTarget*>& remaining)
 {
diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h
index 8e88205..1f55420 100644
--- a/Source/cmLocalGhsMultiGenerator.h
+++ b/Source/cmLocalGhsMultiGenerator.h
@@ -25,6 +25,9 @@ public:
    */
   virtual void Generate();
 
+  std::string GetTargetDirectory(
+    cmGeneratorTarget const* target) const override;
+
 private:
   void GenerateTargetsDepthFirst(cmGeneratorTarget* target,
                                  std::vector<cmGeneratorTarget*>& remaining);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ead7117afda23d7cf0c1466ce5229d06240d3de0
commit ead7117afda23d7cf0c1466ce5229d06240d3de0
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:21 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:20 2019 -0500

    GHS: Update the top-level project generation
    
    -- Sort targets by name
    -- Generate a top-level project for each project command named as project.top.gpj
       Use the target set for the current project instead of assuming all targets
    -- Add support for building projects not in binary root
    -- Directly create files and pass ostream
    -- Do no generate project files for UTILITY targets; this was never supported
    -- Do no generate project files for OBJECT, SHARED, or MODULE libraries; this was never supported
    -- Update GHS tags to support project types
       NOTE: The default tag is changed to "" because "[ ]" is an invalid token in project file

diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx
index f58cfc1..c0f37ba 100644
--- a/Source/cmGhsMultiGpj.cxx
+++ b/Source/cmGhsMultiGpj.cxx
@@ -4,31 +4,35 @@
 
 #include "cmGeneratedFileStream.h"
 
-void GhsMultiGpj::WriteGpjTag(Types const gpjType,
-                              cmGeneratedFileStream* const filestream)
+static const char* GHS_TAG[] = { "[INTEGRITY Application]",
+                                 "[Library]",
+                                 "[Project]",
+                                 "[Program]",
+                                 "[Reference]",
+                                 "[Subproject]" };
+
+const char* GhsMultiGpj::GetGpjTag(Types const gpjType)
 {
   char const* tag;
   switch (gpjType) {
     case INTERGRITY_APPLICATION:
-      tag = "INTEGRITY Application";
-      break;
     case LIBRARY:
-      tag = "Library";
-      break;
     case PROJECT:
-      tag = "Project";
-      break;
     case PROGRAM:
-      tag = "Program";
-      break;
     case REFERENCE:
-      tag = "Reference";
-      break;
     case SUBPROJECT:
-      tag = "Subproject";
+      tag = GHS_TAG[gpjType];
       break;
     default:
       tag = "";
   }
-  *filestream << "[" << tag << "]" << std::endl;
+  return tag;
+}
+
+void GhsMultiGpj::WriteGpjTag(Types const gpjType,
+                              cmGeneratedFileStream* const filestream)
+{
+  char const* tag;
+  tag = GhsMultiGpj::GetGpjTag(gpjType);
+  *filestream << tag << std::endl;
 }
diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h
index b1eead1..014f6b6 100644
--- a/Source/cmGhsMultiGpj.h
+++ b/Source/cmGhsMultiGpj.h
@@ -22,6 +22,8 @@ public:
 
   static void WriteGpjTag(Types const gpjType,
                           cmGeneratedFileStream* filestream);
+
+  static const char* GetGpjTag(Types const gpjType);
 };
 
 #endif // ! cmGhsMultiGpjType_h
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 4fcc63d..0e0607d 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -101,10 +101,59 @@ std::string cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(
 
 void cmGhsMultiTargetGenerator::Generate()
 {
+  // Determine type of target for this project
+  switch (this->GeneratorTarget->GetType()) {
+    case cmStateEnums::EXECUTABLE: {
+      if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
+            this->GeneratorTarget)) {
+        this->TagType = GhsMultiGpj::INTERGRITY_APPLICATION;
+      } else {
+        this->TagType = GhsMultiGpj::PROGRAM;
+      }
+      break;
+    }
+    case cmStateEnums::STATIC_LIBRARY: {
+      this->TagType = GhsMultiGpj::LIBRARY;
+      break;
+    }
+    case cmStateEnums::SHARED_LIBRARY: {
+      std::string msg = "add_library(<name> SHARED ...) not supported: ";
+      msg += this->Name;
+      cmSystemTools::Message(msg.c_str());
+      return;
+    }
+    case cmStateEnums::OBJECT_LIBRARY: {
+      std::string msg = "add_library(<name> OBJECT ...) not supported: ";
+      msg += this->Name;
+      cmSystemTools::Message(msg.c_str());
+      return;
+    }
+    case cmStateEnums::MODULE_LIBRARY: {
+      std::string msg = "add_library(<name> MODULE ...) not supported: ";
+      msg += this->Name;
+      cmSystemTools::Message(msg.c_str());
+      return;
+    }
+    case cmStateEnums::UTILITY: {
+      std::string msg = "add_custom_target(<name> ...) not supported: ";
+      msg += this->Name;
+      cmSystemTools::Message(msg.c_str());
+      return;
+    }
+    default:
+      return;
+  }
   // Tell the global generator the name of the project file
   this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME",
                                              this->Name.c_str());
+  this->GeneratorTarget->Target->SetProperty(
+    "GENERATOR_FILE_NAME_EXT", GhsMultiGpj::GetGpjTag(this->TagType));
+
+  this->GenerateTarget();
+}
 
+void cmGhsMultiTargetGenerator::GenerateTarget()
+{
   // Skip if empty or not included in build
   if (!this->GetSources().empty() && this->IncludeThisTarget()) {
 
@@ -129,7 +178,7 @@ void cmGhsMultiTargetGenerator::Generate()
     if (this->DynamicDownload) {
       fout << "#component integrity_dynamic_download" << std::endl;
     }
-    GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), &fout);
+    GhsMultiGpj::WriteGpjTag(this->TagType, &fout);
     cmGlobalGhsMultiGenerator::WriteDisclaimer(&fout);
 
     bool const notKernel = this->IsNotKernel(config, language);
@@ -168,25 +217,6 @@ std::vector<cmSourceFile*> cmGhsMultiTargetGenerator::GetSources() const
   return output;
 }
 
-GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const
-{
-  return cmGhsMultiTargetGenerator::GetGpjTag(this->GeneratorTarget);
-}
-
-GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(
-  const cmGeneratorTarget* target)
-{
-  GhsMultiGpj::Types output;
-  if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target)) {
-    output = GhsMultiGpj::INTERGRITY_APPLICATION;
-  } else if (target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-    output = GhsMultiGpj::LIBRARY;
-  } else {
-    output = GhsMultiGpj::PROGRAM;
-  }
-  return output;
-}
-
 cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
   const
 {
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index a54901d..6ba110a 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -26,8 +26,6 @@ public:
 
   bool IncludeThisTarget();
   std::vector<cmSourceFile*> GetSources() const;
-  GhsMultiGpj::Types GetGpjTag() const;
-  static GhsMultiGpj::Types GetGpjTag(const cmGeneratorTarget* target);
   const char* GetAbsBuildFilePath() const
   {
     return this->AbsBuildFilePath.c_str();
@@ -58,6 +56,8 @@ private:
   {
     return this->FolderBuildStreams[""];
   };
+  void GenerateTarget();
+
   bool IsTargetGroup() const { return this->TargetGroup; }
 
   void WriteTypeSpecifics(std::ostream& fout, const std::string& config,
@@ -114,6 +114,8 @@ private:
   static std::string const DDOption;
   std::map<std::string, std::string> FlagsByLanguage;
   std::map<std::string, std::string> DefinesByLanguage;
+
+  GhsMultiGpj::Types TagType;
   std::string const Name;
 };
 
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 92b7661..f0f1154 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -209,25 +209,24 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
 {
   *filestream << "#!gbuild" << std::endl;
 }
+/* temporary until all file handling is cleaned up */
+void cmGlobalGhsMultiGenerator::OpenBuildFileStream(std::ostream& fout)
+{
+  fout << "#!gbuild" << std::endl;
+}
 
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
+void cmGlobalGhsMultiGenerator::WriteTopLevelProject(
+  std::ostream& fout, cmLocalGenerator* root,
+  std::vector<cmLocalGenerator*>& generators)
 {
-  // Compute GHS MULTI's build file path.
-  std::string buildFilePath =
-    this->GetCMakeInstance()->GetHomeOutputDirectory();
-  buildFilePath += "/";
-  buildFilePath +=
-    this->GetCMakeInstance()->GetCurrentSnapshot().GetProjectName();
-  buildFilePath += FILE_EXTENSION;
-
-  this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams);
-  OpenBuildFileStream(GetBuildFileStream());
-
-  this->WriteMacros();
-  this->WriteHighLevelDirectives();
-  GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
-  this->WriteDisclaimer(this->GetBuildFileStream());
-  *this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
+  OpenBuildFileStream(fout);
+
+  this->WriteMacros(fout);
+  this->WriteHighLevelDirectives(fout);
+  // GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, &fout);
+  fout << "[Project]" << std::endl;
+  this->WriteDisclaimer(&fout);
+  fout << "# Top Level Project File" << std::endl;
 
   // Specify BSP option if supplied by user
   // -- not all platforms require this entry in the project file
@@ -256,7 +255,7 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
   }
 
   if (!cmSystemTools::IsOff(bspName.c_str())) {
-    *this->GetBuildFileStream() << "    -bsp " << bspName << std::endl;
+    fout << "    -bsp " << bspName << std::endl;
   }
 
   // Specify OS DIR if supplied by user
@@ -276,8 +275,46 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
   if (!cmSystemTools::IsOff(osDir.c_str()) ||
       platform.find("integrity") != std::string::npos) {
     std::replace(osDir.begin(), osDir.end(), '\\', '/');
-    *this->GetBuildFileStream()
-      << "    " << osDirOption << "\"" << osDir << "\"" << std::endl;
+    fout << "    " << osDirOption << "\"" << osDir << "\"" << std::endl;
+  }
+
+  WriteSubProjects(fout, root, generators);
+}
+
+void cmGlobalGhsMultiGenerator::WriteSubProjects(
+  std::ostream& fout, cmLocalGenerator* root,
+  std::vector<cmLocalGenerator*>& generators)
+{
+  // Collect all targets under this root generator and the transitive
+  // closure of their dependencies.
+  TargetDependSet projectTargets;
+  TargetDependSet originalTargets;
+  this->GetTargetSets(projectTargets, originalTargets, root, generators);
+  OrderedTargetDependSet orderedProjectTargets(projectTargets, "");
+
+  // write out all the sub-projects
+  std::string rootBinaryDir = root->GetCurrentBinaryDirectory();
+  for (cmGeneratorTarget const* target : orderedProjectTargets) {
+    if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+      continue;
+    }
+
+    const char* projName = target->GetProperty("GENERATOR_FILE_NAME");
+    const char* projType = target->GetProperty("GENERATOR_FILE_NAME_EXT");
+    if (projName && projType) {
+      cmLocalGenerator* lg = target->GetLocalGenerator();
+      std::string dir = lg->GetCurrentBinaryDirectory();
+      dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
+      if (dir == ".") {
+        dir.clear();
+      } else {
+        if (dir.back() != '/') {
+          dir += "/";
+        }
+      }
+      fout << dir << projName << FILE_EXTENSION;
+      fout << " " << projType << std::endl;
+    }
   }
 }
 
@@ -294,27 +331,43 @@ void cmGlobalGhsMultiGenerator::CloseBuildFileStream(
 
 void cmGlobalGhsMultiGenerator::Generate()
 {
+  // first do the superclass method
   this->cmGlobalGenerator::Generate();
 
-  if (!this->LocalGenerators.empty()) {
-    this->OpenBuildFileStream();
+  // output top-level projects
+  for (auto& it : this->ProjectMap) {
+    this->OutputTopLevelProject(it.second[0], it.second);
+  }
+}
 
-    // Build all the folder build files
-    for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
-      cmLocalGhsMultiGenerator* lg =
-        static_cast<cmLocalGhsMultiGenerator*>(this->LocalGenerators[i]);
-      const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
-      this->UpdateBuildFiles(tgts);
-    }
+void cmGlobalGhsMultiGenerator::OutputTopLevelProject(
+  cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators)
+{
+  if (generators.empty()) {
+    return;
   }
 
-  cmDeleteAll(TargetFolderBuildStreams);
-  this->TargetFolderBuildStreams.clear();
+  /* Name top-level projects as filename.top.gpj to avoid name clashes
+   * with target projects.  This avoid the issue where the project has
+   * the same name as the executable target.
+   */
+  std::string fname = root->GetCurrentBinaryDirectory();
+  fname += "/";
+  fname += root->GetProjectName();
+  fname += ".top";
+  fname += FILE_EXTENSION;
+
+  cmGeneratedFileStream fout(fname.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  this->WriteTopLevelProject(fout, root, generators);
+
+  fout.Close();
 }
 
 void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
   std::vector<std::string>& makeCommand, const std::string& makeProgram,
-  const std::string& projectName, const std::string& /*projectDir*/,
+  const std::string& projectName, const std::string& projectDir,
   const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
   int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
 {
@@ -332,8 +385,20 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
 
   makeCommand.insert(makeCommand.end(), makeOptions.begin(),
                      makeOptions.end());
+
+  /* determine which top-project file to use */
+  std::string proj = projectName + ".top" + FILE_EXTENSION;
+  std::vector<std::string> files;
+  cmSystemTools::Glob(projectDir, ".*\\.top\\.gpj", files);
+  if (!files.empty()) {
+    auto p = std::find(files.begin(), files.end(), proj);
+    if (p == files.end()) {
+      proj = files.at(0);
+    }
+  }
+
   makeCommand.push_back("-top");
-  makeCommand.push_back(projectName + FILE_EXTENSION);
+  makeCommand.push_back(proj);
   if (!targetName.empty()) {
     if (targetName == "clean") {
       makeCommand.push_back("-clean");
@@ -343,7 +408,7 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
   }
 }
 
-void cmGlobalGhsMultiGenerator::WriteMacros()
+void cmGlobalGhsMultiGenerator::WriteMacros(std::ostream& fout)
 {
   char const* ghsGpjMacros =
     this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS");
@@ -353,12 +418,12 @@ void cmGlobalGhsMultiGenerator::WriteMacros()
     for (std::vector<std::string>::const_iterator expandedListI =
            expandedList.begin();
          expandedListI != expandedList.end(); ++expandedListI) {
-      *this->GetBuildFileStream() << "macro " << *expandedListI << std::endl;
+      fout << "macro " << *expandedListI << std::endl;
     }
   }
 }
 
-void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
+void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(std::ostream& fout)
 {
   /* set primary target */
   std::string tgt;
@@ -378,13 +443,12 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
     tgt += ".tgt";
   }
 
-  *this->GetBuildFileStream() << "primaryTarget=" << tgt << std::endl;
+  fout << "primaryTarget=" << tgt << std::endl;
 
   char const* const customization =
     this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
   if (NULL != customization && strlen(customization) > 0) {
-    *this->GetBuildFileStream()
-      << "customization=" << trimQuotes(customization) << std::endl;
+    fout << "customization=" << trimQuotes(customization) << std::endl;
     this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION");
   }
 }
@@ -499,33 +563,6 @@ std::string cmGlobalGhsMultiGenerator::GetFileNameFromPath(
   return output;
 }
 
-void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
-  const std::vector<cmGeneratorTarget*>& tgts)
-{
-  for (std::vector<cmGeneratorTarget*>::const_iterator tgtsI = tgts.begin();
-       tgtsI != tgts.end(); ++tgtsI) {
-    const cmGeneratorTarget* tgt = *tgtsI;
-    if (IsTgtForBuild(tgt)) {
-      std::string folderName = tgt->GetEffectiveFolderName();
-      if (this->TargetFolderBuildStreams.end() ==
-          this->TargetFolderBuildStreams.find(folderName)) {
-        this->AddFilesUpToPath(
-          GetBuildFileStream(), &this->TargetFolderBuildStreams,
-          this->GetCMakeInstance()->GetHomeOutputDirectory().c_str(),
-          folderName, GhsMultiGpj::PROJECT);
-      }
-      std::vector<std::string> splitPath = cmSystemTools::SplitString(
-        cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt));
-      std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" +
-                                       splitPath.back());
-      *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
-                                                  << " ";
-      GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(tgt),
-                               this->TargetFolderBuildStreams[folderName]);
-    }
-  }
-}
-
 bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmGeneratorTarget* tgt)
 {
   const std::string config =
@@ -552,3 +589,25 @@ std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const& str)
   }
   return result;
 }
+
+bool cmGlobalGhsMultiGenerator::TargetCompare::operator()(
+  cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
+{
+  // Make sure a given named target is ordered first,
+  // e.g. to set ALL_BUILD as the default active project.
+  // When the empty string is named this is a no-op.
+  if (r->GetName() == this->First) {
+    return false;
+  }
+  if (l->GetName() == this->First) {
+    return true;
+  }
+  return l->GetName() < r->GetName();
+}
+
+cmGlobalGhsMultiGenerator::OrderedTargetDependSet::OrderedTargetDependSet(
+  TargetDependSet const& targets, std::string const& first)
+  : derived(TargetCompare(first))
+{
+  this->insert(targets.begin(), targets.end());
+}
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index e0d428e..8b81ba3 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -71,6 +71,7 @@ public:
   static void OpenBuildFileStream(std::string const& filepath,
                                   cmGeneratedFileStream** filestream);
   static void OpenBuildFileStream(cmGeneratedFileStream* filestream);
+  void OpenBuildFileStream(std::ostream& fout);
   static void CloseBuildFileStream(cmGeneratedFileStream** filestream);
   /// Write the common disclaimer text at the top of each build file.
   static void WriteDisclaimer(std::ostream* os);
@@ -86,6 +87,24 @@ public:
 
   static std::string trimQuotes(std::string const& str);
 
+  // Target dependency sorting
+  class TargetSet : public std::set<cmGeneratorTarget const*>
+  {
+  };
+  class TargetCompare
+  {
+    std::string First;
+
+  public:
+    TargetCompare(std::string const& first)
+      : First(first)
+    {
+    }
+    bool operator()(cmGeneratorTarget const* l,
+                    cmGeneratorTarget const* r) const;
+  };
+  class OrderedTargetDependSet;
+
 protected:
   void Generate() override;
   void GenerateBuildCommand(std::vector<std::string>& makeCommand,
@@ -100,10 +119,16 @@ protected:
 
 private:
   void GetToolset(cmMakefile* mf, std::string& tsd, std::string& ts);
-  void OpenBuildFileStream();
 
-  void WriteMacros();
-  void WriteHighLevelDirectives();
+  /* top-level project */
+  void OutputTopLevelProject(cmLocalGenerator* root,
+                             std::vector<cmLocalGenerator*>& generators);
+  void WriteTopLevelProject(std::ostream& fout, cmLocalGenerator* root,
+                            std::vector<cmLocalGenerator*>& generators);
+  void WriteMacros(std::ostream& fout);
+  void WriteHighLevelDirectives(std::ostream& fout);
+  void WriteSubProjects(std::ostream& fout, cmLocalGenerator* root,
+                        std::vector<cmLocalGenerator*>& generators);
 
   static void AddFilesUpToPathNewBuildFile(
     cmGeneratedFileStream* mainBuildFile,
@@ -116,7 +141,7 @@ private:
     std::vector<std::string>::const_iterator splitPathI,
     std::vector<std::string>::const_iterator end, GhsMultiGpj::Types projType);
   static std::string GetFileNameFromPath(std::string const& path);
-  void UpdateBuildFiles(const std::vector<cmGeneratorTarget*>& tgts);
+
   bool IsTgtForBuild(const cmGeneratorTarget* tgt);
 
   std::vector<cmGeneratedFileStream*> TargetSubProjects;
@@ -128,4 +153,17 @@ private:
   static const char* DEFAULT_TOOLSET_ROOT;
 };
 
+class cmGlobalGhsMultiGenerator::OrderedTargetDependSet
+  : public std::multiset<cmTargetDepend,
+                         cmGlobalGhsMultiGenerator::TargetCompare>
+{
+  typedef std::multiset<cmTargetDepend,
+                        cmGlobalGhsMultiGenerator::TargetCompare>
+    derived;
+
+public:
+  typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
+  OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
+};
+
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7825386e2e9e69728e5a5c3dcbc94814bb7cb1c
commit e7825386e2e9e69728e5a5c3dcbc94814bb7cb1c
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:21 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:15 2019 -0500

    GHS: Cleanup how source files are listed
    
    -- Sort the items of the project files, previously they were unsorted
       The layout is similar to Visual Studio projects
    -- Do not make a make a tree of directories and projects files
       The main project file is in the binary folder
       The sub-project files are located in the project object directory
       This is similar to the Makefile generator
    -- Allow the creation of a single project file
       If the variable or target property GHS_NO_SOURCE_GROUP_FILE is set
       then all sources will be listed in the main project file

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 20f3f9e..4fcc63d 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -9,8 +9,8 @@
 #include "cmLocalGhsMultiGenerator.h"
 #include "cmMakefile.h"
 #include "cmSourceFile.h"
+#include "cmSourceGroup.h"
 #include "cmTarget.h"
-#include <assert.h>
 
 std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
 
@@ -106,8 +106,7 @@ void cmGhsMultiTargetGenerator::Generate()
                                              this->Name.c_str());
 
   // Skip if empty or not included in build
-  std::vector<cmSourceFile*> objectSources = this->GetSources();
-  if (!objectSources.empty() && this->IncludeThisTarget()) {
+  if (!this->GetSources().empty() && this->IncludeThisTarget()) {
 
     // Open the filestream in copy-if-different mode.
     std::string fname = this->LocalGenerator->GetCurrentBinaryDirectory();
@@ -143,13 +142,7 @@ void cmGhsMultiTargetGenerator::Generate()
       this->WriteTargetLinkLibraries(fout, config, language);
     }
     this->WriteCustomCommands(fout);
-
-    std::map<const cmSourceFile*, std::string> objectNames =
-      cmGhsMultiTargetGenerator::GetObjectNames(
-        &objectSources, this->LocalGenerator, this->GeneratorTarget);
-#if 0 /* temp stub - this generates its own files */
-    this->WriteSources(objectSources, objectNames);
-#endif
+    this->WriteSources(fout);
 
     fout.Close();
   }
@@ -481,44 +474,154 @@ cmGhsMultiTargetGenerator::GetObjectNames(
   return objectNamesCorrected;
 }
 
-void cmGhsMultiTargetGenerator::WriteSources(
-  std::vector<cmSourceFile*> const& objectSources,
-  std::map<const cmSourceFile*, std::string> const& objectNames)
+void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
 {
-  for (const cmSourceFile* sf : objectSources) {
-    std::vector<cmSourceGroup> sourceGroups(this->Makefile->GetSourceGroups());
-    std::string const& sourceFullPath = sf->GetFullPath();
+  /* vector of all sources for this target */
+  std::vector<cmSourceFile*> sources = this->GetSources();
+
+  /* vector of all groups defined for this target
+   * -- but the vector is not expanded with sub groups or in any useful order
+   */
+  std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
+
+  /* for each source file assign it to its group */
+  std::map<std::string, std::vector<cmSourceFile*>> groupFiles;
+  std::set<std::string> groupNames;
+  for (auto& sf : sources) {
     cmSourceGroup* sourceGroup =
-      this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups);
-    std::string sgPath = sourceGroup->GetFullName();
-    cmSystemTools::ConvertToUnixSlashes(sgPath);
-    cmGlobalGhsMultiGenerator::AddFilesUpToPath(
-      this->GetFolderBuildStreams(), &this->FolderBuildStreams,
-      this->LocalGenerator->GetBinaryDirectory().c_str(), sgPath,
-      GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
-
-    std::string fullSourcePath(sf->GetFullPath());
-    if (sf->GetExtension() == "int" || sf->GetExtension() == "bsp") {
-      *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
+      this->Makefile->FindSourceGroup(sf->GetFullPath(), sourceGroups);
+    std::string gn = sourceGroup->GetFullName();
+    groupFiles[gn].push_back(sf);
+    groupNames.insert(gn);
+  }
+
+  /* list of known groups and the order they are displayed in a project file */
+  const std::vector<std::string> standardGroups = {
+    "Header Files", "Source Files",     "CMake Rules",
+    "Object Files", "Object Libraries", "Resources"
+  };
+
+  /* list of groups in the order they are displayed in a project file*/
+  std::vector<std::string> groupFilesList(groupFiles.size());
+
+  /* put the groups in the order they should be listed
+   * - standard groups first, and then everything else
+   *   in the order used by std::map.
+   */
+  int i = 0;
+  for (const std::string& gn : standardGroups) {
+    auto n = groupNames.find(gn);
+    if (n != groupNames.end()) {
+      groupFilesList[i] = *n;
+      i += 1;
+      groupNames.erase(gn);
+    }
+  }
+
+  { /* catch-all group - is last item */
+    std::string gn = "";
+    auto n = groupNames.find(gn);
+    if (n != groupNames.end()) {
+      groupFilesList.back() = *n;
+      groupNames.erase(gn);
+    }
+  }
+
+  for (auto& n : groupNames) {
+    groupFilesList[i] = n;
+    i += 1;
+  }
+
+  /* sort the files within each group */
+  for (auto& n : groupFilesList) {
+    std::sort(groupFiles[n].begin(), groupFiles[n].end(),
+              [](cmSourceFile* l, cmSourceFile* r) {
+                return l->GetFullPath() < r->GetFullPath();
+              });
+  }
+
+  /* get all the object names for these sources */
+  std::map<const cmSourceFile*, std::string> objectNames =
+    cmGhsMultiTargetGenerator::GetObjectNames(&sources, this->LocalGenerator,
+                                              this->GeneratorTarget);
+
+  /* list of open project files */
+  std::vector<cmGeneratedFileStream*> gfiles;
+
+  /* write files into the proper project file
+   * -- groups go into main project file
+   *    unless FOLDER property or variable is set.
+   */
+  for (auto& sg : groupFilesList) {
+    std::ostream* fout;
+    bool useProjectFile =
+      cmSystemTools::IsOn(
+        this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
+      cmSystemTools::IsOn(
+        this->Makefile->GetDefinition("GHS_NO_SOURCE_GROUP_FILE"));
+    if (useProjectFile || sg.empty()) {
+      fout = &fout_proj;
     } else {
-      // WORKAROUND: GHS MULTI needs the path to use backslashes without quotes
-      //  to open files in search as of version 6.1.6
-      cmsys::SystemTools::ReplaceString(fullSourcePath, "/", "\\");
-      *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
+      // Open the filestream in copy-if-different mode.
+      std::string gname = sg;
+      cmsys::SystemTools::ReplaceString(gname, "\\", "_");
+      std::string lpath =
+        this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
+      lpath += "/";
+      lpath += gname;
+      lpath += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+      std::string fpath = this->LocalGenerator->GetCurrentBinaryDirectory();
+      fpath += "/";
+      fpath += lpath;
+      cmGeneratedFileStream* f = new cmGeneratedFileStream(fpath.c_str());
+      f->SetCopyIfDifferent(true);
+      gfiles.push_back(f);
+      fout = f;
+      cmGlobalGhsMultiGenerator::OpenBuildFileStream(f);
+      *fout << "[Subproject]" << std::endl;
+      cmGlobalGhsMultiGenerator::WriteDisclaimer(f);
+      fout_proj << lpath << " ";
+      fout_proj << "[Subproject]" << std::endl;
+    }
+
+    if (useProjectFile) {
+      if (sg.empty()) {
+        *fout << "{comment} Others" << std::endl;
+      } else {
+        *fout << "{comment} " << sg << std::endl;
+      }
     }
 
-    if ("ld" != sf->GetExtension() && "int" != sf->GetExtension() &&
-        "bsp" != sf->GetExtension()) {
-      this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], sf);
-      if (objectNames.end() != objectNames.find(sf)) {
-        *this->FolderBuildStreams[sgPath]
-          << "    -o \"" << objectNames.find(sf)->second << "\"" << std::endl;
+    /* output rule for each source file */
+    for (const cmSourceFile* si : groupFiles[sg]) {
+      std::string fullSourcePath(si->GetFullPath());
+
+      if (si->GetExtension() == "int" || si->GetExtension() == "bsp") {
+        *fout << fullSourcePath << std::endl;
+      } else {
+        // WORKAROUND: GHS MULTI needs the path to use backslashes without
+        // quotes
+        //  to open files in search as of version 6.1.6
+        cmsys::SystemTools::ReplaceString(fullSourcePath, "/", "\\");
+        *fout << fullSourcePath << std::endl;
       }
 
-      this->WriteObjectDir(this->FolderBuildStreams[sgPath],
-                           this->AbsBuildFilePath + sgPath);
+      if ("ld" != si->GetExtension() && "int" != si->GetExtension() &&
+          "bsp" != si->GetExtension()) {
+        this->WriteObjectLangOverride(fout, si);
+        if (objectNames.end() != objectNames.find(si)) {
+          *fout << "    -o \"" << objectNames.find(si)->second << "\""
+                << std::endl;
+        }
+
+        this->WriteObjectDir(*fout, this->AbsBuildFilePath);
+      }
     }
   }
+
+  for (cmGeneratedFileStream* f : gfiles) {
+    f->Close();
+  }
 }
 
 void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
@@ -534,8 +637,8 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
   }
 }
 
-void cmGhsMultiTargetGenerator::WriteObjectDir(
-  cmGeneratedFileStream* fileStream, std::string const& dir)
+void cmGhsMultiTargetGenerator::WriteObjectDir(std::ostream& fout,
+                                               std::string const& dir)
 {
   std::string workingDir(dir);
   cmSystemTools::ConvertToUnixSlashes(workingDir);
@@ -543,7 +646,7 @@ void cmGhsMultiTargetGenerator::WriteObjectDir(
     workingDir += "/";
   }
   workingDir += "Objs";
-  *fileStream << "    -object_dir=\"" << workingDir << "\"" << std::endl;
+  fout << "    -object_dir=\"" << workingDir << "\"" << std::endl;
 }
 
 std::string cmGhsMultiTargetGenerator::GetOutputDirectory(
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index a80d6b2..a54901d 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -80,17 +80,14 @@ private:
   void WriteCustomCommandsHelper(
     std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
     cmTarget::CustomCommandType commandType);
-  void WriteSources(
-    std::vector<cmSourceFile*> const& objectSources,
-    std::map<const cmSourceFile*, std::string> const& objectNames);
+  void WriteSources(std::ostream& fout_proj);
   static std::map<const cmSourceFile*, std::string> GetObjectNames(
     std::vector<cmSourceFile*>* objectSources,
     cmLocalGhsMultiGenerator* localGhsMultiGenerator,
     cmGeneratorTarget* generatorTarget);
   static void WriteObjectLangOverride(std::ostream* fout,
                                       const cmSourceFile* sourceFile);
-  static void WriteObjectDir(cmGeneratedFileStream* fileStream,
-                             std::string const& dir);
+  static void WriteObjectDir(std::ostream& fout, std::string const& dir);
   std::string GetOutputDirectory(const std::string& config) const;
   std::string GetOutputFilename(const std::string& config) const;
   static std::string ComputeLongestObjectDirectory(
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 1bdb6f3..f06bfbf 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2298,7 +2298,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
       add_test_GhsMulti_rename_install(SINGLE_EXEC_RENAMED)
       add_test_GhsMulti_rename_install(EXEC_AND_LIB)
       add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "" "")
-      add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups Folders "-DCMAKE_FOLDER=ON" "")
+      add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON" "")
+      add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON" "")
       add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "" "")
       set_tests_properties(GhsMulti.${ghs_config_name}.unsupported_targets PROPERTIES TIMEOUT 15)
       add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "" "")
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
index 5043e7f..a4f84ca 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
@@ -32,6 +32,9 @@ add_executable(groups
   standard.h
   )
 
+if(TEST_PROP)
+  set_target_properties(groups PROPERTIES GHS_NO_SOURCE_GROUP_FILE ON)
+endif()
 source_group( gC FILES sub/testOBJ.h testOBJ.c testOBJ.h sub/testOBJ.c )
 source_group( gA FILES test1.c test1.h)
 source_group( gB test[65].c )

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=447b57a2676b5bb7e9f97b15c9fe5fe7d3817a86
commit 447b57a2676b5bb7e9f97b15c9fe5fe7d3817a86
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:20 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:11 2019 -0500

    GHS: Update binary structure so that install scripts work
    
    GHS doesn't follow the binary structure that VS or Makefiles use
    Also setting binary location outputs do not work
    
    -- Update to act like Visual Studio Generator and use its project layout
    -- Fix open/close issues where open() was used instead of Open()
       Now passes the file handle to all function that require it
    -- Avoid triggering MULTI reloads; use SetCopyIfDifferent mode

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 1a25633..20f3f9e 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -21,6 +21,7 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
   , Makefile(target->Target->GetMakefile())
   , TargetGroup(DetermineIfTargetGroup(target))
   , DynamicDownload(false)
+  , Name(target->GetName())
 {
   this->RelBuildFilePath = this->GetRelBuildFilePath(target);
 
@@ -100,15 +101,24 @@ std::string cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(
 
 void cmGhsMultiTargetGenerator::Generate()
 {
+  // Tell the global generator the name of the project file
+  this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME",
+                                             this->Name.c_str());
+
+  // Skip if empty or not included in build
   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,
-                                    &this->FolderBuildStreams);
-    cmGlobalGhsMultiGenerator::OpenBuildFileStream(
-      this->GetFolderBuildStreams());
+
+    // Open the filestream in copy-if-different mode.
+    std::string fname = this->LocalGenerator->GetCurrentBinaryDirectory();
+    fname += "/";
+    fname += this->Name;
+    fname += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+    cmGeneratedFileStream fout(fname.c_str());
+    fout.SetCopyIfDifferent(true);
+
+    cmGlobalGhsMultiGenerator::OpenBuildFileStream(&fout);
+
     std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
     if (0 == config.length()) {
       config = "RELEASE";
@@ -118,28 +128,30 @@ void cmGhsMultiTargetGenerator::Generate()
     config = cmSystemTools::UpperCase(config);
     this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
     if (this->DynamicDownload) {
-      *this->GetFolderBuildStreams()
-        << "#component integrity_dynamic_download" << std::endl;
+      fout << "#component integrity_dynamic_download" << std::endl;
     }
-    GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams());
-    cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams());
+    GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), &fout);
+    cmGlobalGhsMultiGenerator::WriteDisclaimer(&fout);
 
     bool const notKernel = this->IsNotKernel(config, language);
-    this->WriteTypeSpecifics(config, notKernel);
+    this->WriteTypeSpecifics(fout, config, notKernel);
     this->SetCompilerFlags(config, language, notKernel);
-    this->WriteCompilerFlags(config, language);
-    this->WriteCompilerDefinitions(config, language);
-    this->WriteIncludes(config, language);
+    this->WriteCompilerFlags(fout, config, language);
+    this->WriteCompilerDefinitions(fout, config, language);
+    this->WriteIncludes(fout, config, language);
     if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
-      this->WriteTargetLinkLibraries(config, language);
+      this->WriteTargetLinkLibraries(fout, config, language);
     }
-    this->WriteCustomCommands();
+    this->WriteCustomCommands(fout);
 
     std::map<const cmSourceFile*, std::string> objectNames =
       cmGhsMultiTargetGenerator::GetObjectNames(
         &objectSources, this->LocalGenerator, this->GeneratorTarget);
-
+#if 0 /* temp stub - this generates its own files */
     this->WriteSources(objectSources, objectNames);
+#endif
+
+    fout.Close();
   }
 }
 
@@ -189,7 +201,8 @@ cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
     this->LocalGenerator->GetGlobalGenerator());
 }
 
-void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config,
+void cmGhsMultiTargetGenerator::WriteTypeSpecifics(std::ostream& fout,
+                                                   const std::string& config,
                                                    bool const notKernel)
 {
   std::string outputDir(this->GetOutputDirectory(config));
@@ -198,25 +211,22 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config,
   if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
     std::string const& static_library_suffix =
       this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
-    *this->GetFolderBuildStreams()
-      << "    -o \"" << outputDir << outputFilename << static_library_suffix
-      << "\"" << std::endl;
+    fout << "    -o \"" << outputDir << outputFilename << static_library_suffix
+         << "\"" << std::endl;
   } else if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
     if (notKernel && !this->IsTargetGroup()) {
-      *this->GetFolderBuildStreams() << "    -relprog" << std::endl;
+      fout << "    -relprog" << std::endl;
     }
     if (this->IsTargetGroup()) {
-      *this->GetFolderBuildStreams()
-        << "    -o \"" << outputDir << outputFilename << ".elf\"" << std::endl;
-      *this->GetFolderBuildStreams()
-        << "    :extraOutputFile=\"" << outputDir << outputFilename
-        << ".elf.ael\"" << std::endl;
+      fout << "    -o \"" << outputDir << outputFilename << ".elf\""
+           << std::endl;
+      fout << "    :extraOutputFile=\"" << outputDir << outputFilename
+           << ".elf.ael\"" << std::endl;
     } else {
       std::string const executable_suffix =
         this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
-      *this->GetFolderBuildStreams()
-        << "    -o \"" << outputDir << outputFilename << executable_suffix
-        << "\"" << std::endl;
+      fout << "    -o \"" << outputDir << outputFilename << executable_suffix
+           << "\"" << std::endl;
     }
   }
 }
@@ -281,21 +291,21 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string& language,
   return i->second;
 }
 
-void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const&,
+void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::ostream& fout,
+                                                   std::string const&,
                                                    const std::string& language)
 {
   std::map<std::string, std::string>::iterator flagsByLangI =
     this->FlagsByLanguage.find(language);
   if (flagsByLangI != this->FlagsByLanguage.end()) {
     if (!flagsByLangI->second.empty()) {
-      *this->GetFolderBuildStreams()
-        << "    " << flagsByLangI->second << std::endl;
+      fout << "    " << flagsByLangI->second << std::endl;
     }
   }
 }
 
 void cmGhsMultiTargetGenerator::WriteCompilerDefinitions(
-  const std::string& config, const std::string& language)
+  std::ostream& fout, const std::string& config, const std::string& language)
 {
   std::vector<std::string> compileDefinitions;
   this->GeneratorTarget->GetCompileDefinitions(compileDefinitions, config,
@@ -303,11 +313,12 @@ void cmGhsMultiTargetGenerator::WriteCompilerDefinitions(
   for (std::vector<std::string>::const_iterator cdI =
          compileDefinitions.begin();
        cdI != compileDefinitions.end(); ++cdI) {
-    *this->GetFolderBuildStreams() << "    -D" << (*cdI) << std::endl;
+    fout << "    -D" << (*cdI) << std::endl;
   }
 }
 
-void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config,
+void cmGhsMultiTargetGenerator::WriteIncludes(std::ostream& fout,
+                                              const std::string& config,
                                               const std::string& language)
 {
   std::vector<std::string> includes;
@@ -316,13 +327,12 @@ void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config,
 
   for (std::vector<std::string>::const_iterator includes_i = includes.begin();
        includes_i != includes.end(); ++includes_i) {
-    *this->GetFolderBuildStreams()
-      << "    -I\"" << *includes_i << "\"" << std::endl;
+    fout << "    -I\"" << *includes_i << "\"" << std::endl;
   }
 }
 
 void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
-  std::string const& config, std::string const& language)
+  std::ostream& fout, std::string const& config, std::string const& language)
 {
   // library directories
   cmTargetDependSet tds =
@@ -330,8 +340,7 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
   for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
        ++tdsI) {
     const cmGeneratorTarget* tg = *tdsI;
-    *this->GetFolderBuildStreams()
-      << "    -L\"" << GetAbsBuildFilePath(tg) << "\"" << std::endl;
+    fout << "    -L\"" << GetAbsBuildFilePath(tg) << "\"" << std::endl;
   }
   // library targets
   cmTarget::LinkLibraryVectorType llv =
@@ -344,8 +353,7 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
     if (NULL != tg) {
       libName = tg->GetName() + ".a";
     }
-    *this->GetFolderBuildStreams()
-      << "    -l\"" << libName << "\"" << std::endl;
+    fout << "    -l\"" << libName << "\"" << std::endl;
   }
 
   if (!this->TargetGroup) {
@@ -371,25 +379,25 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
 
     if (!linkPath.empty()) {
       linkPath = " " + linkPath.substr(0U, linkPath.size() - 1U);
-      *this->GetFolderBuildStreams() << linkPath;
+      fout << linkPath;
     }
 
     if (!linkFlags.empty()) {
-      *this->GetFolderBuildStreams() << "    " << linkFlags << std::endl;
+      fout << "    " << linkFlags << std::endl;
     }
   }
 }
 
-void cmGhsMultiTargetGenerator::WriteCustomCommands()
+void cmGhsMultiTargetGenerator::WriteCustomCommands(std::ostream& fout)
 {
-  WriteCustomCommandsHelper(this->GeneratorTarget->GetPreBuildCommands(),
+  WriteCustomCommandsHelper(fout, this->GeneratorTarget->GetPreBuildCommands(),
                             cmTarget::PRE_BUILD);
-  WriteCustomCommandsHelper(this->GeneratorTarget->GetPostBuildCommands(),
-                            cmTarget::POST_BUILD);
+  WriteCustomCommandsHelper(
+    fout, this->GeneratorTarget->GetPostBuildCommands(), cmTarget::POST_BUILD);
 }
 
 void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
-  std::vector<cmCustomCommand> const& commandsSet,
+  std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
   cmTarget::CustomCommandType const commandType)
 {
   for (std::vector<cmCustomCommand>::const_iterator commandsSetI =
@@ -400,10 +408,10 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
          commandI != commands.end(); ++commandI) {
       switch (commandType) {
         case cmTarget::PRE_BUILD:
-          *this->GetFolderBuildStreams() << "    :preexecShellSafe=";
+          fout << "    :preexecShellSafe=";
           break;
         case cmTarget::POST_BUILD:
-          *this->GetFolderBuildStreams() << "    :postexecShellSafe=";
+          fout << "    :postexecShellSafe=";
           break;
         default:
           assert("Only pre and post are supported");
@@ -414,15 +422,14 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
         std::string subCommandE =
           this->LocalGenerator->EscapeForShell(*commandLineI, true);
         if (!command.empty()) {
-          *this->GetFolderBuildStreams()
-            << (command.begin() == commandLineI ? "'" : " ");
+          fout << (command.begin() == commandLineI ? "'" : " ");
           // Need to double escape backslashes
           cmSystemTools::ReplaceString(subCommandE, "\\", "\\\\");
         }
-        *this->GetFolderBuildStreams() << subCommandE;
+        fout << subCommandE;
       }
       if (!command.empty()) {
-        *this->GetFolderBuildStreams() << "'" << std::endl;
+        fout << "'" << std::endl;
       }
     }
   }
@@ -515,14 +522,14 @@ void cmGhsMultiTargetGenerator::WriteSources(
 }
 
 void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
-  cmGeneratedFileStream* fileStream, const cmSourceFile* sourceFile)
+  std::ostream* fout, const cmSourceFile* sourceFile)
 {
   const char* rawLangProp = sourceFile->GetProperty("LANGUAGE");
   if (NULL != rawLangProp) {
     std::string sourceLangProp(rawLangProp);
     std::string extension(sourceFile->GetExtension());
     if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) {
-      *fileStream << "    -dotciscxx" << std::endl;
+      *fout << "    -dotciscxx" << std::endl;
     }
   }
 }
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index e936b08..a80d6b2 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -60,10 +60,11 @@ private:
   };
   bool IsTargetGroup() const { return this->TargetGroup; }
 
-  void WriteTypeSpecifics(const std::string& config, bool notKernel);
-  void WriteCompilerFlags(const std::string& config,
+  void WriteTypeSpecifics(std::ostream& fout, const std::string& config,
+                          bool notKernel);
+  void WriteCompilerFlags(std::ostream& fout, const std::string& config,
                           const std::string& language);
-  void WriteCompilerDefinitions(const std::string& config,
+  void WriteCompilerDefinitions(std::ostream& fout, const std::string& config,
                                 const std::string& language);
 
   void SetCompilerFlags(std::string const& config, const std::string& language,
@@ -71,12 +72,13 @@ private:
   std::string GetDefines(const std::string& langugae,
                          std::string const& config);
 
-  void WriteIncludes(const std::string& config, const std::string& language);
-  void WriteTargetLinkLibraries(std::string const& config,
+  void WriteIncludes(std::ostream& fout, const std::string& config,
+                     const std::string& language);
+  void WriteTargetLinkLibraries(std::ostream& fout, std::string const& config,
                                 std::string const& language);
-  void WriteCustomCommands();
+  void WriteCustomCommands(std::ostream& fout);
   void WriteCustomCommandsHelper(
-    std::vector<cmCustomCommand> const& commandsSet,
+    std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
     cmTarget::CustomCommandType commandType);
   void WriteSources(
     std::vector<cmSourceFile*> const& objectSources,
@@ -85,7 +87,7 @@ private:
     std::vector<cmSourceFile*>* objectSources,
     cmLocalGhsMultiGenerator* localGhsMultiGenerator,
     cmGeneratorTarget* generatorTarget);
-  static void WriteObjectLangOverride(cmGeneratedFileStream* fileStream,
+  static void WriteObjectLangOverride(std::ostream* fout,
                                       const cmSourceFile* sourceFile);
   static void WriteObjectDir(cmGeneratedFileStream* fileStream,
                              std::string const& dir);
@@ -115,6 +117,7 @@ private:
   static std::string const DDOption;
   std::map<std::string, std::string> FlagsByLanguage;
   std::map<std::string, std::string> DefinesByLanguage;
+  std::string const Name;
 };
 
 #endif // ! cmGhsMultiTargetGenerator_h
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index ab6774e..3679c3e 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -18,16 +18,32 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator()
 {
 }
 
-void cmLocalGhsMultiGenerator::Generate()
+void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst(
+  cmGeneratorTarget* target, std::vector<cmGeneratorTarget*>& remaining)
 {
-  const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+  if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+    return;
+  }
+  // Find this target in the list of remaining targets.
+  auto it = std::find(remaining.begin(), remaining.end(), target);
+  if (it == remaining.end()) {
+    // This target was already handled.
+    return;
+  }
+  // Remove this target from the list of remaining targets because
+  // we are handling it now.
+  *it = nullptr;
 
-  for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
-       l != tgts.end(); ++l) {
-    if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
-      continue;
+  cmGhsMultiTargetGenerator tg(target);
+  tg.Generate();
+}
+
+void cmLocalGhsMultiGenerator::Generate()
+{
+  std::vector<cmGeneratorTarget*> remaining = this->GetGeneratorTargets();
+  for (auto& t : remaining) {
+    if (t) {
+      GenerateTargetsDepthFirst(t, remaining);
     }
-    cmGhsMultiTargetGenerator tg(*l);
-    tg.Generate();
   }
 }
diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h
index aa842d7..8e88205 100644
--- a/Source/cmLocalGhsMultiGenerator.h
+++ b/Source/cmLocalGhsMultiGenerator.h
@@ -24,6 +24,10 @@ public:
    * Generate the makefile for this directory.
    */
   virtual void Generate();
+
+private:
+  void GenerateTargetsDepthFirst(cmGeneratorTarget* target,
+                                 std::vector<cmGeneratorTarget*>& remaining);
 };
 
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6436080996ae6f2482fdeefcc639dc36fefedfd8
commit 6436080996ae6f2482fdeefcc639dc36fefedfd8
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:20 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:07 2019 -0500

    GHS: Have the top-level project name follow the specified project name

diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 2d875c7..92b7661 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -216,7 +216,8 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
   std::string buildFilePath =
     this->GetCMakeInstance()->GetHomeOutputDirectory();
   buildFilePath += "/";
-  buildFilePath += "default";
+  buildFilePath +=
+    this->GetCMakeInstance()->GetCurrentSnapshot().GetProjectName();
   buildFilePath += FILE_EXTENSION;
 
   this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams);
@@ -313,7 +314,7 @@ void cmGlobalGhsMultiGenerator::Generate()
 
 void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
   std::vector<std::string>& makeCommand, const std::string& makeProgram,
-  const std::string& /*projectName*/, const std::string& /*projectDir*/,
+  const std::string& projectName, const std::string& /*projectDir*/,
   const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
   int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
 {
@@ -331,6 +332,8 @@ void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
 
   makeCommand.insert(makeCommand.end(), makeOptions.begin(),
                      makeOptions.end());
+  makeCommand.push_back("-top");
+  makeCommand.push_back(projectName + FILE_EXTENSION);
   if (!targetName.empty()) {
     if (targetName == "clean") {
       makeCommand.push_back("-clean");
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 4ab4c56..e0d428e 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -13,7 +13,7 @@ class cmGeneratedFileStream;
 class cmGlobalGhsMultiGenerator : public cmGlobalGenerator
 {
 public:
-  /// The default name of GHS MULTI's build file. Typically: monolith.gpj.
+  // The default filename extension of GHS MULTI's build files.
   static const char* FILE_EXTENSION;
 
   cmGlobalGhsMultiGenerator(cmake* cm);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cef3c61fc815393248762c14ba1878aae68394d
commit 5cef3c61fc815393248762c14ba1878aae68394d
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:20 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:41:03 2019 -0500

    GHS: Update test suite
    
    -- Update test suite so that CMake can use multiple toolsets
           CMake_TEST_GreenHillsMULTI_config
           ghs_config_name
           ghs_target_arch
           ghs_tools
           ghs_toolset_name
           ghs_os_root
           ghs_os_dir
           ghs_target_platform
           ghs_bsp_name
    
    -- Change ARM Integrity test to generic Integrity test
       Add Monolithic build test
    
    -- Add other GHS generator tests

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6b166d6..1bdb6f3 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2260,31 +2260,72 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
   endif()
 
   if (CMake_TEST_GreenHillsMULTI)
-    macro(add_test_GhsMulti name primaryTarget bspName)
-      add_test(NAME GhsMulti.${name} COMMAND ${CMAKE_CTEST_COMMAND}
-        --build-and-test
-        "${CMake_SOURCE_DIR}/Tests/GhsMulti"
-        "${CMake_BINARY_DIR}/Tests/GhsMulti/${name}"
-        --build-generator "Green Hills MULTI"
-        --build-project ReturnNum
-        --build-config $<CONFIGURATION>
-        --build-options -DGHS_PRIMARY_TARGET=${primaryTarget}
-        -DGHS_BSP_NAME=${bspName}
-        )
-    endmacro ()
-    add_test_GhsMulti("arm_integrity_simarm" "arm_integrity.tgt" "simarm")
-    add_test_GhsMulti("arm64_integrity_simarm" "arm64_integrity.tgt" "simarm")
-    add_test(NAME GhsMulti.duplicate_source_filenames
+    macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts test_cmd)
+      separate_arguments(_build_opts UNIX_COMMAND ${build_opts})
+      separate_arguments(_test_cmd UNIX_COMMAND ${test_cmd})
+      separate_arguments(_ghs_toolset_extra UNIX_COMMAND ${ghs_toolset_extra})
+      add_test(NAME GhsMulti.${ghs_config_name}.${test_name}
         COMMAND ${CMAKE_CTEST_COMMAND}
         --build-and-test
-        "${CMake_SOURCE_DIR}/Tests/GhsMultiDuplicateSourceFilenames"
-        "${CMake_BINARY_DIR}/Tests/GhsMultiDuplicateSourceFilenames"
+        "${CMake_SOURCE_DIR}/Tests/GhsMulti/${test_dir}"
+        "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}/${test_dir}/${bin_sub_dir}"
         --build-generator "Green Hills MULTI"
-        --build-project ReturnNum
+        --build-project test
         --build-config $<CONFIGURATION>
-        --build-options -DGHS_PRIMARY_TARGET=arm_integrity.tgt
-        -DGHS_BSP_NAME="simarm"
+        --build-options ${ghs_target_arch} ${ghs_toolset_name} ${ghs_toolset_root} ${ghs_target_platform}
+          ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_build_opts} ${_ghs_toolset_extra}
+        --test-command ${_test_cmd}
         )
+    endmacro ()
+    macro(add_test_GhsMulti_rename_install test_name)
+      add_test_GhsMulti( ${test_name} GhsMultiRenameInstall ${test_name}
+        "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" "${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake")
+    endmacro ()
+    foreach(ghs_file IN LISTS CMake_TEST_GreenHillsMULTI_config)
+      # source GHS tools config file
+      if(IS_ABSOLUTE ${ghs_file})
+        include(${ghs_file})
+      else()
+        include(${CMAKE_BINARY_DIR}/${ghs_file})
+      endif()
+      # test integrity build
+      if (NOT ghs_skip_integrity AND (NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity"))
+        add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "" "")
+        add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "" "")
+      endif ()
+      add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "" "")
+      add_test_GhsMulti_rename_install(SINGLE_EXEC)
+      add_test_GhsMulti_rename_install(SINGLE_EXEC_RENAMED)
+      add_test_GhsMulti_rename_install(EXEC_AND_LIB)
+      add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "" "")
+      add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups Folders "-DCMAKE_FOLDER=ON" "")
+      add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "" "")
+      set_tests_properties(GhsMulti.${ghs_config_name}.unsupported_targets PROPERTIES TIMEOUT 15)
+      add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "" "")
+      set_tests_properties(GhsMulti.${ghs_config_name}.object_library PROPERTIES TIMEOUT 15)
+      add_test_GhsMulti(exclude GhsMultiExclude "" ""
+        "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake")
+      add_test_GhsMulti(interface GhsMultiInterface "" "" "")
+      set_tests_properties(GhsMulti.${ghs_config_name}.interface PROPERTIES TIMEOUT 15)
+      add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS" "")
+      add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS" "")
+      add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "" "")
+      add_test_GhsMulti(multiple_projects GhsMultiMultipleProjects "" ""
+        "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake")
+      add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"" "")
+      add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" "")
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
+      #unset ghs config variables
+      unset(ghs_config_name)
+      unset(ghs_target_arch)
+      unset(ghs_toolset_root)
+      unset(ghs_toolset_name)
+      unset(ghs_os_root)
+      unset(ghs_os_dir)
+      unset(ghs_target_platform)
+      unset(ghs_bsp_name)
+      unset(ghs_toolset_extra)
+    endforeach(ghs_file)
   endif ()
 
   if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
diff --git a/Tests/GhsMulti/CMakeLists.txt b/Tests/GhsMulti/CMakeLists.txt
deleted file mode 100644
index 6e15ba9..0000000
--- a/Tests/GhsMulti/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-project(ReturnNum)
-
-add_subdirectory(ReturnNum)
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
new file mode 100644
index 0000000..1436cbb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
@@ -0,0 +1,94 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+message("Copy project")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+  ${CMAKE_CURRENT_BINARY_DIR}/src/CMakeLists.txt COPYONLY)
+
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.c
+  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src
+)
+
+message("Building project")
+try_compile(RESULT
+  ${CMAKE_CURRENT_BINARY_DIR}/build
+  ${CMAKE_CURRENT_BINARY_DIR}/src
+  test
+  CMAKE_FLAGS -DGHS_BSP_NAME=${GHS_BSP_NAME}
+    -DGHS_OS_ROOT=${GHS_OS_ROOT}
+    -DGHS_TOOLSET_ROOT=${GHS_TOOLSET_ROOT}
+    -DGHS_TARGET_PLATFORM=${GHS_TARGET_PLATFORM}
+    -DRUN_TEST=${RUN_TEST}
+    -DCMAKE_BUILD_TYPE=${RUN_TEST_BUILD_TYPE}
+  OUTPUT_VARIABLE OUTPUT)
+
+message("Output from build:\n${OUTPUT}")
+if (RUN_TEST STREQUAL "RELEASE_FLAGS")
+  find_file (fileName test_none.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/build
+    ${CMAKE_CURRENT_BINARY_DIR}/build/test_none
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(opt "-unexpected_release_option")
+  string(FIND "${fileText}" "${opt}" opt_found)
+  if ( NOT opt_found EQUAL -1 )
+    message(SEND_ERROR "Release option found: ${opt}")
+  endif()
+else()
+  unset(fileName CACHE)
+  find_file (fileName K1.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/build
+    ${CMAKE_CURRENT_BINARY_DIR}/build/K1
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(opt "-required-debug-option")
+  string(FIND "${fileText}" "${opt}" opt_found)
+  if ( opt_found EQUAL -1 )
+    message(SEND_ERROR "Missing debug option: ${opt}")
+  endif()
+
+  unset(fileName CACHE)
+  find_file (fileName K2.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/build
+    ${CMAKE_CURRENT_BINARY_DIR}/build/K2
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(opt "-required-debug-option")
+  string(FIND "${fileText}" "${opt}" opt_found)
+  if ( opt_found EQUAL -1 )
+    message(SEND_ERROR "Missing debug option: ${opt}")
+  endif()
+
+  unset(fileName CACHE)
+  find_file (fileName K3.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/build
+    ${CMAKE_CURRENT_BINARY_DIR}/build/K3
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(opt "-required-debug-option")
+  string(FIND "${fileText}" "${opt}" opt_found)
+  if ( opt_found EQUAL -1 )
+    message(SEND_ERROR "Missing debug option: ${opt}")
+  endif()
+
+  unset(fileName CACHE)
+  find_file (fileName K4.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/build
+    ${CMAKE_CURRENT_BINARY_DIR}/build/K4
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(opt "-required-debug-option")
+  string(FIND "${fileText}" "${opt}" opt_found)
+  if ( opt_found EQUAL -1 )
+    message(SEND_ERROR "Missing debug option: ${opt}")
+  endif()
+endif()
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
new file mode 100644
index 0000000..d425631
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
@@ -0,0 +1,28 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+if(RUN_TEST STREQUAL "RELEASE_FLAGS")
+#RELEASE flags used when CMAKE_BUILD_TYPE is undefined
+string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
+add_executable(test_none test.c)
+endif()
+
+if(RUN_TEST STREQUAL "KERNEL_FLAGS")
+#DEBUG flag missing when -kernel is added as a compile option
+string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
+
+add_executable(K1 test.c)
+
+add_executable(K2 test.c)
+target_compile_options(K2 PRIVATE -kernel)
+
+add_executable(K3 test.c)
+target_compile_options(K3 PRIVATE -kernel=fast)
+
+add_executable(K4 test.c)
+target_link_options(K4 PRIVATE -kernel)
+endif()
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/test.c b/Tests/GhsMulti/GhsMultiCompilerOptions/test.c
new file mode 100644
index 0000000..95f2e8e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/test.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+  return -1;
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
similarity index 83%
rename from Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
rename to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
index 82a014b..520e65f 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
@@ -1,11 +1,13 @@
 cmake_minimum_required(VERSION 3.5)
-project(demo C)
+project(test C)
 
 add_library(libdemo
   test.c
+  testCase.c
   subfolder_test.c
   subfolder_test_0.c
   "subfolder/test.c"
+  subfolder/testcase.c
 )
 
 add_executable(demo main.c)
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/main.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/main.c
similarity index 73%
rename from Tests/GhsMultiDuplicateSourceFilenames/main.c
rename to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/main.c
index d5b7914..d4ef7bb 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/main.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/main.c
@@ -2,6 +2,8 @@ int test_a(void);
 int test_b(void);
 int test_c(void);
 int test_d(void);
+int test_e(void);
+int test_f(void);
 
 int main(int argc, char* argv[])
 {
@@ -9,5 +11,7 @@ int main(int argc, char* argv[])
   test_b();
   test_c();
   test_d();
+  test_e();
+  test_f();
   return 0;
 }
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
similarity index 96%
copy from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
copy to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
index e1e1759..5d857dd 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
@@ -1,4 +1,3 @@
-
 int test_b()
 {
   return 2;
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
similarity index 53%
copy from Tests/GhsMultiDuplicateSourceFilenames/test.c
copy to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
index 5ffcbdf..66ee6f3 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
@@ -1,5 +1,4 @@
-
-int test_a()
+int test_f()
 {
   return 1;
 }
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
similarity index 96%
rename from Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c
rename to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
index c552e6a..83589ba 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
@@ -1,4 +1,3 @@
-
 int test_c()
 {
   return 1;
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
similarity index 96%
rename from Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
rename to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
index 170b33d..82f9a52 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
@@ -1,4 +1,3 @@
-
 int test_d()
 {
   return 1;
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
similarity index 96%
copy from Tests/GhsMultiDuplicateSourceFilenames/test.c
copy to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
index 5ffcbdf..feba80e 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
@@ -1,4 +1,3 @@
-
 int test_a()
 {
   return 1;
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
similarity index 53%
rename from Tests/GhsMultiDuplicateSourceFilenames/test.c
rename to Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
index 5ffcbdf..943c19d 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
@@ -1,5 +1,4 @@
-
-int test_a()
+int test_e()
 {
   return 1;
 }
diff --git a/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
new file mode 100644
index 0000000..329cb3f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_library(lib1 lib1.c)
+set_target_properties( lib1 PROPERTIES EXCLUDE_FROM_ALL yes )
+
+add_library(lib2 EXCLUDE_FROM_ALL lib1.c)
+
+add_executable(exe1 exe1.c)
diff --git a/Tests/GhsMulti/GhsMultiExclude/exe1.c b/Tests/GhsMulti/GhsMultiExclude/exe1.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/exe1.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+  return 0;
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiExclude/lib1.c
similarity index 51%
copy from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
copy to Tests/GhsMulti/GhsMultiExclude/lib1.c
index e1e1759..b35e9cc 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiExclude/lib1.c
@@ -1,5 +1,4 @@
-
-int test_b()
+int func(void)
 {
   return 2;
 }
diff --git a/Tests/GhsMulti/GhsMultiExclude/verify.cmake b/Tests/GhsMulti/GhsMultiExclude/verify.cmake
new file mode 100644
index 0000000..0467b5a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/verify.cmake
@@ -0,0 +1,54 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName lib1.gpj
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/lib1
+  )
+
+if (fileName)
+  message("Found target lib1: ${fileName}")
+else()
+  message(SEND_ERROR "Could not find target lib1: ${fileName}")
+endif()
+
+#test project was built
+unset(fileName CACHE)
+find_file (fileName lib1.a
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/lib1
+  )
+
+if (fileName)
+  message(SEND_ERROR "Found target lib1: ${fileName}")
+else()
+  message("Could not find target lib1: ${fileName}")
+endif()
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName lib2.gpj
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/lib2
+  )
+
+if (fileName)
+  message("Found target lib2 ${fileName}")
+else()
+  message(SEND_ERROR "Could not find target lib2: ${fileName}")
+endif()
+
+#test project was built
+unset(fileName CACHE)
+find_file (fileName lib2.a
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/lib2
+  )
+
+if (fileName)
+  message(SEND_ERROR "Found target lib2: ${fileName}")
+else()
+  message("Could not find target lib2: ${fileName}")
+endif()
diff --git a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt
similarity index 58%
rename from Tests/GhsMulti/ReturnNum/App/CMakeLists.txt
rename to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt
index 2adbd4e..e431217 100644
--- a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Lib)
 add_executable(App Main.c)
+target_include_directories(App PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../Lib)
 target_link_libraries(App Lib)
 target_compile_options(App PUBLIC "-non_shared")
diff --git a/Tests/GhsMulti/ReturnNum/App/Main.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c
similarity index 100%
rename from Tests/GhsMulti/ReturnNum/App/Main.c
rename to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c
diff --git a/Tests/GhsMulti/ReturnNum/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt
similarity index 56%
rename from Tests/GhsMulti/ReturnNum/CMakeLists.txt
rename to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt
index 7bcc5f9..92254e6 100644
--- a/Tests/GhsMulti/ReturnNum/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt
@@ -1,3 +1,6 @@
+cmake_minimum_required(VERSION 3.1)
+project(test)
+
 add_subdirectory(App)
 add_subdirectory(Int)
 add_subdirectory(Lib)
diff --git a/Tests/GhsMulti/ReturnNum/Int/AppDD.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
similarity index 100%
rename from Tests/GhsMulti/ReturnNum/Int/AppDD.int
rename to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt
new file mode 100644
index 0000000..d173c01
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt
@@ -0,0 +1 @@
+add_executable(AppDD AppDD.int)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt
new file mode 100644
index 0000000..00e0f59
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(Lib HelperFun.c HelperFun.h)
diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c
similarity index 100%
rename from Tests/GhsMulti/ReturnNum/Lib/HelperFun.c
rename to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c
diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h
similarity index 100%
rename from Tests/GhsMulti/ReturnNum/Lib/HelperFun.h
rename to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
new file mode 100644
index 0000000..741fece
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+# create virtual AS
+add_executable(vas exe.c)
+target_link_libraries(vas lib)
+add_library(lib func.c)
+
+# create kernel
+add_executable(kernel kernel.c)
+target_link_options(kernel PRIVATE -kernel)
+
+# create monolith INTEGRITY application
+add_executable(monolith test.int)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c
new file mode 100644
index 0000000..29ad70a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c
@@ -0,0 +1,5 @@
+extern int func(void);
+int main(void)
+{
+  return func();
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c
similarity index 53%
copy from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
copy to Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c
index e1e1759..c302418 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c
@@ -1,5 +1,5 @@
 
-int test_b()
+int func(void)
 {
   return 2;
 }
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
new file mode 100644
index 0000000..d1bce33
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
@@ -0,0 +1,15 @@
+#include "INTEGRITY.h"
+#include "boottable.h"
+
+void main()
+{
+  Exit(0);
+}
+
+/* This global table will be filled in during the Integrate phase with */
+/* information about the AddressSpaces, Tasks, and Objects that are to be */
+/* created.  If you do not plan to use Integrate, you may omit this file from
+ */
+/* the kernel, and the boot table code will then not be included. */
+
+GlobalTable TheGlobalTable = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
new file mode 100644
index 0000000..161345b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
@@ -0,0 +1,8 @@
+Kernel
+  Filename        kernel/kernel.as
+EndKernel
+
+AddressSpace      App
+  Filename        "vas/vas.as"
+  Language C
+EndAddressSpace
diff --git a/Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt b/Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt
new file mode 100644
index 0000000..fa0dce0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_library(iface INTERFACE)
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
new file mode 100644
index 0000000..9b23493
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
@@ -0,0 +1,96 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+message("Copy project")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+  ${CMAKE_CURRENT_BINARY_DIR}/link_src/CMakeLists.txt COPYONLY)
+
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/exe1.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/exe1.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/func2.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/func3.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/func4.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/func5.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/func6.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/func7.c
+  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/link_src
+)
+
+message("Building project")
+try_compile(RESULT
+  ${CMAKE_CURRENT_BINARY_DIR}/link_build
+  ${CMAKE_CURRENT_BINARY_DIR}/link_src
+  test
+  CMAKE_FLAGS -DGHS_BSP_NAME=${GHS_BSP_NAME}
+    -DGHS_OS_ROOT=${GHS_OS_ROOT}
+    -DGHS_OS_DIR=${GHS_OS_DIR}
+    -DGHS_TOOLSET_ROOT=${GHS_TOOLSET_ROOT}
+    -DGHS_TARGET_PLATFORM=${GHS_TARGET_PLATFORM}
+    -DRUN_TEST=${RUN_TEST}
+    -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
+  OUTPUT_VARIABLE OUTPUT)
+
+message("Output from build:\n${OUTPUT}")
+if (RUN_TEST STREQUAL "NO_FLAGS")
+  if(NOT RESULT)
+    message(SEND_ERROR "Could not build test project (1)!")
+  endif()
+else()
+  unset(fileName CACHE)
+  find_file (fileName exe1.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/link_build
+    ${CMAKE_CURRENT_BINARY_DIR}/link_build/exe1
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(expected_flags
+    -add-link-options1 -add-link-options2
+    link_directories_used1 link_directories_used2 "c:/absolute"
+    link_libraries_used1 link_libraries_used2
+    -lcsl1 csl2
+    -clinkexe1 -clinkexe2
+    -special-lib2-public-link)
+  foreach( opt IN LISTS expected_flags )
+    string(FIND "${fileText}" "${opt}" opt_found)
+    if ( opt_found EQUAL -1 )
+      message(SEND_ERROR "Could not find: ${opt}")
+    endif()
+  endforeach(opt)
+
+  unset(fileName CACHE)
+  find_file (fileName lib1.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/link_build
+    ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib1
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(expected_flags
+    -clinkexeA1 -clinkexeA2
+    -static-lib-flags1 -static-lib-flags2)
+  foreach( opt IN LISTS expected_flags )
+    string(FIND "${fileText}" "${opt}" opt_found)
+    if ( opt_found EQUAL -1 )
+      message(SEND_ERROR "Could not find: ${opt}")
+    endif()
+  endforeach(opt)
+
+  unset(fileName CACHE)
+  find_file (fileName lib2.gpj
+    ${CMAKE_CURRENT_BINARY_DIR}/link_build
+    ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib2
+    )
+  message("Parsing project file: ${fileName}")
+  file(STRINGS ${fileName} fileText)
+  set(expected_flags
+    -clinkexeA1 -clinkexeA2)
+  foreach( opt IN LISTS expected_flags )
+    string(FIND "${fileText}" "${opt}" opt_found)
+    if ( opt_found EQUAL -1 )
+      message(SEND_ERROR "Could not find: ${opt}")
+    endif()
+  endforeach(opt)
+endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
new file mode 100644
index 0000000..4cf86a2
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
@@ -0,0 +1,35 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+if( RUN_TEST STREQUAL "CHECK_FLAGS" )
+add_link_options(-add-link-options1 -add-link-options2)
+link_directories(link_directories_used1 link_directories_used2 "c:/absolute")
+link_libraries(link_libraries_used1 link_libraries_used2 )
+set( CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcsl1 csl2" )
+set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -clinkexe1 -clinkexe2")
+endif()
+
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
+if( RUN_TEST STREQUAL "CHECK_FLAGS" )
+set_property( TARGET exe1 APPEND_STRING PROPERTY LINK_FLAGS "--link-flag-prop1 --link-flag-prop2")
+set_property( TARGET exe1 APPEND PROPERTY LINK_OPTIONS --link-opt-prop1 --link-opt-prop2)
+endif()
+
+if( RUN_TEST STREQUAL "CHECK_FLAGS" )
+set( CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} "-clinkexeA1 -clinkexeA2")
+endif()
+add_library(lib1 STATIC func2.c func3.c func4.c)
+target_link_libraries(lib1 lib2)
+if( RUN_TEST STREQUAL "CHECK_FLAGS" )
+set_property( TARGET lib1 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS "-static-lib-flags1 -static-lib-flags2")
+endif()
+
+add_library(lib2 STATIC func5.c func6.c func7.c)
+if( RUN_TEST STREQUAL "CHECK_FLAGS" )
+target_link_options(lib2 PUBLIC -special-lib2-public-link)
+endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/exe1.c b/Tests/GhsMulti/GhsMultiLinkTest/exe1.c
new file mode 100644
index 0000000..f21c126
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/exe1.c
@@ -0,0 +1,6 @@
+#include "exe1.h"
+
+int main(void)
+{
+  return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/exe1.h b/Tests/GhsMulti/GhsMultiLinkTest/exe1.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/exe1.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func2.c b/Tests/GhsMulti/GhsMultiLinkTest/func2.c
new file mode 100644
index 0000000..8f66fba
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func2.c
@@ -0,0 +1,4 @@
+int func2a(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func3.c b/Tests/GhsMulti/GhsMultiLinkTest/func3.c
new file mode 100644
index 0000000..57c7a6f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func3.c
@@ -0,0 +1,4 @@
+int func3a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func4.c b/Tests/GhsMulti/GhsMultiLinkTest/func4.c
new file mode 100644
index 0000000..109fd7b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func4.c
@@ -0,0 +1,4 @@
+int func4a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func5.c b/Tests/GhsMulti/GhsMultiLinkTest/func5.c
new file mode 100644
index 0000000..f28a705
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func5.c
@@ -0,0 +1,4 @@
+int func5a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func6.c b/Tests/GhsMulti/GhsMultiLinkTest/func6.c
new file mode 100644
index 0000000..bf77406
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func6.c
@@ -0,0 +1,4 @@
+int func6a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func7.c b/Tests/GhsMulti/GhsMultiLinkTest/func7.c
new file mode 100644
index 0000000..6a4a9a1
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func7.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt
new file mode 100644
index 0000000..145dac0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_subdirectory(sub_exe)
+add_subdirectory(sub_lib)
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
new file mode 100644
index 0000000..55f693d
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c
new file mode 100644
index 0000000..f21c126
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c
@@ -0,0 +1,6 @@
+#include "exe1.h"
+
+int main(void)
+{
+  return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt
new file mode 100644
index 0000000..9039730
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+add_library(lib1 STATIC func2.c func3.c func4.c)
+target_link_libraries(lib1 lib2)
+
+add_library(lib2 STATIC func5.c func6.c func7.c)
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c
new file mode 100644
index 0000000..8f66fba
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c
@@ -0,0 +1,4 @@
+int func2a(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c
new file mode 100644
index 0000000..57c7a6f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c
@@ -0,0 +1,4 @@
+int func3a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c
new file mode 100644
index 0000000..109fd7b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c
@@ -0,0 +1,4 @@
+int func4a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c
new file mode 100644
index 0000000..f28a705
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c
@@ -0,0 +1,4 @@
+int func5a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c
new file mode 100644
index 0000000..bf77406
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c
@@ -0,0 +1,4 @@
+int func6a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c
new file mode 100644
index 0000000..6a4a9a1
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
new file mode 100644
index 0000000..d01c4d2
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_library(lib1 lib1.c)
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
+
+add_subdirectory(sub)
+add_subdirectory(sub2 examples EXCLUDE_FROM_ALL)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c b/Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c
new file mode 100644
index 0000000..b9cdd61
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c
@@ -0,0 +1,5 @@
+extern int lib1_func(void);
+int main(void)
+{
+  return lib1_func();
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c b/Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c
new file mode 100644
index 0000000..5100945
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c
@@ -0,0 +1,4 @@
+int lib1_func(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt
new file mode 100644
index 0000000..0d83bc3
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test2 C)
+
+add_library(lib2 lib2.c)
+add_executable(exe2 exe2.c)
+target_link_libraries(exe2 lib1 lib2)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c
new file mode 100644
index 0000000..9238cf3
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c
@@ -0,0 +1,6 @@
+extern int func(void);
+extern int lib1_func(void);
+int main(void)
+{
+  return func() + lib1_func();
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c
similarity index 51%
copy from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
copy to Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c
index e1e1759..b35e9cc 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c
@@ -1,5 +1,4 @@
-
-int test_b()
+int func(void)
 {
   return 2;
 }
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt
new file mode 100644
index 0000000..e42e7fb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test3 C)
+
+add_library(lib3 lib3.c)
+add_executable(exe3 exe3.c)
+target_link_libraries(exe3 lib1 lib3)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c
new file mode 100644
index 0000000..9238cf3
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c
@@ -0,0 +1,6 @@
+extern int func(void);
+extern int lib1_func(void);
+int main(void)
+{
+  return func() + lib1_func();
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c
similarity index 51%
copy from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
copy to Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c
index e1e1759..b35e9cc 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c
@@ -1,5 +1,4 @@
-
-int test_b()
+int func(void)
 {
   return 2;
 }
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
new file mode 100644
index 0000000..e00cbb3
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
@@ -0,0 +1,58 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName lib3.gpj
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/lib3
+  ${CMAKE_CURRENT_BINARY_DIR}/examples
+  )
+
+if ( fileName )
+  message("Found target lib3: ${fileName}")
+else()
+  message(SEND_ERROR "Could not find target lib3: ${fileName}")
+endif()
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName exe3.gpj
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/exe3
+  ${CMAKE_CURRENT_BINARY_DIR}/examples
+  )
+
+if ( fileName )
+  message("Found target exe3: ${fileName}")
+else()
+  message(SEND_ERROR "Could not find target exe3: ${fileName}")
+endif()
+
+#test project was not built
+unset(fileName CACHE)
+find_file (fileName lib3.a
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/lib3
+  ${CMAKE_CURRENT_BINARY_DIR}/examples
+  )
+
+if ( fileName )
+  message(SEND_ERROR "Found target lib3: ${fileName}")
+else()
+  message("Could not find target lib3: ${fileName}")
+endif()
+
+unset(fileName CACHE)
+find_file (fileName NAMES exe3.as exe3
+  HINTS
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/exe3
+  ${CMAKE_CURRENT_BINARY_DIR}/examples
+  )
+
+if ( fileName )
+  message(SEND_ERROR "Found target exe3: ${fileName}")
+else()
+  message("Could not find target exe3: ${fileName}")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt b/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
new file mode 100644
index 0000000..7fe91bc
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_library(obj1 OBJECT testObj.c testObj.h sub/testObj.c testObj2.c)
+
+add_executable(exe1 exe.c $<TARGET_OBJECTS:obj1>)
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/exe.c b/Tests/GhsMulti/GhsMultiObjectLibrary/exe.c
new file mode 100644
index 0000000..c2c5a19
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/exe.c
@@ -0,0 +1,8 @@
+extern int funcOBJ(void);
+extern int funcOBJ2(void);
+extern int funcOBJs(void);
+
+int main(void)
+{
+  return funcOBJ() + funcOBJ2() + funcOBJs();
+}
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c b/Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c
new file mode 100644
index 0000000..5228ef2
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c
@@ -0,0 +1,4 @@
+int funcOBJs(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c
new file mode 100644
index 0000000..ec6f2c3
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c
@@ -0,0 +1,4 @@
+int funcOBJ(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h
new file mode 100644
index 0000000..9aef431
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h
@@ -0,0 +1 @@
+extern int funcOBJ(void);
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c
new file mode 100644
index 0000000..b6a9b93
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c
@@ -0,0 +1,4 @@
+int funcOBJ2(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt b/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
new file mode 100644
index 0000000..f10b2f0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+set(targets_to_install "")
+
+if( RUN_TEST STREQUAL "SINGLE_EXEC" )
+add_executable(exe1 exe.c)
+set(targets_to_install ${targets_to_install} exe1)
+endif()
+
+if( RUN_TEST STREQUAL "SINGLE_EXEC_RENAMED" )
+set(name new_name)
+add_executable(exe1 exe.c)
+set_property(TARGET exe1 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${name}_bin_$<CONFIG>)
+set_property(TARGET exe1 PROPERTY OUTPUT_NAME ${name}_$<CONFIG>)
+set_property(TARGET exe1 PROPERTY SUFFIX .bin)
+set(targets_to_install ${targets_to_install} exe1)
+endif()
+
+if( RUN_TEST STREQUAL "EXEC_AND_LIB" )
+add_library(lib1 lib1.c)
+set_property(TARGET lib1 PROPERTY ARCHIVE_OUTPUT_DIRECTORY forced-$<CONFIG>)
+set_property(TARGET lib1 PROPERTY SUFFIX .LL)
+set_property(TARGET lib1 PROPERTY OUTPUT_NAME lib1_$<CONFIG>)
+
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
+set(targets_to_install ${targets_to_install} exe1 lib1)
+endif()
+
+install(TARGETS ${targets_to_install}
+        RUNTIME DESTINATION bin
+        LIBRARY DESTINATION lib
+        ARCHIVE DESTINATION lib/static)
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/exe.c b/Tests/GhsMulti/GhsMultiRenameInstall/exe.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/exe.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+  return 0;
+}
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/exe1.c b/Tests/GhsMulti/GhsMultiRenameInstall/exe1.c
new file mode 100644
index 0000000..29ad70a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/exe1.c
@@ -0,0 +1,5 @@
+extern int func(void);
+int main(void)
+{
+  return func();
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiRenameInstall/lib1.c
similarity index 51%
rename from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
rename to Tests/GhsMulti/GhsMultiRenameInstall/lib1.c
index e1e1759..b35e9cc 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/lib1.c
@@ -1,5 +1,4 @@
-
-int test_b()
+int func(void)
 {
   return 2;
 }
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c b/Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c
new file mode 100644
index 0000000..9c9c1d9
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c
@@ -0,0 +1,4 @@
+int funcA3a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
new file mode 100644
index 0000000..5043e7f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+#set(CMAKE_FOLDER ON)
+add_executable(groups
+  test1.c
+  test1.h
+  test2a.c
+  test4.c
+  test5.c
+  test6.c
+  test7.c
+  standard.h
+  testOBJ.c
+  testOBJ.h
+  sub/testOBJ.c
+  sub/testOBJ.h
+  textfile.txt
+  textfile2.txt
+  test3.c
+  Atest3.c
+#  object.o
+  resource.pdf
+  cmake.rule
+  s5.h
+  s2.h
+  s4.h
+  standard.h
+  )
+
+source_group( gC FILES sub/testOBJ.h testOBJ.c testOBJ.h sub/testOBJ.c )
+source_group( gA FILES test1.c test1.h)
+source_group( gB test[65].c )
+source_group( gC\\gD FILES test7.c )
+source_group( docs FILES textfile.txt )
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule b/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
@@ -0,0 +1 @@
+
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/object.o b/Tests/GhsMulti/GhsMultiSrcGroups/object.o
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/object.o
@@ -0,0 +1 @@
+
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf b/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
@@ -0,0 +1 @@
+
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/s2.h b/Tests/GhsMulti/GhsMultiSrcGroups/s2.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/s2.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/s4.h b/Tests/GhsMulti/GhsMultiSrcGroups/s4.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/s4.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/s5.h b/Tests/GhsMulti/GhsMultiSrcGroups/s5.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/s5.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/standard.h b/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
new file mode 100644
index 0000000..2773a55
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
@@ -0,0 +1 @@
+#define somthing
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c
new file mode 100644
index 0000000..90ea9b9
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c
@@ -0,0 +1,6 @@
+#include "testOBJ.h"
+
+int funcOBJsub(void)
+{
+  return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test1.c b/Tests/GhsMulti/GhsMultiSrcGroups/test1.c
new file mode 100644
index 0000000..94f818a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test1.c
@@ -0,0 +1,6 @@
+#include "test1.h"
+
+int main(void)
+{
+  return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test1.h b/Tests/GhsMulti/GhsMultiSrcGroups/test1.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test1.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test2a.c b/Tests/GhsMulti/GhsMultiSrcGroups/test2a.c
new file mode 100644
index 0000000..8f66fba
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test2a.c
@@ -0,0 +1,4 @@
+int func2a(void)
+{
+  return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test3.c b/Tests/GhsMulti/GhsMultiSrcGroups/test3.c
new file mode 100644
index 0000000..57c7a6f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test3.c
@@ -0,0 +1,4 @@
+int func3a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test3.h b/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
new file mode 100644
index 0000000..2773a55
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
@@ -0,0 +1 @@
+#define somthing
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test4.c b/Tests/GhsMulti/GhsMultiSrcGroups/test4.c
new file mode 100644
index 0000000..109fd7b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test4.c
@@ -0,0 +1,4 @@
+int func4a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test5.c b/Tests/GhsMulti/GhsMultiSrcGroups/test5.c
new file mode 100644
index 0000000..f28a705
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test5.c
@@ -0,0 +1,4 @@
+int func5a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test6.c b/Tests/GhsMulti/GhsMultiSrcGroups/test6.c
new file mode 100644
index 0000000..bf77406
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test6.c
@@ -0,0 +1,4 @@
+int func6a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test7.c b/Tests/GhsMulti/GhsMultiSrcGroups/test7.c
new file mode 100644
index 0000000..6a4a9a1
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test7.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c
new file mode 100644
index 0000000..e86e2a4
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c
@@ -0,0 +1,11 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
+
+int funcOBJ(void)
+{
+  return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h
new file mode 100644
index 0000000..e2b1725
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt b/Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt
new file mode 100644
index 0000000..48cdce8
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt
@@ -0,0 +1 @@
+placeholder
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt b/Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt
new file mode 100644
index 0000000..48cdce8
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt
@@ -0,0 +1 @@
+placeholder
diff --git a/Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt b/Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt
new file mode 100644
index 0000000..ed3094b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_custom_target(testTarget ALL echo this is a test)
+
+add_library(sharedLib SHARED file.c)
+
+add_library(moduleLib MODULE file.c)
diff --git a/Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c b/Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c
new file mode 100644
index 0000000..6a4a9a1
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+  return 1;
+}
diff --git a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt
deleted file mode 100644
index 44c5de1..0000000
--- a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_executable(AppDD AppDD.int Default.bsp)
diff --git a/Tests/GhsMulti/ReturnNum/Int/Default.bsp b/Tests/GhsMulti/ReturnNum/Int/Default.bsp
deleted file mode 100644
index 224ec29..0000000
--- a/Tests/GhsMulti/ReturnNum/Int/Default.bsp
+++ /dev/null
@@ -1,35 +0,0 @@
-# Target description File for the Integrate utility for use with the
-# INTEGRITY real-time operating system by Green Hills Software.
-# Before editing this file, refer to your Integrate documentation.
-# default.bsp is appropriate for INTEGRITY applications which are
-# fully linked with the kernel (for RAM or ROM) or dynamically downloaded.
-#
-# MinimumAddress must match the value of .ramend in the linker directives
-# file used for the KernelSpace program - see default.ld for more info.
-# The MaximumAddress used here allows memory mappings to be specified
-# for up to the 16 MB mark in RAM.   Intex will not permit programs
-# that require more memory for its mappings.    If the board has less
-# memory,  this number can be reduced by the user.
-
-Target
-	MinimumAddress				.ramend
-	MaximumAddress				.ramlimit
-	Clock					StandardTick
-	EndClock
-        Clock                                   HighResTimer
-        EndClock
-	IODevice				"SerialDev0"
-	InitialKernelObjects 			200
-	DefaultStartIt				false
-	DefaultMaxPriority			255
-	DefaultPriority				127
-	DefaultWeight				1
-	DefaultMaxWeight			255
-	DefaultHeapSize				0x10000
-	LastVirtualAddress			0x3fffffff
-	PageSize				0x1000
-	ArchitectedPageSize			0x1000
-	ArchitectedPageSize			0x10000
-	ArchitectedPageSize			0x100000
-	DefaultMemoryRegionSize			0x20000
-EndTarget
diff --git a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt
deleted file mode 100644
index 9c822da..0000000
--- a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_library(Lib HelperFun.c HelperFun.h)
\ No newline at end of file

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a42e40e78dc3d9c4289a3c9640cae94ecd034373
commit a42e40e78dc3d9c4289a3c9640cae94ecd034373
Author:     Fred Baksik <frodak17 at gmail.com>
AuthorDate: Sat Jan 5 11:01:19 2019 -0500
Commit:     Fred Baksik <frodak17 at gmail.com>
CommitDate: Wed Jan 16 10:40:59 2019 -0500

    GHS: Only print bsp and os directives if specified by user
    
    -- standalone platforms will not build if bsp/os is specified in project file
    -- integrity platforms will always print these directives because they are required
    -- cleanup -os_dir setting
       allow customization of the actual setting because it is determined by tool-set customization files
       remove variable that was set but never used
    -- add message when using default values

diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 9b384df..25004c6 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -9,6 +9,9 @@ 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_OPTION "-os_dir " CACHE STRING "GHS compiler os option")
+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})
@@ -23,8 +26,11 @@ if ( NOT GHS_OS_DIR )
     endif ()
 
     #filter based on platform name
-    if (GHS_TARGET_PLATFORM STREQUAL "integrity")
+    if (GHS_TARGET_PLATFORM MATCHES "integrity")
       list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*")
+    else() #fall-back for standalone
+      unset(GHS_CANDIDATE_OS_DIRS)
+      set(GHS_OS_DIR "IGNORE")
     endif ()
 
     if (GHS_CANDIDATE_OS_DIRS)
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 831c4a9..2d875c7 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -20,7 +20,6 @@ const char* cmGlobalGhsMultiGenerator::DEFAULT_TOOLSET_ROOT = "C:/ghs";
 
 cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake* cm)
   : cmGlobalGenerator(cm)
-  , OSDirRelative(false)
 {
 }
 
@@ -130,6 +129,8 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
 
   const char* tgtPlatform = mf->GetDefinition("GHS_TARGET_PLATFORM");
   if (tgtPlatform == nullptr) {
+    cmSystemTools::Message("Green Hills MULTI: GHS_TARGET_PLATFORM not "
+                           "specified; defaulting to \"integrity\"");
     tgtPlatform = "integrity";
   }
 
@@ -221,45 +222,62 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
   this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams);
   OpenBuildFileStream(GetBuildFileStream());
 
-  char const* osDir =
-    this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR");
-  if (NULL == osDir) {
-    osDir = "";
-    cmSystemTools::Error("GHS_OS_DIR cache variable must be set");
-  } else {
-    this->GetCMakeInstance()->MarkCliAsUsed("GHS_OS_DIR");
-  }
-  std::string fOSDir(this->trimQuotes(osDir));
-  std::replace(fOSDir.begin(), fOSDir.end(), '\\', '/');
-  if (!fOSDir.empty() && ('c' == fOSDir[0] || 'C' == fOSDir[0])) {
-    this->OSDirRelative = false;
-  } else {
-    this->OSDirRelative = true;
+  this->WriteMacros();
+  this->WriteHighLevelDirectives();
+  GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
+  this->WriteDisclaimer(this->GetBuildFileStream());
+  *this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
+
+  // Specify BSP option if supplied by user
+  // -- not all platforms require this entry in the project file
+  //    integrity platforms require this field; use default if needed
+  std::string platform;
+  if (const char* p =
+        this->GetCMakeInstance()->GetCacheDefinition("GHS_TARGET_PLATFORM")) {
+    platform = p;
   }
 
   std::string bspName;
-  char const* bspCache =
-    this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
-  if (bspCache) {
+  if (char const* bspCache =
+        this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME")) {
     bspName = bspCache;
     this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
+  } else {
+    bspName = "IGNORE";
   }
-  if (bspName.empty() || bspName.compare("IGNORE") == 0) {
+
+  if (platform.find("integrity") != std::string::npos &&
+      cmSystemTools::IsOff(bspName.c_str())) {
     const char* a =
       this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
     bspName = "sim";
     bspName += (a ? a : "");
   }
 
-  this->WriteMacros();
-  this->WriteHighLevelDirectives();
+  if (!cmSystemTools::IsOff(bspName.c_str())) {
+    *this->GetBuildFileStream() << "    -bsp " << bspName << std::endl;
+  }
 
-  GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
-  this->WriteDisclaimer(this->GetBuildFileStream());
-  *this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
-  *this->GetBuildFileStream() << "    -bsp " << bspName << std::endl;
+  // Specify OS DIR if supplied by user
+  // -- not all platforms require this entry in the project file
+  std::string osDir;
+  std::string osDirOption;
+  if (char const* osDirCache =
+        this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR")) {
+    osDir = osDirCache;
+  }
+
+  if (char const* osDirOptionCache =
+        this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION")) {
+    osDirOption = osDirOptionCache;
+  }
 
-  this->WriteCompilerOptions(fOSDir);
+  if (!cmSystemTools::IsOff(osDir.c_str()) ||
+      platform.find("integrity") != std::string::npos) {
+    std::replace(osDir.begin(), osDir.end(), '\\', '/');
+    *this->GetBuildFileStream()
+      << "    " << osDirOption << "\"" << osDir << "\"" << std::endl;
+  }
 }
 
 void cmGlobalGhsMultiGenerator::CloseBuildFileStream(
@@ -368,12 +386,6 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
   }
 }
 
-void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const& fOSDir)
-{
-  *this->GetBuildFileStream()
-    << "    -os_dir=\"" << fOSDir << "\"" << std::endl;
-}
-
 void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream* os)
 {
   (*os) << "#" << std::endl
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index a5aff73..4ab4c56 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -85,7 +85,6 @@ public:
                    std::map<std::string, cmGeneratedFileStream*>* fileMap);
 
   static std::string trimQuotes(std::string const& str);
-  inline bool IsOSDirRelative() { return this->OSDirRelative; }
 
 protected:
   void Generate() override;
@@ -105,7 +104,6 @@ private:
 
   void WriteMacros();
   void WriteHighLevelDirectives();
-  void WriteCompilerOptions(std::string const& fOSDir);
 
   static void AddFilesUpToPathNewBuildFile(
     cmGeneratedFileStream* mainBuildFile,
@@ -126,7 +124,6 @@ private:
 
   std::vector<std::string> LibDirs;
 
-  bool OSDirRelative;
   static const char* DEFAULT_BUILD_PROGRAM;
   static const char* DEFAULT_TOOLSET_ROOT;
 };

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

Summary of changes:
 Help/command/try_compile.rst                       |   3 +
 Help/generator/Green Hills MULTI.rst               |  40 +-
 Help/manual/cmake-properties.7.rst                 |   2 +-
 Help/manual/cmake-variables.7.rst                  |   5 -
 Help/prop_tgt/GHS_INTEGRITY_APP.rst                |  10 +
 Help/variable/CMAKE_LANG_COMPILER_ID.rst           |   1 +
 .../CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst         |   5 -
 .../variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst |   5 -
 .../CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst     |   5 -
 .../CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst        |   5 -
 .../CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst |   5 -
 Help/variable/GHS-MULTI.rst                        |   2 +-
 Modules/CMakeCompilerIdDetection.cmake             |   1 +
 Modules/CMakeDetermineCCompiler.cmake              |   1 +
 Modules/CMakeDetermineCXXCompiler.cmake            |   1 +
 Modules/CMakeDetermineCompilerABI.cmake            |   2 +
 Modules/CMakeDetermineCompilerId.cmake             |  85 ++-
 Modules/CMakePlatformId.h.in                       |  28 +
 Modules/CMakeTestCCompiler.cmake                   |   2 +
 Modules/CMakeTestCXXCompiler.cmake                 |   2 +
 Modules/CMakeTestCompilerCommon.cmake              |  20 +
 Modules/Compiler/GHS-C.cmake                       |  20 -
 Modules/Compiler/GHS-CXX.cmake                     |  24 -
 Modules/Compiler/GHS-DetermineCompiler.cmake       |  11 +-
 Modules/Compiler/GHS.cmake                         |   6 +-
 Modules/CompilerId/GHS_default.gpj.in              |   8 +
 Modules/CompilerId/GHS_lib.gpj.in                  |   3 +
 Modules/Platform/GHS-MULTI-Initialize.cmake        |   8 +-
 Source/cmCoreTryCompile.cxx                        |  16 +
 Source/cmGhsMultiGpj.cxx                           |  31 +-
 Source/cmGhsMultiGpj.h                             |   6 +-
 Source/cmGhsMultiTargetGenerator.cxx               | 798 ++++++++++-----------
 Source/cmGhsMultiTargetGenerator.h                 | 100 +--
 Source/cmGlobalGenerator.cxx                       |   3 +-
 Source/cmGlobalGhsMultiGenerator.cxx               | 505 ++++++-------
 Source/cmGlobalGhsMultiGenerator.h                 |  99 ++-
 Source/cmLocalGhsMultiGenerator.cxx                |  81 ++-
 Source/cmLocalGhsMultiGenerator.h                  |  11 +
 Source/cmState.cxx                                 |  10 +
 Source/cmState.h                                   |   3 +
 Tests/CMakeLists.txt                               | 122 +++-
 Tests/GhsMulti/CMakeLists.txt                      |   4 -
 .../GhsMultiCompilerOptions/CMakeLists.txt         |  92 +++
 .../GhsMultiCompilerOptions/CMakeLists.txt.in      |  32 +
 Tests/GhsMulti/GhsMultiCompilerOptions/test.c      |   4 +
 Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt     |  30 +
 Tests/GhsMulti/GhsMultiCopyFile/test.c             |   4 +
 .../CMakeLists.txt                                 |   8 +-
 .../GhsMultiDuplicateSourceFilenames/main.c        |   4 +
 .../subfolder/test.c                               |   1 -
 .../subfolder/testcase.c}                          |   3 +-
 .../subfolder_test.c                               |   1 -
 .../subfolder_test_0.c                             |   1 -
 .../GhsMultiDuplicateSourceFilenames/test.c        |   1 -
 .../GhsMultiDuplicateSourceFilenames/testCase.c}   |   3 +-
 Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt      |  17 +
 .../GhsMultiExclude/exe1.c}                        |   0
 .../test.c => GhsMulti/GhsMultiExclude/lib1.c}     |   3 +-
 Tests/GhsMulti/GhsMultiExclude/verify.cmake        |  54 ++
 .../GhsMultiIntegrityDD/CMakeLists.txt             |  19 +
 .../GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c    |   5 +
 .../GhsMultiIntegrity/GhsMultiIntegrityDD/func.c}  |   3 +-
 .../GhsMultiIntegrityDDInt}/App/CMakeLists.txt     |   2 +-
 .../GhsMultiIntegrityDDInt}/App/Main.c             |   0
 .../GhsMultiIntegrityDDInt}/CMakeLists.txt         |   3 +
 .../GhsMultiIntegrityDDInt}/Int/AppDD.int          |   2 +-
 .../GhsMultiIntegrityDDInt/Int/CMakeLists.txt      |   1 +
 .../GhsMultiIntegrityDDInt/Lib/CMakeLists.txt      |   1 +
 .../GhsMultiIntegrityDDInt}/Lib/HelperFun.c        |   0
 .../GhsMultiIntegrityDDInt}/Lib/HelperFun.h        |   0
 .../GhsMultiIntegrityMonolith/CMakeLists.txt       |  20 +
 .../GhsMultiIntegrityMonolith/exe.c                |   5 +
 .../GhsMultiIntegrityMonolith/func.c}              |   2 +-
 .../GhsMultiIntegrityMonolith/kernel.c             |  15 +
 .../GhsMultiIntegrityMonolith/test.int             |   8 +
 Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt    |   8 +
 Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt     |  92 +++
 Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in  |  43 ++
 Tests/GhsMulti/GhsMultiLinkTest/exe1.c             |   6 +
 Tests/GhsMulti/GhsMultiLinkTest/exe1.h             |   6 +
 Tests/GhsMulti/GhsMultiLinkTest/func2.c            |   4 +
 Tests/GhsMulti/GhsMultiLinkTest/func3.c            |   4 +
 Tests/GhsMulti/GhsMultiLinkTest/func4.c            |   4 +
 Tests/GhsMulti/GhsMultiLinkTest/func5.c            |   4 +
 Tests/GhsMulti/GhsMultiLinkTest/func6.c            |   4 +
 Tests/GhsMulti/GhsMultiLinkTest/func7.c            |   4 +
 Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt  |   9 +
 .../GhsMultiLinkTestSub/sub_exe/CMakeLists.txt     |  12 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c  |   6 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h  |   6 +
 .../GhsMultiLinkTestSub/sub_lib/CMakeLists.txt     |   7 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c |   4 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c |   4 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c |   4 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c |   4 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c |   4 +
 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c |   4 +
 .../GhsMultiMultipleProjects/CMakeLists.txt        |  17 +
 Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c     |   5 +
 Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c     |   4 +
 .../GhsMultiMultipleProjects/sub/CMakeLists.txt    |  10 +
 Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c |   6 +
 .../GhsMultiMultipleProjects/sub/lib2.c}           |   3 +-
 .../GhsMultiMultipleProjects/sub2/CMakeLists.txt   |  10 +
 .../GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c  |   6 +
 .../GhsMultiMultipleProjects/sub2/lib3.c}          |   3 +-
 .../GhsMulti/GhsMultiMultipleProjects/verify.cmake |  58 ++
 .../GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt  |  13 +
 Tests/GhsMulti/GhsMultiObjectLibrary/exe.c         |   8 +
 Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c |   4 +
 Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c     |   4 +
 Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h     |   1 +
 Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c    |   4 +
 Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt     |  34 +
 Tests/GhsMulti/GhsMultiPlatform/file1.c            |   4 +
 .../GhsMulti/GhsMultiRenameInstall/CMakeLists.txt  |  42 ++
 .../GhsMultiRenameInstall/exe.c}                   |   0
 Tests/GhsMulti/GhsMultiRenameInstall/exe1.c        |   5 +
 .../GhsMultiRenameInstall/lib1.c}                  |   3 +-
 Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c          |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt    |  45 ++
 Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule        |   1 +
 Tests/GhsMulti/GhsMultiSrcGroups/object.o          |   1 +
 .../GhsMultiSrcGroups/resource.pdf}                |   0
 Tests/GhsMulti/GhsMultiSrcGroups/s2.h              |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/s4.h              |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/s5.h              |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/standard.h        |   1 +
 Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c     |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h     |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/test1.c           |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/test1.h           |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/test2a.c          |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/test3.c           |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/test3.h           |   1 +
 Tests/GhsMulti/GhsMultiSrcGroups/test4.c           |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/test5.c           |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/test6.c           |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/test7.c           |   4 +
 Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c         |  11 +
 Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h         |   6 +
 Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt      |   1 +
 Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt     |   1 +
 .../GhsMultiUnsupportedTargets/CMakeLists.txt      |  12 +
 Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c   |   4 +
 Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt        |   1 -
 Tests/GhsMulti/ReturnNum/Int/Default.bsp           |  35 -
 Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt        |   1 -
 148 files changed, 2055 insertions(+), 1066 deletions(-)
 create mode 100644 Help/prop_tgt/GHS_INTEGRITY_APP.rst
 delete mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
 delete mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
 delete mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
 delete mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
 delete mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
 create mode 100644 Modules/CompilerId/GHS_default.gpj.in
 create mode 100644 Modules/CompilerId/GHS_lib.gpj.in
 delete mode 100644 Tests/GhsMulti/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
 create mode 100644 Tests/GhsMulti/GhsMultiCompilerOptions/test.c
 create mode 100644 Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiCopyFile/test.c
 rename Tests/{ => GhsMulti}/GhsMultiDuplicateSourceFilenames/CMakeLists.txt (58%)
 rename Tests/{ => GhsMulti}/GhsMultiDuplicateSourceFilenames/main.c (73%)
 copy Tests/{ => GhsMulti}/GhsMultiDuplicateSourceFilenames/subfolder/test.c (96%)
 copy Tests/{GhsMultiDuplicateSourceFilenames/test.c => GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c} (53%)
 rename Tests/{ => GhsMulti}/GhsMultiDuplicateSourceFilenames/subfolder_test.c (96%)
 rename Tests/{ => GhsMulti}/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c (96%)
 copy Tests/{ => GhsMulti}/GhsMultiDuplicateSourceFilenames/test.c (96%)
 rename Tests/{GhsMultiDuplicateSourceFilenames/test.c => GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c} (53%)
 create mode 100644 Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
 copy Tests/{Wrapping/wrapFLTK.cxx => GhsMulti/GhsMultiExclude/exe1.c} (100%)
 copy Tests/{GhsMultiDuplicateSourceFilenames/subfolder/test.c => GhsMulti/GhsMultiExclude/lib1.c} (51%)
 create mode 100644 Tests/GhsMulti/GhsMultiExclude/verify.cmake
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c
 copy Tests/{GhsMultiDuplicateSourceFilenames/subfolder/test.c => GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c} (51%)
 rename Tests/GhsMulti/{ReturnNum => GhsMultiIntegrity/GhsMultiIntegrityDDInt}/App/CMakeLists.txt (58%)
 rename Tests/GhsMulti/{ReturnNum => GhsMultiIntegrity/GhsMultiIntegrityDDInt}/App/Main.c (100%)
 rename Tests/GhsMulti/{ReturnNum => GhsMultiIntegrity/GhsMultiIntegrityDDInt}/CMakeLists.txt (56%)
 rename Tests/GhsMulti/{ReturnNum => GhsMultiIntegrity/GhsMultiIntegrityDDInt}/Int/AppDD.int (90%)
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt
 rename Tests/GhsMulti/{ReturnNum => GhsMultiIntegrity/GhsMultiIntegrityDDInt}/Lib/HelperFun.c (100%)
 rename Tests/GhsMulti/{ReturnNum => GhsMultiIntegrity/GhsMultiIntegrityDDInt}/Lib/HelperFun.h (100%)
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c
 copy Tests/{GhsMultiDuplicateSourceFilenames/subfolder/test.c => GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c} (53%)
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
 create mode 100644 Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
 create mode 100644 Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/exe1.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/exe1.h
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/func2.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/func3.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/func4.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/func5.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/func6.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTest/func7.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c
 create mode 100644 Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c
 copy Tests/{GhsMultiDuplicateSourceFilenames/subfolder/test.c => GhsMulti/GhsMultiMultipleProjects/sub/lib2.c} (51%)
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c
 copy Tests/{GhsMultiDuplicateSourceFilenames/subfolder/test.c => GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c} (51%)
 create mode 100644 Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
 create mode 100644 Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiObjectLibrary/exe.c
 create mode 100644 Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c
 create mode 100644 Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c
 create mode 100644 Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h
 create mode 100644 Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c
 create mode 100644 Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiPlatform/file1.c
 create mode 100644 Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
 copy Tests/{Wrapping/wrapFLTK.cxx => GhsMulti/GhsMultiRenameInstall/exe.c} (100%)
 create mode 100644 Tests/GhsMulti/GhsMultiRenameInstall/exe1.c
 rename Tests/{GhsMultiDuplicateSourceFilenames/subfolder/test.c => GhsMulti/GhsMultiRenameInstall/lib1.c} (51%)
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/object.o
 copy Tests/{Wrapping/vtkIncluded.cxx => GhsMulti/GhsMultiSrcGroups/resource.pdf} (100%)
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/s2.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/s4.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/s5.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/standard.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test1.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test1.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test2a.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test3.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test3.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test4.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test5.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test6.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/test7.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt
 create mode 100644 Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt
 create mode 100644 Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt
 create mode 100644 Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c
 delete mode 100644 Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt
 delete mode 100644 Tests/GhsMulti/ReturnNum/Int/Default.bsp
 delete mode 100644 Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list