Summary
The build_type specified in a user profile passed via CONAN_HOST_PROFILE is not respected and is overriden by the CMAKE_BUILD_TYPE of the parent project.
Expected Behaviour
It should be possible to build the dependencies of the project with a different build type from the project itself, for example, build a Debug project with Release dependencies. The build_type specified in a profile supplied via CONAN_HOST_PROFILE should be respected.
See also This comment - in which the expected behaviour is described as intended.
Actual Behaviour
All dependencies are built using the build type corresponding to CMAKE_BUILD_TYPE. Any settings in a custom profile are overriden.
Steps to Reproduce
Using the attached example project
- Run
cmake --preset default
The example project specifies build_type=Debug in the profile passed to CONAN_HOST_PROFILE, but dependencies are built with build_type=Release:
======== Input profiles ========
Profile host:
[settings]
...
build_type=Release
...
Profile build:
[settings]
...
build_type=Release
...
Summary
The
build_typespecified in a user profile passed viaCONAN_HOST_PROFILEis not respected and is overriden by theCMAKE_BUILD_TYPEof the parent project.Expected Behaviour
It should be possible to build the dependencies of the project with a different build type from the project itself, for example, build a
Debugproject withReleasedependencies. Thebuild_typespecified in a profile supplied viaCONAN_HOST_PROFILEshould be respected.See also This comment - in which the expected behaviour is described as intended.
Actual Behaviour
All dependencies are built using the build type corresponding to
CMAKE_BUILD_TYPE. Any settings in a custom profile are overriden.Steps to Reproduce
Using the attached example project
cmake --preset defaultThe example project specifies
build_type=Debugin the profile passed toCONAN_HOST_PROFILE, but dependencies are built withbuild_type=Release: