facontidavide / ros_type_introspection

Deserialize ROS messages that are unknown at compilation time
MIT License
61 stars 30 forks source link

include directory order #12

Closed ibtaylor closed 7 years ago

ibtaylor commented 7 years ago

when building, if you change the headers, you can run into the project being compiled against the installed headers rather than the current source headers.

I think this is more robust:

include_directories(SYSTEM
   ${catkin_INCLUDE_DIRS}
)
include_directories(BEFORE
   include
)
facontidavide commented 7 years ago

according to this document this should be sufficient http://docs.ros.org/api/catkin/html/howto/format2/building_libraries.html

include_directories(
    include
    ${catkin_INCLUDE_DIRS}
)
ibtaylor commented 7 years ago

Could be. I guess I normally use the SYSTEM one to suppress warnings from external headers unrelated to my project and also change some of the search order priority see -isystem for gcc. Think it affects quoted vs bracketed includes. Project includes should all be quoted, I believe.

But yeah, in this specific instance reordering could be sufficient.