# colcon build: CMake Error at CMakeLists.txt: find_package(catkin) failed

- **ID:** `ros2/colcon-build-catkin-package-not-found`
- **Domain:** ros2
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

A ROS1 (catkin) package is being built in a ROS2 workspace, but catkin is not available or the workspace is not configured for mixed builds.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| ROS2 Humble (Ubuntu 22.04) | active | — | — |
| ROS2 Iron (Ubuntu 22.04) | active | — | — |
| ROS2 Rolling (Ubuntu 24.04) | active | — | — |

## Workarounds

1. **Remove the catkin package from the workspace or migrate it to ament_cmake. If you need ROS1 compatibility, use a separate catkin workspace and source it before building the ROS2 workspace.** (90% success)
   ```
   Remove the catkin package from the workspace or migrate it to ament_cmake. If you need ROS1 compatibility, use a separate catkin workspace and source it before building the ROS2 workspace.
   ```
2. **Use colcon's --merge-install or --cmake-args to include the catkin workspace: colcon build --cmake-args -DCATKIN_DEVEL_PREFIX=/path/to/catkin_ws/devel** (70% success)
   ```
   Use colcon's --merge-install or --cmake-args to include the catkin workspace: colcon build --cmake-args -DCATKIN_DEVEL_PREFIX=/path/to/catkin_ws/devel
   ```

## Dead Ends

- **Install catkin via apt and rebuild** — catkin is not a ROS2 package; even if installed, colcon won't find it without ROS1 bridge setup. (90% fail)
- **Manually set CMAKE_PREFIX_PATH to catkin workspace** — colcon ignores manual CMAKE_PREFIX_PATH overrides for workspace isolation. (85% fail)
