# SPDX-FileCopyrightText: 2022 Copyright contributors to the cppTango project
#
# SPDX-License-Identifier: LGPL-3.0-or-later

add_subdirectory(utils)
add_subdirectory(telemetry)
add_subdirectory(log4tango)

set(versions_h ${CMAKE_CURRENT_BINARY_DIR}/versions.h)
configure_file(versions.h.in ${versions_h})

include(CheckIncludeFile)

CHECK_INCLUDE_FILE_CXX("io.h" TANGO_HAVE_IO_H)
CHECK_INCLUDE_FILE_CXX("unistd.h" TANGO_HAVE_UNISTD_H)

set(defines_h ${CMAKE_CURRENT_BINARY_DIR}/defines.h)
configure_file(defines.h.in ${defines_h})

set(COMMON_HEADERS
    ${versions_h}
    ${defines_h}
    tango_base_class.h
    tango_const.h
    tango_type_traits.h
    idl_wrapper.h
    PointerWithLock.h
    omnithread_wrapper.h
    zmq_event_marshalling.h
)

install(FILES ${COMMON_HEADERS} DESTINATION
    "${CMAKE_INSTALL_INCLUDEDIR}/tango/common")

set(TANGO_COMMON_HEADERS "${COMMON_HEADERS}" PARENT_SCOPE)
set(TANGO_TELEMETRY_HEADERS "${TELEMETRY_HEADERS}" PARENT_SCOPE)
