Параметры целевой системы в 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,10 +1,26 @@
if(CMAKE_CROSSCOMPILING)
return()
endif()
if(LSB_RELEASE) if(LSB_RELEASE)
return() return()
endif() endif()
find_program(_lsb_release_executable lsb_release) set(LSB_DISTRIBUTOR_ID "unknown")
set(LSB_CODENAME "unknown")
set(LSB_RELEASE "unknown")
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()
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)
if(_lsb_release_executable)
execute_process(COMMAND ${_lsb_release_executable} -sc execute_process(COMMAND ${_lsb_release_executable} -sc
OUTPUT_VARIABLE LSB_CODENAME OUTPUT_VARIABLE LSB_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -12,13 +28,6 @@ if(_lsb_release_executable)
execute_process(COMMAND ${_lsb_release_executable} -sr execute_process(COMMAND ${_lsb_release_executable} -sr
OUTPUT_VARIABLE LSB_RELEASE OUTPUT_VARIABLE LSB_RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
execute_process(COMMAND ${_lsb_release_executable} -si
OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
set(LSB_DISTRIBUTOR_ID "unknown")
set(LSB_RELEASE "unknown")
set(LSB_CODENAME "unknown")
endif() endif()

View File

@ -19,5 +19,9 @@
#cmakedefine HAVE__FSEEKI64 #cmakedefine HAVE__FSEEKI64
#cmakedefine HAVE_LARGEFILES @HAVE_LARGEFILES@ #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_ */ #endif /* @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_ */