wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.11k stars 1.03k forks source link

Install target generates a clean CMake package (+ Catkin dependency is now optional) #215

Open blabdouze opened 4 years ago

blabdouze commented 4 years ago

Install target now generate a clean CMake package :

This allow the package to be found by a find_package() call if you set serial_DIR var to the path of cmake folder.

# You can also specify the version if needed
find_package(serial REQUIRED)

# Don't need to specify serial include directories as the target already defines them.  
target_link_libraries(my_target PUBLIC serial)

This PR also disable Catkin dependency by default, you can restore it by setting USE_CATKIN option to ON.

Also the option BUILD_SAMPLE allow you to build or not the sample (default is ON).

This is somewhat #133 is trying to do while keeping Catkin dependency as an option if needed.

cz172638 commented 4 years ago

why not to squash all commit to one?

lukadt commented 4 years ago

Can this pull request be fixed and merged? Having Catkin dependency as optional is a long time request