Skip to content

Conversation

wolfv
Copy link
Member

@wolfv wolfv commented May 2, 2025

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]

let tmp_dir = tempfile::tempdir()?;
let cmake_file = tmp_dir.path().join("CMakeLists.txt");

let mut cmake_content = String::from("cmake_minimum_required(VERSION 3.15)\nproject(cmake_test)\n\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trim21
Copy link
Contributor

trim21 commented May 20, 2025

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
Copy link
Contributor

trim21 commented May 20, 2025

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

@traversaro
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants