Identify Linux flavor
Similar to CMAKE_SYSTEM_NAME, would be helpful if cmake automatically provided the particular Linux flavor information using lsb_release -a
, to help builds to distinguish capabilities on different Linux systems.
For example, valgrind is currently broken on Void Linux, so I want to exclude valgrind from my build tasks when the system is Void Linux.
As a workaround, I am manually doing this in my CMakeLists.txt:
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
execute_process(COMMAND lsb_release -a OUTPUT_VARIABLE LSB_RELEASE)
endif()
But it would be better if this variable were always defined, empty on any system where lsb_release
does not successfully run, so that cmake users can reliably pattern match on it in their builds.