CMake find_package doesn't work well using pixi-build #3224
-
I'm trying to add a C++ package to my pixi environment. because it's not on any conda channel, I tried to write a recipe file to build the package. But the find_package function in CMake did not find the Here is my pixi.toml [project]
authors = ["Ericsii <[email protected]>"]
channels = ["robostack-humble", "robostack-staging", "conda-forge"]
name = "legged_navigation"
platforms = ["linux-64"]
version = "0.1.0"
preview = ["pixi-build"]
[tasks]
[dependencies]
compilers = ">=1.9.0,<2"
cmake = ">=3.31.6,<4"
pkg-config = ">=0.29.2,<0.30"
make = ">=4.4.1,<5"
ninja = ">=1.12.1,<2"
gtsam = ">=4.2.0,<5"
gtsam_points = { path = "./recipes/gtsam_points" } recipes/gtsam_points/recipe.yaml context:
name: gtsam_points
version: 1.0.7
package:
name: ${{ name|lower }}
version: ${{ version }}
source:
git: https://github.com/koide3/gtsam_points.git
tag: v${{ version }}
build:
number: 0
requirements:
build:
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
- cmake
- ninja
host:
- boost
- eigen
- gtsam
- openmp
- tbb recipes/gtsam_points/build.sh #! /bin/bash
extra_cmake_args=(
-GNinja
-DBUILD_TESTS=OFF
-DBUILD_TESTS_PCL=OFF
-DBUILD_DEMO=OFF
-DBUILD_EXAMPLE=OFF
-DBUILD_TOOLS=OFF
-DBUILD_WITH_TBB=ON
-DBUILD_WITH_OPENMP=ON
-DBUILD_WITH_CUDA=OFF
-DBUILD_WITH_CUDA_MULTIARCH=OFF
-DBUILD_WITH_MARCH_NATIVE=OFF
-DENABLE_CPPCHECK=OFF
-DENABLE_COVERAGE=OFF
)
mkdir build && cd build
cmake ${CMAKE_ARGS} "${extra_cmake_args[@]}" \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
$SRC_DIR
ninja
# The `install` command will take care of copying the files to the right place
ninja install |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Pixi build log here |
Beta Was this translation helpful? Give feedback.
-
I added a debug message to the In the CMAKE_PREFIX_PATH, I did find the GTSAM config in |
Beta Was this translation helpful? Give feedback.
It seems that a
FindGTSAM.cmake
module is present in the CMake module path, so that takes priority, and that is the one that does not work, see https://github.com/koide3/gtsam_points/blob/v1.0.7/cmake/FindGTSAM.cmake . It seems that the file was delete in recent versions? Probably you can add a patch deleting it?