ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Based on dirk-thomas' answer, here is the complete solution for reference:

1- I created a cmake.in file in package A's cmake directory with the following content:

# force automatic escaping of preprocessor definitions
cmake_policy(PUSH)
cmake_policy(SET CMP0005 NEW)

add_definitions(@PCL_DEFINITIONS@)
link_directories(@PCL_LIBRARY_DIRS@)

cmake_policy(POP)

2- I modified A's CMakeLists file as follow:

2.1- I added

CFG_EXTRAS A-extras.cmake

to the catkin_package() macro

2.2- I added

include(${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/A-extras.cmake)

to the CMakeLists.

Based on dirk-thomas' answer, here is the complete solution for reference:

1- I created a cmake.in file in package A's cmake directory A/cmake/A-extras.cmake.in with the following content:

# force automatic escaping of preprocessor definitions
cmake_policy(PUSH)
cmake_policy(SET CMP0005 NEW)

add_definitions(@PCL_DEFINITIONS@)
link_directories(@PCL_LIBRARY_DIRS@)

cmake_policy(POP)

2- I modified A's CMakeLists file as follow:

2.1- I added

CFG_EXTRAS A-extras.cmake

to the catkin_package() macro

2.2- I added

include(${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/A-extras.cmake)

to A's CMakeLists.txt so that the CMakeLists.definitions are used to build A itself