Commit 01c98c6c authored by Fred Baksik's avatar Fred Baksik
Browse files

GHS: Update setting default OS location for Integrity platforms

-- Update how the latest OS is determined; scan the location GHS_OS_ROOT and sort it
   No longer use registry settings looking for installations
     The registry values are assigned in installation order for Green Hills tools not version order
   Filter out files from the list of directories (i.e if int1234.zip and int1234 are both in root folder)
parent bb77dc0c
......@@ -28,12 +28,20 @@ Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
Default to ``C:/ghs``. Root path for ``toolset``.
* ``GHS_OS_ROOT``
Default to ``C:/ghs``. Root path for RTOS searches.
* ``GHS_OS_DIR``
Default to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
a specific RTOS is to be used.
Customizations are available through the following cache variables:
* ``GHS_BSP_NAME``
* ``GHS_CUSTOMIZATION``
* ``GHS_GPJ_MACROS``
* ``GHS_OS_DIR``
.. note::
This generator is deemed experimental as of CMake |release|
......
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#Setup Green Hills MULTI specific compilation information
#Setup Greenhills MULTI specific compilation information
if (NOT GHS_INT_DIRECTORY)
#Assume the C:/ghs/int#### directory that is latest is preferred
set(GHS_EXPECTED_ROOT "C:/ghs")
if (EXISTS ${GHS_EXPECTED_ROOT})
FILE(GLOB GHS_CANDIDATE_INT_DIRS RELATIVE
${GHS_EXPECTED_ROOT} ${GHS_EXPECTED_ROOT}/*)
string(REGEX MATCHALL "int[0-9][0-9][0-9][0-9a-z]" GHS_CANDIDATE_INT_DIRS
${GHS_CANDIDATE_INT_DIRS})
if (GHS_CANDIDATE_INT_DIRS)
list(SORT GHS_CANDIDATE_INT_DIRS)
list(GET GHS_CANDIDATE_INT_DIRS -1 GHS_INT_DIRECTORY)
string(CONCAT GHS_INT_DIRECTORY ${GHS_EXPECTED_ROOT} "/"
${GHS_INT_DIRECTORY})
set(GHS_OS_ROOT "C:/ghs" CACHE PATH "GHS platform OS search root directory")
mark_as_advanced(GHS_OS_ROOT)
set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory")
mark_as_advanced(GHS_OS_DIR)
#set GHS_OS_DIR if not set by user
if ( NOT GHS_OS_DIR )
if (EXISTS ${GHS_OS_ROOT})
#get all directories in root directory
FILE(GLOB GHS_CANDIDATE_OS_DIRS
LIST_DIRECTORIES true RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*)
FILE(GLOB GHS_CANDIDATE_OS_FILES
LIST_DIRECTORIES false RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*)
if ( GHS_CANDIDATE_OS_FILES )
list(REMOVE_ITEM GHS_CANDIDATE_OS_DIRS ${GHS_CANDIDATE_OS_FILES})
endif ()
endif ()
#Try to look for known registry values
if (NOT GHS_INT_DIRECTORY)
find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]" #int1122
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]" #int1104
)
endif ()
#filter based on platform name
if (GHS_TARGET_PLATFORM STREQUAL "integrity")
list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*")
endif ()
set(GHS_INT_DIRECTORY ${GHS_INT_DIRECTORY} CACHE PATH
"Path to integrity directory")
if (GHS_CANDIDATE_OS_DIRS)
list(SORT GHS_CANDIDATE_OS_DIRS)
list(GET GHS_CANDIDATE_OS_DIRS -1 GHS_OS_DIR)
string(CONCAT GHS_OS_DIR ${GHS_OS_ROOT} "/" ${GHS_OS_DIR})
endif()
set(GHS_OS_DIR "${GHS_OS_DIR}" CACHE PATH "GHS platform OS directory" FORCE)
endif ()
endif ()
set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory")
set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name")
set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization")
mark_as_advanced(GHS_CUSTOMIZATION)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment