Search code examples
cmakecommand-line-interfaceubuntu-16.04roscatkin

Compiling multiple packages in same folder in ROS


I have 4 separate packages:

  1. https://github.com/catkin/catkin_simple
  2. https://github.com/ethz-asl/glog_catkin
  3. https://github.com/ethz-asl/asctec_mav_framework
  4. https://github.com/ethz-asl/ethzasl_msf

I saved them in a master folder and tried compiling them using catkin_make and got the following cmake error: CMake Error at devel/share/glog_catkin/cmake/glog_catkinConfig.cmake:148 (message):

  Project 'msf_core' tried to find library 'glog'.  The library is neither a
  target nor built/installed properly.  Did you compile project
  'glog_catkin'? Did you find_package() it before the subdirectory containing
  its code is included?
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  ethzasl_msf/msf_core/CMakeLists.txt:17 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/yukti/Desktop/MSF_PACKAGE/build/CMakeFiles/CMakeOutput.log".
See also "/home/yukti/Desktop/MSF_PACKAGE/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

So I tried compiling them individually. After compiling one of them and trying to compile the others, I got the following error:

CMake Error: The source "/home/yukti/Desktop/MSF_PACKAGE/asctec_mav_framework-master/CMakeLists.txt" does not match the source "/home/yukti/Desktop/MSF_PACKAGE/catkin_simple-master/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
Invoking "cmake" failed

Another thing I tried was creating multiple folders that individually stored each package and compiling them. I still failed to make it work.

I am having trouble determining if I need to create multiple catkin workspaces or try overlaying them or if there is a simpler solution to the problem.

Thanks for the help!


Solution

  • Placing multiple packages inside a workspace is possible and a fundamental approach in ROS.

    The error

    Project 'msf_core' tried to find library 'glog'.

    tells that the glog library is needed to compile but missing. Check out How to install and use GLog and install glog like

    sudo apt install libgoogle-glog-dev
    

    After installing the library compilation should be possible.