Skip to content

Commit

Permalink
Provide default for Ubuntu Focal
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero committed Jul 6, 2021
1 parent 7a13668 commit 1aa2160
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,52 @@ ign_find_package(sdformat10
#--------------------------------------
# Find dartsim for the dartsim plugin wrapper

option(USE_VENDOR_DART "Use internal Open Robotics fork of vendor" BOOL)
# 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)
if(NOT DEFINED USE_VENDOR_DART)
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)
endif()
endif()
endif()

option(USE_VENDOR_DART "Use internal Open Robotics fork of DART" ${DEFAULT_VENDOR_DART})

find_program(LSB_RELEASE_EXEC lsb_release)
if(USE_VENDOR_DART)
include(ExternalProject)

set(DART_VENDOR_INSTALL_DIR ${CMAKE_BINARY_DIR}/vendor/dart/install)
set(DART_VENDOR_INCLUDE_DIRS "${DART_VENDOR_INSTALL_DIR}/include")
set(DART_VENDOR_LIBRARY_DIR "${DART_VENDOR_INSTALL_DIR}/lib")
# Three libraries needed
set(DART_VENDOR_LIBRARY_PATH
set(DART_VENDOR_LIBRARY_PATH
"${DART_VENDOR_LIBRARY_DIR}/libdart.so.6.10.0")
set(DART_VENDOR_LIBRARY_LINK_PATH
"${DART_VENDOR_LIBRARY_DIR}/libdart.so.6.10")
add_library(dart SHARED IMPORTED)
set_target_properties(dart PROPERTIES
IMPORTED_LOCATION ${DART_VENDOR_LIBRARY_PATH})

set(DART_ODEL_VENDOR_LIBRARY_PATH
"${DART_VENDOR_LIBRARY_DIR}/libdart-external-odelcpsolver.so.6.10.0")
set(DART_ODEL_VENDOR_LIBRARY_LINK_PATH
"${DART_VENDOR_LIBRARY_DIR}/libdart-external-odelcpsolver.so.6.10")
add_library(dart_external_odelcpsolver SHARED IMPORTED)
set_target_properties(dart_external_odelcpsolver PROPERTIES
IMPORTED_LOCATION ${DART_ODEL_VENDOR_LIBRARY_PATH})

set(DART_COLLISION_VENDOR_LIBRARY_PATH
"${DART_VENDOR_LIBRARY_DIR}/libdart-collision-ode.so.6.10.0")
set(DART_COLLISION_VENDOR_LIBRARY_LINK_PATH
"${DART_VENDOR_LIBRARY_DIR}/libdart-collision-ode.so.6.10")
add_library(dart_collision_ode SHARED IMPORTED)
set_target_properties(dart_collision_ode PROPERTIES
IMPORTED_LOCATION ${DART_COLLISION_VENDOR_LIBRARY_PATH})
Expand Down

0 comments on commit 1aa2160

Please sign in to comment.