I work on packaging for conda-forge, and we often want to separate multiple outputs for one project (commonly separating a shared library and language bindings, but could be any reason to subset files into outputs).
This often amounts to running build once, then install specific components in multiple stages to easily track different subsets of files. However, one thing I haven’t figured out how to do easily: install everything except specified component(s).
Basically, I want the pattern:
cmake --install build --exclude-component some-component # artifact 1 cmake --install build --component some-component # artifact 2
but I haven’t been able to produce artifact 1 without patching the CMakeLists to add
EXCLUDE_FROM_ALL to all the components I want to select separately. Is there a way to do this without patching upstream CMakeLists?
If I assume everything is in a component (not a safe assumption, I think), I could always do
--component installs, but I don’t see a way to discover what all the components are to produce the initial list. Does that command exist?
this package is an example of splitting a cmake build into components, where patching in EXCLUDE_FROM_ALL is used to get it to do what I want.