From 103c7f3a7fbca4eebcf9dfad6ec8634e8f7858c1 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Tue, 6 Jul 2021 18:27:48 +0200 Subject: [PATCH] Fix Focal logic to enable DART fork automatically Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3faf36e1d..76efe0875 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,16 +64,18 @@ ign_find_package(sdformat10 # respect user explicit values and also provide a default value for Ubuntu Focal # to make ground vehicles to work properly -set(DEFAULT_VENDOR_DART:BOOL OFF) +set(DEFAULT_VENDOR_DART OFF) if(NOT DEFINED USE_VENDOR_DART) + find_program(LSB_RELEASE_EXEC lsb_release) + if(LSB_RELEASE_EXEC) execute_process(COMMAND ${LSB_RELEASE_EXEC} -rs - OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT - OUTPUT_STRIP_TRAILING_WHITESPACE) - if (LSB_RELEASE_ID_SHORT == "20.04") - message(STATUS "DETECTED Ubuntu 20.04, default USE_VENDOR_DART set to ON" - "to make ground vehicles to work properly") - set(DEFAULT_VENDOR_DART:BOOL ON) + OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(LSB_RELEASE_ID_SHORT STREQUAL "20.04") + message(STATUS "DETECTED Ubuntu 20.04, default USE_VENDOR_DART set to " + "ON to make ground vehicles to work properly") + set(DEFAULT_VENDOR_DART ON) endif() endif() endif()