~aleteoryx/muditaos

ref: 1a26cdb407c14dd46d4232e61095999b7bd032e7 muditaos/config/Utils.cmake -rw-r--r-- 605 bytes
1a26cdb4 — Borys Jelenski [EGD-4527] Add creating update package as CMake target 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
# 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()