myx-cmake/MyxCMake/modules/MyxCMakeLSBInfo.cmake

28 lines
975 B
CMake
Raw Permalink Normal View History

2022-05-06 09:49:46 +00:00
include_guard(GLOBAL)
2021-12-08 11:32:04 +00:00
set(MYX_CMAKE_LSB_DISTRIBUTOR_ID "unknown")
set(MYX_CMAKE_LSB_CODENAME "unknown")
2022-05-06 09:49:46 +00:00
set(MYX_CMAKE_LSB_RELEASE_VERSION "unknown")
if(CMAKE_CROSSCOMPILING)
return()
endif()
2021-12-08 11:32:04 +00:00
if(EXISTS /etc/mcst_version)
set(MYX_CMAKE_LSB_DISTRIBUTOR_ID "ElbrusD")
set(MYX_CMAKE_LSB_CODENAME "Jessie")
execute_process(
COMMAND cat /etc/mcst_version
2022-05-06 09:49:46 +00:00
OUTPUT_VARIABLE MYX_CMAKE_LSB_RELEASE_VERSION
2021-12-08 11:32:04 +00:00
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
2022-05-06 09:49:46 +00:00
find_program(_lsb_release_exe lsb_release)
2021-12-08 11:32:04 +00:00
# cmake-format: off
2022-05-06 09:49:46 +00:00
if(_lsb_release_exe)
execute_process(COMMAND ${_lsb_release_exe} -si OUTPUT_VARIABLE MYX_CMAKE_LSB_DISTRIBUTOR_ID OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${_lsb_release_exe} -sc OUTPUT_VARIABLE MYX_CMAKE_LSB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${_lsb_release_exe} -sr OUTPUT_VARIABLE MYX_CMAKE_LSB_RELEASE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
2021-12-08 11:32:04 +00:00
endif()
2022-01-25 10:21:05 +00:00
# cmake-format: on
2021-12-08 11:32:04 +00:00
endif()