project(QsACNNode VERSION 0.1 LANGUAGES CXX)

cmake_minimum_required(VERSION 3.20)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
endif()

find_package(QT NAMES Qt6 Qt5 COMPONENTS Network Gui REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Network Gui REQUIRED)

add_library(${PROJECT_NAME} SHARED)

target_sources(${PROJECT_NAME}
    PUBLIC
        qsacnnode.h
        qsacnuniverse.h
        universemodel.h
    PRIVATE
        qsacnnode_global.h
        qsacnnode.cpp
        universemodel.cpp
    )

target_link_libraries(${PROJECT_NAME} PUBLIC
    Qt${QT_VERSION_MAJOR}::Network
    Qt${QT_VERSION_MAJOR}::Gui
    OpenLCP)

target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_LIBRARY)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
