Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmake/Platform/System/LinuxDistDetector.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ function(detect_host_linux_distribution)
message(AUTHOR_WARNING "Linux distribution detection called on Apple platform")
else () # Linux host
find_program(lsb_release_exec lsb_release)

if ("lsb_release_exec-NOTFOUND" STREQUAL "${lsb_release_exec}")
message(FATAL_ERROR "`lsb_release' not found")
Copy link
Member

@MrPointer MrPointer Sep 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FATAL_ERROR fails the whole CMake process, which is something we don't really want to do here since the dist-detection module is not part of the framework's core, just a nice-to-have feature 😃
Instead, use WARNING to inform the user that it won't benefit from this module until it installs missing dependencies.

Besides, I think it'd be more informative if the message also stated that "Linux distribution couldn't be detected", then the exact reason why.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fast feedback, I'll update my pull request!

endif()

execute_process(COMMAND ${lsb_release_exec} -is
OUTPUT_VARIABLE lsb_release_id_short
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down