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
The contents of conan_toolchain.cmake consist of a set of logical blocks that are controlled via https://docs.conan.io/2/reference/tools/cmake/cmaketoolchain.html#customizing-the-content-blocks
currently, it is possible to remove blocks, or add/replace with new templates. But if we want to "choose" which blocks to keep, it isn't as easy, as removing is only possible if the names are known beforehand.
use case:
user would like to keep the find paths (CMAKE_PREFIX_PATH and so on), but nothing else, as the user already has pre-existing CMake toolchain files that they must use
The only way of doing it today is by knowing the names of all existing blocks:
It would be good if this could be simplified, to something like:
for block in tc.block.names():
if name != "find_paths":
tc.block.remove(block)
which would cause the conan_toolchain.cmake file to be generated with only the selected contents.
We should also be aware that this would make the names of the blocks part of the API - renaming blocks could be a breaking change, so may want to settle on an interface that is robust to changes in a way that future Conan updates don't break recipes
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
What is your suggestion?
The contents of
conan_toolchain.cmake
consist of a set of logical blocks that are controlled viahttps://docs.conan.io/2/reference/tools/cmake/cmaketoolchain.html#customizing-the-content-blocks
currently, it is possible to remove blocks, or add/replace with new templates. But if we want to "choose" which blocks to keep, it isn't as easy, as removing is only possible if the names are known beforehand.
use case:
CMAKE_PREFIX_PATH
and so on), but nothing else, as the user already has pre-existing CMake toolchain files that they must useThe only way of doing it today is by knowing the names of all existing blocks:
It would be good if this could be simplified, to something like:
which would cause the
conan_toolchain.cmake
file to be generated with only the selected contents.We should also be aware that this would make the names of the blocks part of the API - renaming blocks could be a breaking change, so may want to settle on an interface that is robust to changes in a way that future Conan updates don't break recipes
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: