install(CODE): EXCLUDE_FROM_ALL ignored when used together with ALL_COMPONENTS
When doing custom code installation using install(CODE)
,
ALL_COMPONENTS
keyword makes custom code installed for each component since 3.21 which is fine.
Using it together with EXCLUDE_FROM_ALL
is supposed to exclude this custom code from being called when doing componentless installation which does NOT happen.
When simply examining cmake_install.cmake, you can see that custom code is added unconditionally, but should be wrapped with
if(CMAKE_COMPONENT_INSTALL)
endif()
This appears to happen in latest cmake 3.23.1.
Edited by Brad King