linux - Detect underlying platform/flavour in Cmake -
does know cmake variable or hook or can give me underlying platform name/flavour name on getting executed ? e.g. linux-centos linux-ubuntu linux-sles
i know cmake has "cmake_system" variable doesn't differentiating flavours of linux e.g. appreciated.
edit : read can done using lsb_release command ?
the following snippet populates lsb_release_id_short
cmake variable information underlying linux system:
find_program(lsb_release lsb_release) execute_process(command ${lsb_release} -is output_variable lsb_release_id_short output_strip_trailing_whitespace )
on ubuntu, example, yields ubuntu
.
Comments
Post a Comment