ros / urdf

Repository for URDF parsing code
63 stars 41 forks source link

set `CMAKE_CXX_STANDARD` only if newer than before #38

Closed dreuter closed 2 years ago

dreuter commented 2 years ago

On Ubuntu 22.04 everything downstream of rosconsole has to be build with C++17 enabled.

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.

sloretz commented 2 years ago

Thank you for the PR!