rpng / open_vins

An open source platform for visual-inertial navigation research.
https://docs.openvins.com
GNU General Public License v3.0
2.19k stars 647 forks source link

Update cmake #198

Closed asyounis closed 2 years ago

asyounis commented 3 years ago

Hi! Im working on integrating open_vins into a flying drone and needed to make some changes to the cmake files in order to get the code to compile and deploy onto a drone. I figured that these changes might be useful for others who may be looking to integrate open_vins onto various hardware platforms (like a drone or car). Please let me know if these seem acceptable (this is my first time contributing to an open source project like this)

Whats in this pull request:

  1. Bumping the cmake version
  2. Adding install targets to cmake
  3. Changing ov_eval_lib to a shared library
  4. Make building ov_eval optional

Most (if not all) of the changes in this pull request are for when building without catkin (aka no ROS).

Bumping the cmake version 2.8.8 is an old cmake version and it has trouble compiling in projects that use a 3.x version of cmake. Bumping the cmake version to a 3.x version makes it easier to compile open_vins into other projects that also use cmake 3 versions. I chose 3.3 since it is a low number cmake versions and thus should still work on most systems as most systems will have a cmake version higher than 3.3.

Adding install targets to cmake When compiling and deploying open_vins for use on drones (without ROS) we need a way to install the shared library (.so files). Usually this is done with make install and therefore we need to specify what targets should be installed. I added install calls to the make file to specify those install targets as well as default locations to install those targets (the standard /usr/lib, /usr/include, ext).

Changing ov_eval_lib to a shared library I noticed that "ov_eval_lib" was compiling as a static library when all the other libraries are compiling as a shared library. the ov_eval project also has a lot of executable targets and so I think there would be some benefit to making it a shared library

Make building ov_eval optional When compiling open_vins for deployment on a drone, ov_eval is not needed. I added a flag to allow the developer to disable compilation of ov_eval (just like you can disable ROS) so that only ov_core and ov_msckf are compiled and installed.

goldbattle commented 2 years ago

Closed via #209