
I'm working on a toolbox written in C++ that is outside of the ROS ecosystem but want to conditionally add ROS support if ROS is installed on the local machine. What is the best way to check if ROS is installed in my toolbox's CMakeLists.txt?
I'm currently checking for the existance of a local environment variable called "ROS_ROOT" as shown below.
if(DEFINED ENV{ROS_ROOT})
find_package(roscpp REQUIRED)
include_directories(${roscpp_INCLUDE_DIRS})
...
endif()
Is this an acceptable solution? Is there a better solution?
Originally posted by liangfok on ROS Answers with karma: 328 on 2016-02-25
Post score: 0