catkin_make ignores INCLUDE_DIRS directive in catkin_generate_package
Hi All,
I am having a problem with catkin_make ignoring an include directory directive. The only way for catkin_make to 'see' it is to use the include_directories(src/include)
directive. For some reason the INCLUDE_DIRS
directive in catkin_package
works in another project of mine just fine, but not in this project. It also has the unpleasant side effect of rebuilding all other projects when include_directories
is first used, which is not pleasant if you have RViz in your catkin_make source tree.
Here is the CMakeLists.txt file I am using. There are probably a few unneeded dependencies as this file is derived from another project. I still have not got my head around the intracacies of CMake and its interactoins with catkin_make and ROS.
# Instructions from
# wiki.ros.org/catkin/CMakeLists.txt
#
# 1. Required CMake Version (cmake_minimum_required)
cmake_minimum_required(VERSION 2.8.3)
# 2. Package Name (project())
project(can_bus_read)
# 3. Find other CMake/Catkin packages needed for build (find_package())
find_package(catkin REQUIRED nodelet roscpp rospy std_msgs message_generation sensor_msgs)
find_package(roscpp REQUIRED)
# 4. Message/Service/Action Generators (add_message_files(), add_service_files(), add_action_files())
add_message_files(
FILES
canbus_raw.msg
)
# 5. Invoke message/service/action generation (generate_messages())
catkin_python_setup()
generate_messages(DEPENDENCIES sensor_msgs)
# 6. Specify package build info export (catkin_package())
catkin_package(
INCLUDE_DIRS src/include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp
DEPENDS)
# 7. Libraries/Executables to build (add_library()/add_executable()/target_link_libraries())
include_directories(src/include)
add_executable(candump src/candump.c
src/lib.c
src/lib.h
src/terminal.h
src/include/linux/can.h
src/include/linux/can/bcm.h
src/include/linux/can/error.h
src/include/linux/can/gw.h
src/include/linux/can/isotp.h
src/include/linux/can/netlink.h
src/include/linux/can/raw.h
)
target_link_libraries(candump ${catkin_LIBRARIES})
add_definitions(-D_LINUX -D__STDC_FORMAT_MACROS -DUSE_INTTYPES__ -DHAVE_PCAP -D_FILE_OFFSET_BITS=64 -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN)
# 8. Tests to build (catkin_add_gtest())
# 9. Install rules (install())
#### END OF FILE #####
`