Most packages set the CMAKE_CXX_STANDARD before find_packageing,
which means that the above mentioned fix will work for them.
Unfortunately urdf does set the standard after including rosconsole
(transitively).
Instead of moving the statement before the find_package I decided to
check explicitly if already a higher version was set, because I think it
shows the intent more clearly.
Also there might be other reasons why somebody decides to raise the
CMAKE_CXX_STANDARD, which this fix will then allow.
On Ubuntu 22.04 everything downstream of
rosconsole
has to be build with C++17 enabled.Most packages set the
CMAKE_CXX_STANDARD
beforefind_package
ing, which means that the above mentioned fix will work for them. Unfortunatelyurdf
does set the standard after includingrosconsole
(transitively).Instead of moving the statement before the
find_package
I decided to check explicitly if already a higher version was set, because I think it shows the intent more clearly.Also there might be other reasons why somebody decides to raise the
CMAKE_CXX_STANDARD
, which this fix will then allow.