That makes it even worse. So it's crap on top of crap. CMake is mostly used to build cross-platform software, but I don't think anybody uses ROS on a system other than Linux, so why not just use established tools like simple `make`?
That makes it even worse. So it's crap on top of crap. CMake is mostly used to build cross-platform software, but I don't think anybody uses ROS on a system other than Linux, so why not just use established tools like simple `make`?
I've seen several times that companies write their message passing stuff on top of ZeroMQ, mttq and what-have-you, while they could have spent all that time doing something novel as well. At the cost of using less than perfect tools made by someone else that a lot of people are also using.
[in any folder out of source]
mkdir build
cd build
cmake [source folder]
make
source devel/setup.bash
roslaunch your_fancy_package demonstrator_nodelet_or_whatever.launch
That works, but you can't mix it with catkin_make or other build tools (rosbuild). I.e. you can't just invoke catkin_make there, this won't work afaik.The source folder must contain a main CMakeLists.txt symlink which points to `/opt/ros/[distribution e.g. kinetic]/share/catkin/cmake/toplevel.cmake`. This symlink will be created when calling "catkin_init_workspace". You can also just put a copy of that file there to commit it in git. I do this and even modify it to include my own cmake modules and debugging stuff.
You can now layout your folders any way you want. That means the packages don't need to all be in the same folder, but can be grouped as necessary.
Example project layout:
project
├── cmake
| └── FindSomePackage.cmake
├── doc
| └── index.md
├── project_msgs
| ├── msg
| | ├── Foo.msg
| | └── Bar.msg
| ├── CMakeLists.txt
| └── package.xml
├── project_utils
| ├── include
| | └── project_utils
| | └── foo.h
| ├── launch
| | └── ...
| ├── scripts
| | └── do_stuff.py
| ├── src
| | └── foo.cpp
| ├── CMakeLists.txt
| └── package.xml
├── components
| ├── heisenberg_compensator
| | ├── include
| | | └── ...
| | ├── src
| | | └── ...
| | ├── CMakeLists.txt
| | └── package.xml
| ├── warp_controller
| | ├── include
| | | └── ...
| | ├── src
| | | └── ...
| | ├── CMakeLists.txt
| | └── package.xml
| ├── ...
|
├── .gitignore
├── readme.md
└── CMakeLists.txt -> /opt/ros/[distribution e.g. kinetic]/share/catkin/cmake/toplevel.cmake
should contain set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
You can put software components/packages in folders that are structured similar to project_utils / project_msg on any sublevel, I don't know what happens when you directly nest them though.. I wouldn't do that.https://github.com/gerkey/ros1_external_use
But if you're looking for good documentation and tutorials, then yes catkin is basically required, but I don't think that's unreasonable.