lopsided98 / nix-ros-overlay

ROS overlay for the Nix package manager
Apache License 2.0
192 stars 77 forks source link

colcon build fails #309

Closed Educorreia932 closed 1 year ago

Educorreia932 commented 1 year ago

Trying to build a package with colcon build command, I'm getting the following error:

By not providing "Findament_cmake_core.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"ament_cmake_core", but CMake did not find one.

Could not find a package configuration file provided by "ament_cmake_core"
with any of the following names:

    ament_cmake_coreConfig.cmake
    ament_cmake_core-config.cmake

Add the installation prefix of "ament_cmake_core" to CMAKE_PREFIX_PATH or
set "ament_cmake_core_DIR" to a directory containing one of the above
files.  If "ament_cmake_core" provides a separate development package or
SDK, be sure it has been installed.

This is the flake.nix file I'm using for development:

{
    inputs = {
        nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
        flake-utils.url = "github:numtide/flake-utils";
        ros-overlay.url = "github:lopsided98/nix-ros-overlay";
    };

    outputs = { self, nixpkgs, flake-utils, ros-overlay, ... }:
        with nixpkgs.lib;
        with flake-utils.lib;

        eachSystem allSystems (system: let
            pkgs = import nixpkgs {
                inherit system;
                overlays = [ ros-overlay.overlays.default ];
            };
        in {
            devShells.default = with pkgs; mkShell {
                buildInputs = with rosPackages.iron; [
                    (buildEnv {
                        paths = [
                            colcon
                            ros-core
                            rqt
                            rqt-action
                            rqt-common-plugins
                            rqt-gui
                            rqt-gui-cpp
                            rqt-gui-py
                            turtlesim
                        ];
                    })
                ];
            };
        });
}
Educorreia932 commented 1 year ago

I discovered the problem. I was missing the ament-cmake-core package