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_ */