Field-Robotics-Lab / nps_uw_multibeam_sonar

Multibeam sonar plugin with NVIDIA Cuda library
Apache License 2.0
35 stars 20 forks source link

Need to manually specify "-std=c++17" when using CMake less than 3.16 #24

Closed amarburg closed 2 years ago

amarburg commented 2 years ago

I'm building on Ubuntu 20.04.3 with CMake 3.14.4. This leads to this branch in the CMakeLists.txt. This leads to errors from Ignition related to (more or less) missing C++ features, e.g.:

/usr/include/ignition/math6/ignition/math/Helpers.hh: In function ‘std::chrono::_V2::steady_clock::duration ignition::math::v6::stringToDuration(const string&)’: /usr/include/ignition/math6/ignition/math/Helpers.hh:990:28: error: ‘chrono_literals’ is not a namespace-name 990 using namespace std::chrono_literals;

This issue is resolved if CMakeLists.txt line 14 is changed to:

add_compile_options(-std=c++17)

And am submitting a PR to discuss this possible change, but am putting an issue here for discussion whether this the right solution.

woensug-choi commented 2 years ago

Hi @amarburg. I have just merged your PR.

Well, I also am not fully confident about whether it is the right solution. But as for my usage, your fix does not collide with me.

If anyone else has a problem with it, I assume they will make an issue for it.

Thank you! Hope you are enjoying the plugin :D