From 52975c9a35bdf8950ae2a3b726a8a340bd3751c6 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 20 Jul 2019 12:10:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D1=80=D1=8B=20=D1=86=D0=B5=D0=BB=D0=B5=D0=B2=D0=BE=D0=B9=20?= =?UTF-8?q?=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D1=8B=20=D0=B2=20cmlib=5Fc?= =?UTF-8?q?onfig.hpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibLSBInfo.cmake | 41 +++++++++++++++++++++++++---------------- hpp/cmlib_config.hpp.in | 4 ++++ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/CMLibLSBInfo.cmake b/CMLibLSBInfo.cmake index 604fe26..1cccf8c 100644 --- a/CMLibLSBInfo.cmake +++ b/CMLibLSBInfo.cmake @@ -1,24 +1,33 @@ +if(CMAKE_CROSSCOMPILING) + return() +endif() + if(LSB_RELEASE) return() endif() -find_program(_lsb_release_executable lsb_release) +set(LSB_DISTRIBUTOR_ID "unknown") +set(LSB_CODENAME "unknown") +set(LSB_RELEASE "unknown") -if(_lsb_release_executable) - execute_process(COMMAND ${_lsb_release_executable} -sc - OUTPUT_VARIABLE LSB_CODENAME - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process(COMMAND ${_lsb_release_executable} -sr - OUTPUT_VARIABLE LSB_RELEASE - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process(COMMAND ${_lsb_release_executable} -si - OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID - OUTPUT_STRIP_TRAILING_WHITESPACE) +if (EXISTS /etc/mcst_version) + set(LSB_DISTRIBUTOR_ID "ElbrusD") + set(LSB_CODENAME "Jessie") + excecute_process(cat /etc/mcst_version OUTPUT_VARIABLE LSB_RELEASE) else() - set(LSB_DISTRIBUTOR_ID "unknown") - set(LSB_RELEASE "unknown") - set(LSB_CODENAME "unknown") + find_program(_lsb_release_executable lsb_release) + if(_lsb_release_executable) + execute_process(COMMAND ${_lsb_release_executable} -si + OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process(COMMAND ${_lsb_release_executable} -sc + OUTPUT_VARIABLE LSB_CODENAME + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process(COMMAND ${_lsb_release_executable} -sr + OUTPUT_VARIABLE LSB_RELEASE + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() endif() diff --git a/hpp/cmlib_config.hpp.in b/hpp/cmlib_config.hpp.in index c256ebb..be5f27f 100644 --- a/hpp/cmlib_config.hpp.in +++ b/hpp/cmlib_config.hpp.in @@ -19,5 +19,9 @@ #cmakedefine HAVE__FSEEKI64 #cmakedefine HAVE_LARGEFILES @HAVE_LARGEFILES@ +#define @CMLIB_PROJECT_NAME_CANONICAL@_LSB_ID "@LSB_DISTRIBUTOR_ID@" +#define @CMLIB_PROJECT_NAME_CANONICAL@_LSB_CODENAME "@LSB_CODENAME@" +#define @CMLIB_PROJECT_NAME_CANONICAL@_LSB_RELEASE "@LSB_RELEASE@" + #endif /* @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_ */