diff --git a/CMakeLists.txt b/CMakeLists.txt index 4732561..c962cf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,14 +27,9 @@ endif() set(CATCH_LIBS_ALIASES Catch2::Catch2 Catch2::Catch2WithMain) function(get_linux_lsb_release_information) - find_program(LSB_RELEASE_EXEC lsb_release) - if(NOT LSB_RELEASE_EXEC) - message(FATAL_ERROR "Could not detect lsb_release executable, can not gather required information") - endif() - - execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --id OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --release OUTPUT_VARIABLE LSB_RELEASE_VERSION_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --codename OUTPUT_VARIABLE LSB_RELEASE_CODENAME_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND sh -c "cat /etc/*release | grep -w ID | cut -d'=' -f 2" OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND sh -c "cat /etc/*release | grep ^VERSION_ID | cut -d'=' -f 2" OUTPUT_VARIABLE LSB_RELEASE_VERSION_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND sh -c "cat /etc/*release | grep ^VERSION_CODENAME | cut -d'=' -f 2" OUTPUT_VARIABLE LSB_RELEASE_CODENAME_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) set(LSB_RELEASE_ID_SHORT "${LSB_RELEASE_ID_SHORT}" PARENT_SCOPE) set(LSB_RELEASE_VERSION_SHORT "${LSB_RELEASE_VERSION_SHORT}" PARENT_SCOPE)