Skip to content

Commit

Permalink
corrected configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-kriegel committed Nov 9, 2024
1 parent c43bdd1 commit a89e278
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
cmake -S . -B build -DACADOS_CPP_BUILD_TESTS=ON CMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake -S . -B build -DACADOS_CPP_BUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
50 changes: 50 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
description = "C++ wrapper for ACADOS.";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";

# acados.url = "github:adrian-kriegel/acados-nix";
};

outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
packages.x86_64-linux.acados-cpp = pkgs.stdenv.mkDerivation rec {
pname = "acados-cpp";
version = "0.1.0";

src = ./.;

# Intentionally not adding ACADOS as a dependency. ACADOSCpp is header-only
# so nothing links to ACADOS and no build step is required.
# Users can just use their own ACADOS installation.
buildInputs = [];

nativeBuildInputs = [];

installPhase = ''
mkdir -p $out/include
cp -r ${src}/include/* $out/include
mkdir -p $out/lib/cmake/${pname}
cp ${src}/cmake/* $out/lib/cmake/${pname}
'';

meta = with pkgs.lib; {
description = "C++ wrapper for ACADOS.";
homepage = "https://github.com/adrian-kriegel/ACADOSCpp";
license = licenses.mit;
maintainers = [ maintainers.adrian-kriegel ];
};
};
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = [
pkgs.cmake
# Only adding acados in the dev shell.
# import acados { inherit pkgs; }
];
};
};
}

0 comments on commit a89e278

Please sign in to comment.