-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include Ogre headers via system path #1630
include Ogre headers via system path #1630
Conversation
... to silence warnings about upstream files. According to the pkgconfig and the cmake files of Ogre, /usr/include is an include folder for the project and thus <OGRE/Ogre...> is a valid include path. The following illustrates the behavior with one of various warnings: <<< ❯ cat bar.cpp ❯ clang++ -Werror -Wall -Wextra -pedantic -std=c++14 -c bar.cpp -I/usr/include/OGRE In file included from bar.cpp:1: In file included from /usr/include/OGRE/OgrePixelFormat.h:31: In file included from /usr/include/OGRE/OgrePrerequisites.h:326: In file included from /usr/include/OGRE/OgreMemoryAllocatorConfig.h:188: /usr/include/OGRE/OgreMemorySTLAllocator.h:130:4: error: 'register' storage class specifier is deprecated and incompatible with C++17 [-Werror,-Wdeprecated-register] register size_type sz = count*sizeof( T ); ^~~~~~~~~ 1 error generated. ❯ cat foo.cpp ❯ clang++ -Werror -Wall -Wextra -pedantic -std=c++14 -c foo.cpp ❯ <<< RViz surpresses these warnings with `include_directories(SYSTEM ${OGRE_INCLUDE_DIRS})` but passes the plain OGRE_INCLUDE_DIRS variable on in catkin_package(INCLUDE_DIRS ...). There is no way to specify a SYSTEM include there. Consequently all downstream projects including rviz headers will see OGRE's warnings and have no easy way to avoid them because the correct OGRE include path is only one entry in ${rviz_INCLUDE_DIRS} (or more likely ${catkin_INCLUDE_DIRS}).
I hesitate to adapt all the include directives. I'd prefer the solution suggested in moveit/moveit_task_constructor#273 (comment). |
Actually this is the way gazebo includes ogre for at least 10 years, so I believe this would be a viable option for RViz as well. As I stated elsewhere, the alternative to fixing it using the include path would be to overlay the used Ogre headers in a folder in RViz and use something like this
in the respective files. As you stated yourself, this is a limitation in catkin, but it should be fixed in RViz. |
The OGRE tutorials recommend the old way of including OGRE headers. |
I fixed the build issues and merged these changes as 41d62f5. |
I guess you really don't like such issues to remain open PRs for long. |
I just have some time today to handle open rviz issues and this was an easy one ;-) |
Hi @v4hn, @simonschmeisser, @jspricke |
|
... to silence warnings about upstream files.
According to the pkgconfig and the cmake files of Ogre, /usr/include
is an include folder for the project and thus <OGRE/Ogre...> is a valid include path.
The following illustrates the behavior with one of various warnings:
<<<
❯ cat bar.cpp
❯ clang++ -Werror -Wall -Wextra -pedantic -std=c++14 -c bar.cpp -I/usr/include/OGRE
In file included from bar.cpp:1:
In file included from /usr/include/OGRE/OgrePixelFormat.h:31:
In file included from /usr/include/OGRE/OgrePrerequisites.h:326:
In file included from /usr/include/OGRE/OgreMemoryAllocatorConfig.h:188:
/usr/include/OGRE/OgreMemorySTLAllocator.h:130:4: error: 'register' storage class specifier is deprecated and incompatible with C++17 [-Werror,-Wdeprecated-register]
register size_type sz = count*sizeof( T );
^~~~~~~~~
1 error generated.
❯ cat foo.cpp
❯ clang++ -Werror -Wall -Wextra -pedantic -std=c++14 -c foo.cpp
❯
<<<
RViz surpresses these warnings with
include_directories(SYSTEM ${OGRE_INCLUDE_DIRS})
but passes the plain OGRE_INCLUDE_DIRS variable on in catkin_package(INCLUDE_DIRS ...).
There is no way to specify a SYSTEM include there.
Consequently all downstream projects including rviz headers will see OGRE's warnings
and have no easy way to avoid them because the correct OGRE include path is only one entry in
${rviz_INCLUDE_DIRS} (or more likely ${catkin_INCLUDE_DIRS}).
Came up in moveit/moveit_task_constructor#273 (comment)