conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.24k stars 980 forks source link

[question] [2.0] Cmake.ctest missing libraries #12419

Open beenjohn opened 2 years ago

beenjohn commented 2 years ago

For some background, I'm building a package that depends on gnuradio which complicates things in itself.

When trying to run cmake(self).ctest after a successful build, none of the dependency libraries are available. This is all being done in the build method of the recipe. I can make things work by adding the cmake path to the run environment and running ctest in the conanrunenv.

From looking at conan.tools.cmake.cmake it doesn't look like the test call is made aware of the toolchain or other build settings. What is the intended use of ctest? Should I be running ctest in a different area of the recipe?

beenjohn commented 2 years ago

I should add that I'm using a conan recipe for cmake, so cmake is only accessible in the build environment.

memsharded commented 2 years ago

Hi @beenjohn

Thanks for your report. I think that some more detail is necessary. The best way to start would be to start from the conan new hello/0.1 -m=cmake_lib and have a full reproducible example. Because for example: