You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there doesn't seem to be a good way to access executable targets of a package dependency in the CMake generator. For example, the glslang package provides a library but also a compiler that can be used by a dependent package.
Currently conan generates targets for each package library target (e.g. CONAN_LIB::<package_name>-<target-name>) but not for executables. This means the only way to get the actual executable is through CMake's find_program feature. This seems to defeat the point of using a package manager for dependencies in the first place.
Yes, we are gradually adding support for better modeling for executables, for example 1.37 now has added some experimental support for generated xxxx-config.cmake files for build_requires that contains executables. Please check that the supported CMake integration in Conan 2.0 will be the new one in CMakeDeps and CMakeToolchain.
We have also tried to add explicit cpp_info.exes field in the cpp_info information for a while.
Note, however, that for many cases you don't need the CMake target, and it might be more convenient to use it directly from the recipe (I find more convenient to script there than in CMakeLists), as the executables will be in the path, so they can directly be used.
I am labeling this as an accepted feature request, but might not get priority right now, but for Conan 2.0.
Conan 2.9 introduced a new CMakeDeps generator that generate targets for executables: #16964
It is in dev-state at the moment, enabled with -c tools.cmake.cmakedeps:new=will_break_next (the value changes in every release to guarantee dev-status and not usable in production until we get enough feedback).
I am closing this ticket as solved, feedback very welcome, please create new tickets for any feedback or issue related to this new CMakeDeps generator, many thanks!
Currently there doesn't seem to be a good way to access executable targets of a package dependency in the CMake generator. For example, the glslang package provides a library but also a compiler that can be used by a dependent package.
Currently conan generates targets for each package library target (e.g.
CONAN_LIB::<package_name>-<target-name>
) but not for executables. This means the only way to get the actual executable is through CMake'sfind_program
feature. This seems to defeat the point of using a package manager for dependencies in the first place.The text was updated successfully, but these errors were encountered: