diff options
author | Fred Baksik <frodak17@gmail.com> | 2019-03-20 00:56:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-29 16:38:12 (GMT) |
commit | 266dadf8683c9c0081368604c4ccae12e8ffc9f7 (patch) | |
tree | 8f31f9da6d5ea106b09367c34c178462f47ef330 /Modules/Platform | |
parent | 89abbdd8c8db5bf587373f2a00f6a816eddd8496 (diff) | |
download | CMake-266dadf8683c9c0081368604c4ccae12e8ffc9f7.zip CMake-266dadf8683c9c0081368604c4ccae12e8ffc9f7.tar.gz CMake-266dadf8683c9c0081368604c4ccae12e8ffc9f7.tar.bz2 |
GHS: Print status message regarding GHS_OS_DIR
-- Rename platform script so it runs before initial try_compile() in
project() command.
-- Fix incorrect variable name GHS_OS_DIR_OPTION
-- Remove unnecessary ".*" from REGEX expression for GHS_CANDIDATE_OS_DIRS
-- Forward GHS_OS_DIR_OPTION to try_compile() and preserve trailing
whitespace of the variable.
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/GHS-MULTI-Determine.cmake (renamed from Modules/Platform/GHS-MULTI-Initialize.cmake) | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Determine.cmake index db65d14..349d906 100644 --- a/Modules/Platform/GHS-MULTI-Initialize.cmake +++ b/Modules/Platform/GHS-MULTI-Determine.cmake @@ -13,39 +13,40 @@ 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_OPTION "-os_dir " CACHE STRING "GHS compiler OS option") +mark_as_advanced(GHS_OS_DIR_OPTION) #set GHS_OS_DIR if not set by user -if ( NOT GHS_OS_DIR ) - if (EXISTS ${GHS_OS_ROOT}) +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 ) + if(GHS_CANDIDATE_OS_FILES) list(REMOVE_ITEM GHS_CANDIDATE_OS_DIRS ${GHS_CANDIDATE_OS_FILES}) endif () #filter based on platform name - if (GHS_TARGET_PLATFORM MATCHES "integrity") - list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*") + 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 () + endif() - if (GHS_CANDIDATE_OS_DIRS) + 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() + #update cache with new value set(GHS_OS_DIR "${GHS_OS_DIR}" CACHE PATH "GHS platform OS directory" FORCE) - endif () -endif () + endif() +endif() set(GHS_BSP_NAME "IGNORE" CACHE STRING "BSP name") |