library dependencies
I have a catkin library that I'm trying to edit the CMakeLists.txt file for so it builds a package containing services before it compiles the package.
I just learned that in order to do this for a regular package of executables, you use the add_dependencies()
keywords in Cmake. How do you go about doing this for a library?
cmake_minimum_required(VERSION 2.8.3)
project(baxter_kinematics)
find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
sensor_msgs
tf
cwru_srv
)
include_directories(
${Eigen_INCLUDE_DIRS}
${PROJECT_NAME}/include
)
add_definitions(${EIGEN_DEFINITIONS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp std_msgs sensor_msgs tf baxter_core_msgs cwru_srv
DEPENDS eigen system_lib
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(
${PROJECT_NAME}
src/baxter_kinematics.cpp
)
## Declare a cpp executable
add_executable(baxter_kinematics_test_main src/baxter_kinematics_test_main.cpp)
target_link_libraries(baxter_kinematics_test_main baxter_kinematics ${catkin_LIBRARIES})
## ???
## add_dependencies(baxter_kinematics cwru_srv)
Isn't this a duplicate of having to compile msgs and srvs first?
The linked docs show you this:
Which completely answers your question.
Sure does. I should probably slow down a bit.. Haha, sorry about that again.