Параметры целевой системы в cmlib_config.hpp

This commit is contained in:
Andrei Astafev 2019-07-20 12:10:31 +03:00
parent f4ea735208
commit 52975c9a35
2 changed files with 29 additions and 16 deletions

View File

@ -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()

View File

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