Open SpaceIm opened 1 year ago
hum, I've missed https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html#build-context-build-modules.
But... why is it not automatic? Why consumers should have to know such internal details of their build requirements?
Indeed, files in cmake_build_modules
are totally part of CMake config file logic, they are not optional stuff when you want to properly emulate upstream config file, it's not something consumers should opt-in, they shouldn't be even aware of that because it's just a trick of recipes to emulate custom config file logic.
But... why is it not automatic? Why consumers should have to know such internal details of their build requirements?
Given that, I think that we could close this issue, and open another one to talk about whether we should include those build_context_build_modules
automatically or not. Only to avoid users messing with different topics.
Environment details
Steps to reproduce
recipes/btyacc/all
, and runconan create . --version 3.0
Logs
BTYACC_EXECUTABLE
is a custom CMake variables defined in a file listed incmake_build_modules
property ofbtyacc
recipe (see https://github.com/conan-io/conan-center-index/blob/fd03d6808dda34c7488399e36b31e1b5d0306caf/recipes/btyacc/all/conanfile.py#L50-L70).build_context_activated
ofCMakeDeps
(see https://github.com/conan-io/conan-center-index/blob/fd03d6808dda34c7488399e36b31e1b5d0306caf/recipes/btyacc/all/test_package/conanfile.py#L9-L20), and indeed abtyacc-config.cmake
file is generated.But in this generated config file, I can't see any include of the file defined in
cmake_build_modules
, leading to this error (CMakeLists of test package checks whether this variable is defined afterfind_package(btyacc REQUIRED CONFIG)
: https://github.com/conan-io/conan-center-index/blob/fd03d6808dda34c7488399e36b31e1b5d0306caf/recipes/btyacc/all/test_package/CMakeLists.txt#L6-L9)