#******************************************************************************
# Copyright 2016-2019 by SW Group, Chengdu Haiguang IC Design Co., Ltd.
# All right reserved. See COPYRIGHT for detailed Information.
#
# @file       CMakeLists.txt
# @brief      hdms project cmake lists file.
#
# @author     Wangyan<wangwy@hygon.cn>
# @date       2022/10/18
# @history    1.
#******************************************************************************

project(hdms LANGUAGES CXX VERSION 1.1.0)

set(TARGET_NAME ${PROJECT_NAME})

# The version number.
set(MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
set(MINOR_VERSION ${PROJECT_VERSION_MINOR})
set(PATCH_VERSION ${PROJECT_VERSION_PATCH})

# configure a header file to pass some of the CMake settings to the source code
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
                ${CMAKE_CURRENT_BINARY_DIR}/version.h)

# add include directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/utils)
include_directories(${CMAKE_SOURCE_DIR}/virtual)
include_directories(${CMAKE_SOURCE_DIR}/include)

# add source files and build
file(GLOB SRC_LIST "*.cpp" "${CMAKE_SOURCE_DIR}/utils/*.cpp")
add_executable(${TARGET_NAME} ${SRC_LIST})

# add link libraries
target_link_libraries(${TARGET_NAME} PUBLIC hydmi)

# add install directories
install(TARGETS ${TARGET_NAME} RUNTIME
        DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
