summaryrefslogtreecommitdiff
path: root/Meta/CMake/pnp_ids.cmake
blob: 7192d20c4690e186354cceea7df464e767de0d65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
include(${CMAKE_CURRENT_LIST_DIR}/utils.cmake)

set(PNP_IDS_URL http://www.uefi.org/uefi-pnp-export)
set(PNP_IDS_EXPORT_PATH ${CMAKE_BINARY_DIR}/pnp_ids.html)

if (ENABLE_PNP_IDS_DOWNLOAD)
    download_file("${PNP_IDS_URL}" "${PNP_IDS_EXPORT_PATH}")

    set(PNP_IDS_HEADER PnpIDs.h)
    set(PNP_IDS_IMPLEMENTATION PnpIDs.cpp)
    set(PNP_IDS_TARGET_PREFIX "")

    invoke_generator(
        "PnpIDsData"
        Lagom::GeneratePnpIDsData
        "${PNP_IDS_EXPORT_PATH}"
        "${PNP_IDS_TARGET_PREFIX}"
        "${PNP_IDS_HEADER}"
        "${PNP_IDS_IMPLEMENTATION}"
        arguments -p "${PNP_IDS_EXPORT_PATH}"
    )

    set(PNP_IDS_SOURCES
        ${PNP_IDS_HEADER}
        ${PNP_IDS_IMPLEMENTATION}
    )
endif()