catkin/cmake include upstream path before debian path?
I have a problem where I want to depend on a newer interface than what is in the debain install. To do this I am building the library I'm depending on (moveit) from source in an upstream workspace. However for some reason catkin/cmake is creating an include list that is always including the debian based includes first. This is from the compile step:
-isystem /home/tyler/workspace/ws_upstream/install/include
-I/opt/ros/melodic/include
Here is the documentation from the man page of g++
(-isystem is always searched after -I):
The lookup order is as follows:
1. For the quote form of the include directive, the directory of the current file is searched first.
2. For the quote form of the include directive, the directories specified by -iquote options are searched in left-to-right
order, as they appear on the command line.
3. Directories specified with -I options are scanned in left-to-right order.
4. Directories specified with -isystem options are scanned in left-to-right order.
5. Standard system directories are scanned.
6. Directories specified with -idirafter options are scanned in left-to-right order.
How can I instruct catkin/cmake to include my upstream include path first (by changing the -isystem to -I or something similar)?
Here are the relevant parts of my CMakeLists.txt:
find_package(catkin REQUIRED COMPONENTS
moveit_core
moveit_ros_planning
moveit_ros_planning_interface
roscpp
)
catkin_package(
CATKIN_DEPENDS
moveit_core
moveit_ros_planning
moveit_ros_planning_interface
roscpp
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
DEPENDS
Boost
EIGEN3
)
include_directories(
include/
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIRS})
add_library(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})