project(QtOpcUa)

set(QtOpcUa_SRC
${QtOpcUa_GEN_DIR}/qopcua_nodeids_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcua_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaaddnodeitem_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaaddreferenceitem_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaapplicationdescription_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaapplicationidentity_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaargument_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaattributeoperand_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaauthenticationinformation_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaaxisinformation_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuabinarydataencoding_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuabrowsepathtarget_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuabrowserequest_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaclient_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuacomplexnumber_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuacontentfilterelement_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuacontentfilterelementresult_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuadeletereferenceitem_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuadoublecomplexnumber_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaelementoperand_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaendpointdescription_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaerrorstate_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaeuinformation_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaeventfilterresult_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaexpandednodeid_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaextensionobject_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcualiteraloperand_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcualocalizedtext_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuamonitoringparameters_datachangefilter_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuamonitoringparameters_eventfilter_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuamonitoringparameters_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuamultidimensionalarray_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuanode_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuanodecreationattributes_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuapkiconfiguration_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaprovider_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaqualifiedname_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuarange_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuareaditem_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuareadresult_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuareferencedescription_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuarelativepathelement_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuasimpleattributeoperand_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuausertokenpolicy_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuawriteitem_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuawriteresult_wrapper.cpp
${QtOpcUa_GEN_DIR}/qopcuaxvalue_wrapper.cpp
# module is always needed
${QtOpcUa_GEN_DIR}/qtopcua_module_wrapper.cpp
)

if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 6.3.0 OR
        Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 6.3.0)
    list(APPEND QtOpcUa_SRC
        ${QtOpcUa_GEN_DIR}/qopcuadatavalue_wrapper.cpp
        ${QtOpcUa_GEN_DIR}/qopcuahistorydata_wrapper.cpp
        ${QtOpcUa_GEN_DIR}/qopcuahistoryreadrawrequest_wrapper.cpp
        ${QtOpcUa_GEN_DIR}/qopcuahistoryreadresponse_wrapper.cpp)
endif()

set(QtOpcUa_include_dirs ${QtOpcUa_SOURCE_DIR}
                        ${QtOpcUa_BINARY_DIR}
                        ${Qt${QT_MAJOR_VERSION}OpcUa_INCLUDE_DIRS}
                        ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
                        ${QtCore_GEN_DIR}
                        ${QtNetwork_GEN_DIR}
                        ${libpyside_SOURCE_DIR})

set(QtOpcUa_libraries pyside6
                        ${Qt${QT_MAJOR_VERSION}OpcUa_LIBRARIES}
                        ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
                        ${Qt${QT_MAJOR_VERSION}Network_LIBRARIES})

set(QtOpcUa_deps QtCore QtNetwork)

create_pyside_module(NAME QtOpcUa
                     INCLUDE_DIRS QtOpcUa_include_dirs
                     LIBRARIES QtOpcUa_libraries
                     DEPS QtOpcUa_deps
                     TYPESYSTEM_PATH QtOpcUa_SOURCE_DIR
                     SOURCES QtOpcUa_SRC)
