diff options
Diffstat (limited to 'functions.cmake')
-rw-r--r-- | functions.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/functions.cmake b/functions.cmake index 0152554669a..9fa1f326e0a 100644 --- a/functions.cmake +++ b/functions.cmake @@ -711,6 +711,10 @@ function(vespa_detect_build_platform) message(FATAL_ERROR "-- Could not determine ${OS_DISTRO} version") endif() endif() + file(STRINGS /etc/os-release OS_DISTRO_NAME REGEX "^NAME=") + if (OS_DISTRO_NAME) + string(REGEX REPLACE "NAME=\"?([^\"]+)\"?" "\\1" OS_DISTRO_NAME ${OS_DISTRO_NAME}) + endif() elseif(EXISTS /etc/redhat-release) set(OS_DISTRO "rhel") file(STRINGS "/etc/redhat-release" OS_DISTRO_VERSION) @@ -724,6 +728,9 @@ function(vespa_detect_build_platform) set(VESPA_OS_DISTRO_VERSION ${OS_DISTRO_VERSION} PARENT_SCOPE) string(CONCAT OS_DISTRO_COMBINED ${OS_DISTRO} " " ${OS_DISTRO_VERSION}) set(VESPA_OS_DISTRO_COMBINED ${OS_DISTRO_COMBINED} PARENT_SCOPE) + if (OS_DISTRO_NAME) + set(VESPA_OS_DISTRO_NAME ${OS_DISTRO_NAME} PARENT_SCOPE) + endif() else() message(FATAL_ERROR "-- Could not determine vespa build platform") endif() |