
#rights reserved
cmake_minimum_required(VERSION 3.6)

include(${ROOT_DIR}/buildtools/cmake/gcc-gt675x-10.4.0-2023.06.27-x86_64_aarch64-htnice-linux-gnu.cmake)
#project name
set(PROJECT_NAME "leo-das")

message(INFO " SYSTEM_ARCH:${SYSTEM_ARCH}\n")
set(CMAKE_BUILD_TYPE RELEASE)

project(${PROJECT_NAME})

message("PRODUCT_NAME: ${PRODUCT_NAME}")
message(STATUS "PROJECT_SOURCE_DIR: ${PRODUCT_ROOT_DIR}, PROJECT_BINARY_DIR: ${PRODUCT_BUILD_DIR}")
add_definitions(-DDAS_VERSION=\"${PRODUCT_VERSION}\")
add_definitions(-DPRODUCT_${PRODUCT_NAME})
add_definitions(-DPRODUCT_NAME=\"${PRODUCT_NAME}\")
add_definitions(-DUSE_HTNICE)
add_definitions(-DHTNICE_K4)

set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs?" FORCE)

include_directories(${PRODUCT_ROOT_DIR})
include_directories(${PRODUCT_ROOT_DIR}/thirdparty)
include_directories(${PRODUCT_ROOT_DIR}/vendor/${PRODUCT_NAME})
include_directories(${PRODUCT_BUILD_DIR}/thirdparty)
include_directories(./ ${PRODUCT_ROOT_DIR}/foundation/)

find_package(libuv REQUIRED)
if (libuv_FOUND)
    include_directories(${LIBUV_INCLUDE_DIR})
    link_directories(${LIBUV_LIBS_DIR})
endif()

# OBJECT EXCLUDE_FROM_ALL
add_library(vendor STATIC ${PRODUCT_ROOT_DIR}/vendor/vendor_base.cpp)
target_include_directories(vendor PUBLIC ${PRODUCT_ROOT_DIR}/vendor)
target_link_directories(vendor PUBLIC ${LIBUV_LIBS_DIR})
target_link_libraries(vendor uv)

build_subdirectory(utils)

# build_subdirectory(foundation/gw_leo)
build_subdirectory(foundation/communications)
build_subdirectory(foundation/leoyun)
build_subdirectory(foundation/webconfig)
# build_subdirectory(foundation/protocol)
build_subdirectory(foundation/data-acq)
build_subdirectory(foundation/iot_acq)
build_subdirectory(foundation/downlink)