cmake-conan
cmake-conan copied to clipboard
Added [buildenv] Field Generation
Modified the detect_host_profile
function in conan_provider.cmake
to support the generation of the [buildenv] field. This enhancement allows for a closer integration with the compilers configured in CMake, thereby improving usability for cross-compilation and cross-platform scenarios.
Please note that as of https://github.com/conan-io/cmake-conan/pull/566 - the compiler_executables
configuration variable is set and propagated - this should negate the need for CC
and CXX
. Note that this needs CMake to be aware of both compilers (which is not always the case), so requires both to be specified (either by defining CMAKE_<LANG>_COMPILER
, or letting CMake find it if it is defined as a language in the project()
call or an enable_language()
.
The linker is more tricky - since in a lot of scenarios CMake performs linking via the compiler, and CMAKE_LINKER
is, to the best of my knowledge, not documented. For cases where it is necessary to define these (via [buildenv]
or similar, I would suggest looking at the just-merged feature of customizing the profile:
https://github.com/conan-io/cmake-conan/tree/develop2#customizing-conan-profiles