catkin_make_isolated /usr/bin/ld: cannot find -l<lib_name>
I'm trying to run catkin_make_isolated on my workspace and it fails.
==> Processing catkin package: 'motor_driver_pkg'
==> Building with env: '/home/user/catkin_ws/devel_isolated/kinematics/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/home/user/catkin_ws/build_isolated/motor_driver_pkg'
==> make -j6 -l6 in '/home/user/catkin_ws/build_isolated/motor_driver_pkg'
[ 50%] Linking CXX executable /home/user/catkin_ws/devel_isolated/motor_driver_pkg/lib/motor_driver_pkg/dc_motor_driver
/usr/bin/ld: cannot find -lkinematics
collect2: error: ld returned 1 exit status
CMakeFiles/dc_motor_driver.dir/build.make:119: recipe for target '/home/user/catkin_ws/devel_isolated/motor_driver_pkg/lib/motor_driver_pkg/dc_motor_driver' failed
make[2]: *** [/home/user/catkin_ws/devel_isolated/motor_driver_pkg/lib/motor_driver_pkg/dc_motor_driver] Error 1
CMakeFiles/Makefile2:1091: recipe for target 'CMakeFiles/dc_motor_driver.dir/all' failed
make[1]: *** [CMakeFiles/dc_motor_driver.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'motor_driver_pkg':
Command '['/home/user/catkin_ws/devel_isolated/kinematics/env.sh', 'make', '-j6', '-l6']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/user/catkin_ws/build_isolated/motor_driver_pkg && /home/user/catkin_ws/devel_isolated/kinematics/env.sh make -j6 -l6
Command failed, exiting.
I have a package called kinematics, this is the CMakeLists.txt of that package
cmake_minimum_required(VERSION 2.8.3)
project(kinematics)
find_package(catkin REQUIRED COMPONENTS
controller_interface
roscpp
)
###################################
## catkin specific configuration ##
###################################
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package()
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(kinematics
src/ackermann.cpp
src/diff_drive.cpp)
target_link_libraries(kinematics ${catkin_LIBRARIES})
#############
## Install ##
#############
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE)
install(TARGETS kinematics
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
I have another package called motor_driver_pkg that takes uses the library "kinematics" from kinematics package. This is the CMakeLists.txt for that package.
cmake_minimum_required(VERSION 2.8.3)
project(motor_driver_pkg)
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
kinematics
)
###################################
## catkin specific configuration ##
###################################
catkin_package()
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(include
${catkin_INCLUDE_DIRS}
${kinematics_INCLUDE_DIRS}
)
add_executable(dc_motor_driver src/dc_motor_driver.cpp)
target_link_libraries(dc_motor_driver kinematics ${catkin_LIBRARIES})
This works completely fine with catkin_make. But fails when I run catkin_make_isolated. I understand that the motor_driver_pkg is not able to find the kinematics library. Need help. Don't know what is going wrong.