# Copyright (C) 2024 Advanced Micro Devices, Inc.  All rights reserved.
# Copyright (c) 2021 Xilinx, Inc.  All rights reserved.
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.15)
project(hdcp1x)

find_package(common)
collector_create (PROJECT_LIB_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}")
collector_create (PROJECT_LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(${CMAKE_BINARY_DIR}/include)
collect (PROJECT_LIB_SOURCES sha1.c)
collect (PROJECT_LIB_HEADERS sha1.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_cipher_intr.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_cipher.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_debug.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_g.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_hw.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_intr.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_platform.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_platform.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_port_dp_rx.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_port_dp_tx.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_port_dp.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_port_hdmi_rx.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_port_hdmi_tx.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_port_hdmi.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_port_intr.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_port.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_port.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_rx.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_rx.h)
collect (PROJECT_LIB_SOURCES xhdcp1x_selftest.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_sinit.c)
collect (PROJECT_LIB_SOURCES xhdcp1x_tx.c)
collect (PROJECT_LIB_HEADERS xhdcp1x_tx.h)
collect (PROJECT_LIB_SOURCES xhdcp1x.c)
collect (PROJECT_LIB_HEADERS xhdcp1x.h)
collector_list (_sources PROJECT_LIB_SOURCES)
collector_list (_headers PROJECT_LIB_HEADERS)
file(COPY ${_headers} DESTINATION ${CMAKE_BINARY_DIR}/include)
add_library(hdcp1x STATIC ${_sources})
set_target_properties(hdcp1x PROPERTIES LINKER_LANGUAGE C)
