cmake_minimum_required(VERSION 3.10)
project(qt_pehredaar)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt5 COMPONENTS Core Gui Widgets Network WebSockets WebEngineWidgets REQUIRED)

add_executable(qt_pehredaar
    main.cpp
    mainwindow.cpp
    mainwindow.h
    udpdiscoveryservice.cpp
    udpdiscoveryservice.h
    opcuaserver.cpp
    opcuaserver.h
    open62541.c
    open62541.h
    codeeditor.cpp
    codeeditor.h
    highlighter.cpp
    highlighter.h
    qconsole.cpp
    qconsole.h
    qcled.cpp
    qcled.h
)

target_link_libraries(qt_pehredaar
    Qt5::Core
    Qt5::Gui
    Qt5::Widgets
    Qt5::Network
    Qt5::WebSockets
    Qt5::WebEngineWidgets
)

if(WIN32)
    target_link_libraries(qt_pehredaar ws2_32 iphlpapi user32)
else()
    target_link_libraries(qt_pehredaar pthread)
endif()
