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
Is your feature request related to a problem? Please describe.
Most RAPIDS projects bring in thirdparty projects via rapids_cpm and either have them as part of the default ALL install set, or mark them EXCLUDE_FROM_ALL and therefore become uninstallable unless they have existing install(COMPONENT rules setup.
rapids-cmake can resolve these issues by marking each sub-project with default component names ( based on the project name ), and controls to overridable this default name when needed ( e.g. when we want all testing libraries to go into the testing component ).
Which would have roughly the following implementation:
function(rapids_cmake_default_install_component )
set(options DEFAULT_USE_PROJECT_NAME)
set(one_value PROJECT INSTALL_COMPONENT_NAME)
set(multi_value )
cmake_parse_arguments(_RAPIDS "${options}""${one_value}""${multi_value}"${ARGN})
# Need to make sure we only install our project hook once get_property(already_hooked GLOBAL PROPERTY rapids_cmake_default_install_component_hook)
if(NOT already_hooked)
list(APPEND CMAKE_PROJECT_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/default_install_component_hook.cmake")
set(CMAKE_PROJECT_INCLUDE "${CMAKE_PROJECT_INCLUDE}" PARENT_SCOPE)
set_property(GLOBAL PROPERTY rapids_cmake_default_install_component_hook ON)
endif()
if(_RAPIDS_DEFAULT_USE_PROJECT_NAME)
set_property(GLOBAL PROPERTY rapids_cmake_default_install_component_names ON)
endif()
if(_RAPIDS_PROJECT AND _RAPIDS_INSTALL_COMPONENT)
# Should only be set if the property doesn't already exist string(TOLOWER ${_RAPIDS_PROJECT} project)
set_property(GLOBAL PROPERTY rapids_cmake_install_component_${project}${_RAPIDS_INSTALL_COMPONENT})
endif()
endfunction()
default_install_component_hook.cmake
string(TOLOWER ${PROJECT_NAME} project)
get_property(_rapids_install_default_name GLOBAL PROPERTY rapids_cmake_default_install_component_names)
get_property(_rapids_install_project_name GLOBAL PROPERTY rapids_cmake_install_component_${project})
if(_rapids_install_project_name)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"${_rapids_install_project_name}")
elseif(_rapids_install_default_name)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"${project}")
endif()
This would allow rapids-cmake users to have all projects have a component name that matches the project name, and the ability to override this when we need to move projects into collective groups like testing.
The text was updated successfully, but these errors were encountered:
bdice
changed the title
[FEA] Provide ability to setup default install name componens per sub-project
[FEA] Provide ability to setup default install name components per sub-project
Apr 12, 2024
Is your feature request related to a problem? Please describe.
Most RAPIDS projects bring in thirdparty projects via
rapids_cpm
and either have them as part of the defaultALL
install set, or mark themEXCLUDE_FROM_ALL
and therefore become uninstallable unless they have existinginstall(COMPONENT
rules setup.rapids-cmake can resolve these issues by marking each sub-project with default component names ( based on the project name ), and controls to overridable this default name when needed ( e.g. when we want all testing libraries to go into the
testing
component ).Describe the solution you'd like
The solution is rather ingenious and proposed by Craig Scott.
What we have is a user function with the following call signature:
Which would have roughly the following implementation:
default_install_component_hook.cmake
This would allow rapids-cmake users to have all projects have a component name that matches the project name, and the ability to override this when we need to move projects into collective groups like
testing
.The text was updated successfully, but these errors were encountered: