0

I have a Catkin workspace that I am trying to move over to the Colcon build system. I've been having some trouble with modifying my CMakeLists to accommodate this, and am currently seeing this error when running colcon build.

CMake Error at ardupilot_gazebo/cmake_install.cmake:55 (file):
  file INSTALL cannot copy file
  "/home/karl/Documents/aarl_ws/build/src/devel/lib/libArduCopterIRLockPlugin.so"
  to
  "/usr/lib/x86_64-linux-gnu/gazebo-9/plugins/libArduCopterIRLockPlugin.so"

I am assuming this is happening as /usr/lib is not writable by my current user, so the shared object file cannot be copied over. The space builds properly when running catkin build.

Is there something I can do to modify the lib location to a place that my user has write permissions over?

So far I have tried messing with the CATKIN_INSTALL_PREFIX to no avail, I am wary of running sudo colcon build and messing with the directory permissions on /usr/lib.

For context, the error arises when building the Ardupilot_Gazebo plugin. We think it's an issue with the reference to the $GAZEBO_LIBARIES. Is there some way to create a local Gazebo lib path?

Thanks!

Karl Swanson
  • 99
  • 1
  • 7

1 Answers1

0

What you need to set is the CMAKE_INSTALL_PREFIX variable. CMake will install the built application in the given path.

iblancasa
  • 334
  • 1
  • 5
  • I tried adding: `set(CMAKE_INSTALL_PREFIX /home/karl/Documents/libs)` To my CMakeLists.txt file and attempted to build. Interestingly Colcon seems to ignore it and the same error arises. – Karl Swanson Apr 29 '20 at 00:30
  • Did you try to provide the `--cmake-args` parameter to colcon https://colcon.readthedocs.io/en/released/reference/verb/build.html#cmake-specific-arguments Take into account that `CMAKE_INSTALL_PREFIX` will be set in the CMake cache and you need to force to overwrite it if you want to do that change from the CMakeLists.txt file (not recommended) or provide it from the commandline (recommended way and it will be set in the cache properly) – iblancasa Apr 29 '20 at 09:19