diff --git a/cmake/FindOpen62541.cmake b/cmake/FindOpen62541.cmake index b4fcea410..91958e554 100644 --- a/cmake/FindOpen62541.cmake +++ b/cmake/FindOpen62541.cmake @@ -21,6 +21,7 @@ # ``open62541`` # The open62541 library +if(0) find_path(Open62541_INCLUDE_DIRS NAMES open62541.h HINTS "${OPEN62541_INCDIR}") @@ -46,6 +47,14 @@ if (Open62541_FOUND) endif() mark_as_advanced(Open62541_INCLUDE_DIRS Open62541_LIBRARIES) +elseif() + find_package(open62541 CONFIG REQUIRED) + if(NOT TARGET open62541) + add_library(open62541 INTERFACE IMPORTED) + set_property(TARGET open62541 APPEND PROPERTY + INTERFACE_LINK_LIBRARIES open62541::open62541) + endif() +endif() include(FeatureSummary) set_package_properties(Open62541 PROPERTIES diff --git a/src/opcua/CMakeLists.txt b/src/opcua/CMakeLists.txt index d5e3c65df..0d2fa3952 100644 --- a/src/opcua/CMakeLists.txt +++ b/src/opcua/CMakeLists.txt @@ -84,7 +84,7 @@ qt_internal_add_module(OpcUa ## Scopes: ##################################################################### -qt_internal_extend_target(OpcUa CONDITION QT_FEATURE_gds AND QT_FEATURE_ssl AND NOT APPLE AND NOT WINRT +qt_internal_extend_target(OpcUa CONDITION QT_FEATURE_gds AND QT_FEATURE_openssl AND NOT APPLE AND NOT WINRT SOURCES client/qopcuagdsclient.cpp client/qopcuagdsclient_p.h x509/openssl_symbols.cpp @@ -102,7 +102,7 @@ qt_internal_extend_target(OpcUa CONDITION QT_FEATURE_gds AND QT_FEATURE_ssl AND x509/qopcuax509utils.cpp x509/qopcuax509utils_p.h ) -if (QT_FEATURE_gds AND QT_FEATURE_ssl) +if (QT_FEATURE_gds AND QT_FEATURE_openssl) qt_internal_extend_target(OpcUa LIBRARIES WrapOpenSSL::WrapOpenSSL) endif()