Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One good thing to do would be to just use catkin at the top level, this is the best way to get access (find_package) to all of the packages in the catkin workspace at build time in a single CMake invocation.

Another strategy might be to just have a catkin workspace in your project and call add_subdirectory on the catkin workspace.

Either way I would not call catkin_make directly from another CMake project. All catkin_make does is something like this:

# In catkin workspace with packages in the `src` folder
cd src
catkin_init_workspace # This creates the CMakeLists.txt in the top of the workspace
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_SPACE=../devel
make

There is no magic in catkin_make which is required to build a catkin workspace. You should be able to copy over the top-level.cmake file to the catkin workspace in your project and use add_subdirectory on it.

One The best practice would be to build the ROS stuff in a catkin workspace and then make install those packages separate from your other project and then build your project on top of the installed catkin packages, which can be found using find_package or pkg-config.

If you are dead set on integrating several catkin packages in to a single CMake project, one good thing to do would be to just use catkin at the top level, this is the best way to get access (find_package) to all of the packages in the catkin workspace at build time in a single CMake invocation.

Another strategy might be to just have a catkin workspace in your project and call add_subdirectory on the catkin workspace.

Either way I would not call catkin_make directly from another CMake project. All catkin_make does is something like this:

# In catkin workspace with packages in the `src` folder
cd src
catkin_init_workspace # This creates the CMakeLists.txt in the top of the workspace
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_SPACE=../devel
make

There is no magic in catkin_make which is required to build a catkin workspace. You should be able to copy over the top-level.cmake file to the catkin workspace in your project and use add_subdirectory on it.

The best practice would be to build the ROS stuff in a catkin workspace and then make install those packages separate from your other project and then build your project on top of the installed catkin packages, which can be found using find_package or pkg-config.

If you are dead set on integrating several catkin catkin packages in to a single CMake project, one good thing to do would be to just use catkin at the top level, for all of your project, so that your "larger" project is just another package in the catkin workspace, this is the best way to get access (find_package) to all of the packages in the catkin catkin workspace at build time in a single CMake invocation.

Another strategy might be to just have a catkin workspace in your project and call add_subdirectory on the catkin workspace.

Either way I would not call catkin_make directly from another CMake project. All catkin_make does is something like this:

# In catkin workspace with packages in the `src` folder
cd src
catkin_init_workspace # This creates the CMakeLists.txt in the top of the workspace
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_SPACE=../devel
make

There is no magic in catkin_make which is required to build a catkin workspace. You should be able to copy over the top-level.cmake file to the catkin workspace in your project and use add_subdirectory on it.

The best practice would be to build the ROS stuff in a catkin workspace and then make install those packages separate from your other project and then build your project on top of the installed catkin packages, which can be found using find_package or pkg-config.

The other good thing to do would be to just use catkin for all of your project, so that your "larger" project is just another package in the catkin workspace, this is the best way to get access (find_package) to all of the packages in the catkin workspace at build time in a single CMake invocation, and this is what catkin was designed to do.

If you are dead set on integrating several catkin packages in to a single CMake project, one good thing to do would be to just use for all of your project, so that your "larger" project is just another package in the catkin workspace, this is the best way to get access (find_package) to all of the packages in the catkin workspace at build time in a single CMake invocation.

Another strategy might be to just have a catkin workspace in your project and call add_subdirectory on the catkin workspace.workspace. I haven't tried this and I am not sure what side effects this might have, but you are welcome to try it.

Either way I would not call catkin_make directly from another CMake project. All catkin_make does is something like this:

# In catkin workspace with packages in the `src` folder
cd src
catkin_init_workspace # This creates the CMakeLists.txt in the top of the workspace
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_SPACE=../devel
make

There is no magic in catkin_make which is required to build a catkin workspace. You should be able to copy over the top-level.cmake file to the catkin workspace in your project and use add_subdirectory on it.

The best practice would be to build the ROS stuff in a catkin workspace and then make install those packages separate from your other project and then build your project on top of the installed catkin packages, which can be found using find_package or pkg-config.

The other good thing to do would be to just use catkin for all of your project, so that your "larger" project is just another package in the catkin workspace, this is the best way to get access (find_package) to all of the packages in the catkin workspace at build time in a single CMake invocation, and this is what catkin was designed to do.

If you are dead set on integrating several catkin packages in to a single CMake project, another strategy might be to just have a catkin workspace in your project and call add_subdirectory on the catkin workspace. I haven't tried this and I am not sure what side effects this might have, but you are welcome to try it.

Either way I would not call catkin_make directly from another CMake project. All catkin_make does is something like this:

# In catkin workspace with packages in the `src` folder
cd src
catkin_init_workspace # This creates the CMakeLists.txt in the top of the workspace
cd ..
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_SPACE=../devel
make

There is no magic in catkin_make which is required to build a catkin workspace. You should be able to copy over the top-level.cmake file to the catkin workspace in your project and use add_subdirectory on it.

The best practice would be to build the ROS stuff in a catkin catkin workspace and then make install those packages separate from your other project and then build your project on top of the installed catkin catkin packages, which can be found using find_package or pkg-config.

The other good thing to do would be to just use catkin for all of your project, so that your "larger" project is just another package in the catkin workspace, this is the best way to get access (find_package) (find_package) to all of the packages in the catkin workspace at build time in a single CMake invocation, and this is what catkin was designed to do.

If you are dead set on integrating several catkin packages in to a single CMake project, another strategy might be to just have a catkin workspace in your project and call add_subdirectory on the catkin workspace. I haven't tried this and I am not sure what side effects this might have, but you are welcome to try it.

Either way I would not call catkin_make directly from another CMake project. All catkin_make does is something like this:

# In catkin workspace with packages in the `src` folder
cd src
catkin_init_workspace # This creates the CMakeLists.txt in the top of the workspace
cd ..
mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_SPACE=../devel
make

There is no magic in catkin_make which is required to build a catkin workspace. You should be able to copy over the top-level.cmake file to the catkin workspace in your project and use add_subdirectory on it.