mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-02-23 02:05:30 -05:00
15 lines
606 B
CMake
15 lines
606 B
CMake
# An equivalent of install() which allows to declare multiple components using
|
|
# a custom 'COMPONENTS' clause. This clause must be the last on the
|
|
# argument list. The original 'COMPONENT' from install() clause must not appear
|
|
# on the argument list.
|
|
function(multicomp_install)
|
|
list(FIND ARGN "COMPONENTS" CLAUSE_INDEX)
|
|
list(SUBLIST ARGN 0 ${CLAUSE_INDEX} INSTALL_ARGN)
|
|
math(EXPR COMPS_INDEX "${CLAUSE_INDEX}+1")
|
|
list(SUBLIST ARGN ${COMPS_INDEX} ${ARGC} COMPONENTS)
|
|
foreach(COMP IN LISTS COMPONENTS)
|
|
install(${INSTALL_ARGN} COMPONENT ${COMP})
|
|
endforeach()
|
|
endfunction()
|
|
|