cmlib/CMLibLSBInfo.cmake

25 lines
701 B
CMake
Raw Normal View History

2019-02-12 16:31:17 +00:00
if(LSB_RELEASE)
return()
endif()
find_program(_lsb_release_executable lsb_release)
if(_lsb_release_executable)
execute_process(COMMAND ${_lsb_release_executable} -sc
2019-02-16 10:10:12 +00:00
OUTPUT_VARIABLE LSB_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
2019-02-12 16:31:17 +00:00
execute_process(COMMAND ${_lsb_release_executable} -sr
2019-02-16 10:10:12 +00:00
OUTPUT_VARIABLE LSB_RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE)
2019-02-12 16:31:17 +00:00
execute_process(COMMAND ${_lsb_release_executable} -si
2019-02-16 10:10:12 +00:00
OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID
OUTPUT_STRIP_TRAILING_WHITESPACE)
2019-02-12 16:31:17 +00:00
else()
set(LSB_DISTRIBUTOR_ID "unknown")
set(LSB_RELEASE "unknown")
set(LSB_CODENAME "unknown")
endif()