From ffd23c6e1a32abcb35b35716222fc4e9aed5a7c8 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Tue, 14 Dec 2021 15:35:21 +0100 Subject: [PATCH] use new cmake 3.22 feature to get distro pretty name - stop setting a version, prefer pretty name instead - default the pretty name to the data from os-release when run with a new enough cmake - when not new enough use the previous plasma$version string as pretty name - version is kept around for backwards compat, script code also still constructs "%1 %2" as final string, i.e. we have a trailing space but it shouldn't matter in practise --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6832976..c33c647 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,11 +19,19 @@ find_library(MATH_LIBRARY m) # plymouth plugin names (i.e we want breeze-text.so not libbreeze-text.so). set(CMAKE_SHARED_MODULE_PREFIX "") -set(DISTRO_NAME "Plasma" CACHE STRING "Name to use on splash screen") -set(DISTRO_VERSION ${PROJECT_VERSION} CACHE STRING "Version to use on splash screen") +if(NOT DISTRO_NAME AND "${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.22.0") + cmake_host_system_information(RESULT PRETTY_NAME QUERY DISTRIB_PRETTY_NAME) +endif() + +if(NOT PRETTY_NAME) + set(PRETTY_NAME "Plasma ${PROJECT_VERSION}") +endif() + +set(DISTRO_NAME "${PRETTY_NAME}" CACHE STRING "Name to use on splash screen (defaults to os-release)") +set(DISTRO_VERSION "" CACHE STRING "Version to use on splash screen") # prefer to have the version in the name, makes it easier for os-release data add_feature_info(DISTRO_NAME On "name to use on splash screen is '${DISTRO_NAME}'") -add_feature_info(DISTRO_VERSION On "version to use on splash screen is '${DISTRO_VERSION}'") +add_feature_info(DISTRO_VERSION On "extra version to use on splash screen is '${DISTRO_VERSION}'") add_subdirectory(breeze-text) add_subdirectory(breeze) -- GitLab