aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/cmake/vcpkg_install_cmake.cmake
blob: df7d7bf6162f53dcd124e990a53e9263530ac4d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function(vcpkg_install_cmake)
    if(Z_VCPKG_CMAKE_INSTALL_GUARD)
        message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-cmake; using both vcpkg-cmake and vcpkg_install_cmake in the same port is unsupported.")
    endif()

    cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "" "")
    if(DEFINED arg_UNPARSED_ARGUMENTS)
        message(FATAL_ERROR "vcpkg_cmake_install was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
    endif()

    vcpkg_list(SET params)
    foreach(arg IN ITEMS DISABLE_PARALLEL ADD_BIN_TO_PATH)
        if(arg_${arg})
            vcpkg_list(APPEND params "${arg}")
        endif()
    endforeach()

    vcpkg_build_cmake(Z_VCPKG_DISABLE_DEPRECATION MESSAGE
        ${params}
        LOGFILE_ROOT install
        TARGET install
    )
endfunction()