SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
100 stars 84 forks source link

Create export target when building without ros #143

Closed tobias-groeger closed 1 year ago

tobias-groeger commented 1 year ago

Currently the ROS_VERSION is always set from the environment variable, if present. To allow building without ROS support on systems where ROS is installed, only set ROS_VERSION from environment when not explicitly set in cmake. This means calling cmake with -DROS_VERSION=0 will disable ROS support even when ROS is installed on the system.

Add export target for shared library when building with ROS_VERSION=0. This means the library can be used in a cmake project by simply using find_package(sick_scan_xd) and target_link_libraries(<project-name> sick_scan_xd::sick_scan_shared_lib). This also means calling SickScanApiLoadLibrary(sick_scan_api_lib); in the application is not necessary anymore as the shared library is linked during compile time.

I only tested this on Ubuntu with a sick_tim_5xx lidar sensor and building with -DLDMRS=0 -DSCANSEGMENT_XD=0 -DROS_VERSION=0.

rostest commented 1 year ago

Many thanks for your pull request! We will merge it into one of the next releases. Until then we leave the PR open as a remainder.

aiplemaSICKAG commented 1 year ago

Thank you for your contributions. We included them in Version 2.9.0.