Can we change the order of package compilation in catkin_make command?
$ catkin_make
compiles all the ros packages available inside the catkin_ws
.
so, do we have any provision to change the order of the packages to be compiled.
with example:
catkin_ws:
/package_1
/package_2
/package_3: dependent on package_1 and package_2
if I want to compile all packages with
$ catkin_make
, I don't have control over which package should compile 1st. I want it to be compiled as above order.
So , do we have any provision for reordering the compilation of packages with catkin_make
. or should I go with .sh
file having individual compilation command?
Well, this should be done automatically when you specify the dependencies in your
CMakeLists.txt
correctly...I second @mgruhler the correct method is to specify the package dependencies in your CMakeLists file then catkin_make will automatically build things in the right order.
@mgruhler , would you please explaion what changes I need to make in the CMakeLists.txt of /package_3 . I have done: package_3/CMakeLists.txt/ find_package( package_1,package_2)
what else things need to be added ?
see the answer by @Dirk Thomas and the link to the docs therein. Basically, for every target (which is found in the calls
add_library(TARGET ..)
andadd_executable(TARGET ..)
) you need the respectiveadd_dependencies(TARGET ${catkin_EXPORTED_TARGETS})
calls.I have done all necessary changes but still I could not arrange the projects. after $catkin_make , the packages are arranged as /package_3 then /package_2, /package_1. @mgruhler
the error I am getting is: Could not find configuration file provided by "/package_1" with any of the following name package_1Config.cmake package_1-Config.cmake
You might want to share the exact content of your packages otherwise there is too much guessing involved.