include directory order
ibtaylor opened this issue · 2 comments
ibtaylor commented
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
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
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.