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

How to copy .so file from src to devel when catkin_make?

asked 2018-08-21 13:53:31 -0500

Crisliu7 gravatar image

updated 2018-08-21 16:23:40 -0500

jayess gravatar image

I have an external .so library to link. If I put it only in src/lib/ and try to find_library() it, the catkin_make always fail. But if I manually put the .so file in devel/lib/, it works. Is there any way that I can automatically copy the .so file from src/lib/ to devel/lib/ ?

Here is a confusing thing. When I output the ${PROJECT_SOURCE_DIR}, it is the src folder, but when I use this address to find_library, it will be directed to devel folder. But I didn't put .so file in devel/lib/.

My code in CMakeLists.txt:

message("PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
find_library(DYNAMSOFT_LIBRARY 
  NAMES libDynamsoftBarcodeReader.so 
  PATHS ${PROJECT_SOURCE_DIR}/lib/)
message("DYNAMSOFT_LIBRARY: ${DYNAMSOFT_LIBRARY}")

Corresponding output in terminal:

PROJECT_SOURCE_DIR: /home/zhiyang/mfp_workspace/src/srsnode_barcode_reader
DYNAMSOFT_LIBRARY: /home/zhiyang/mfp_workspace/devel/lib/libDynamsoftBarcodeReader.so
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-08-21 17:08:29 -0500

ahendrix gravatar image

The ROS package for the prosilica gige SDK does something similar: https://github.com/ros-drivers/prosil... . It's a bit more complex because it's also packaging libraries for several different architectures and detecting the architecture at build time.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2018-08-21 13:53:31 -0500

Seen: 284 times

Last updated: Aug 21 '18