rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

feat: add cmake/pkg-config tests

Open wolfv opened this issue 7 months ago • 3 comments

Ideating some additional checks:

  • test if cmake can execute find_package successfully
  • test if pkg-config finds the package successfully

The cmake test unfortunately requires compilers to be installed as CMake is going to search for them.

For pkg-config I am not sure what to call the second key.

Tests look like:

tests:
  - cmake:
      find_package: [xtensor]
  - pkg_config:
      pkg_config: [xtensor]

wolfv avatar May 02 '25 11:05 wolfv

The cmake test unfortunately requires compilers to be installed as CMake is going to search for them.

https://stackoverflow.com/a/46177192/8062017 does this work?

trim21 avatar May 20 '25 04:05 trim21

also there is a existing cli tool for cmake https://anaconda.org/conda-forge/cmake-package-check

trim21 avatar May 20 '25 05:05 trim21

The cmake test unfortunately requires compilers to be installed as CMake is going to search for them.

https://stackoverflow.com/a/46177192/8062017 does this work?

I would avoid to set the LANGUAGES in CMake to NONE. Even if that permits the basic project to be correctly configured, a <pkg>Config.cmake file may assume that the C or the C++ (as those are the two languages enabled by default in CMake projects) and fails in hard to debug ways in case they are invoked from a NONE project.

traversaro avatar May 27 '25 21:05 traversaro