# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.

cmake_minimum_required(VERSION 3.15 FATAL_ERROR)

project(
  uddf-cdd
  VERSION 0.9
  DESCRIPTION "Unified Device Driver Framework production drivers"
  LANGUAGES CXX)

# Enable Position Independent Code for all targets
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# --- Modules ---
include(FetchContent)

FetchContent_Declare(
  hsl
  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../hsl
)
FetchContent_MakeAvailable(hsl)

FetchContent_Declare(
  uddf
  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../uddf
)
FetchContent_MakeAvailable(uddf)

# --- Common Include Paths (mirrors Makefile.env.tmk) ---
set(UDDF_CDD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(UDDF_CDD_DRIVER ${UDDF_CDD_ROOT}/drivers)
set(UDDF_CDD_COSERDES ${UDDF_CDD_ROOT}/coSerDes)
set(UDDF_CDD_COMMON ${UDDF_CDD_ROOT}/common)
set(UDDF_CDD_COMMON_UTILS ${UDDF_CDD_ROOT}/common/utils)

# --- Subdirectories ---
add_subdirectory(coSerDes/modules/AR0234HAWK)
add_subdirectory(coSerDes/modules/R0SIM728)
add_subdirectory(coSerDes/modules/R0SIM623)
add_subdirectory(samples)
add_subdirectory(drivers)
add_subdirectory(libraries)


# --- Output Summary ---
message(STATUS "--- Project Configuration Summary ---")
message(STATUS "Project Name:      ${PROJECT_NAME}")
message(STATUS "Project Version:   ${PROJECT_VERSION}")
message(STATUS "-------------------------------------")
