open62541 / open62541

Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0
http://open62541.org
Mozilla Public License 2.0
2.51k stars 1.22k forks source link

Error in CMakeLists.txt file - ua_pubsub_mqtt.c and other files are excluded from build on Windows platform #5811

Open Alexk12 opened 1 year ago

Alexk12 commented 1 year ago

Error in CMakeLists.txt file - ua_pubsub_mqtt.c and other files are excluded from build on Windows platform

CMAKE options: cmake .. -G "Visual Studio 16 2019" -A x64 -DUA_ENABLE_ENCRYPTION:STRING="OPENSSL" -DUA_ENABLE_MQTT=ON -DUA_ENABLE_PUBSUB=ON -DUA_ENABLE_PUBSUB_MQTT=ON

From open62541\CMakeLists.txt

Was (with error in if/else logic): ...... if(UA_ENABLE_PUBSUB_MQTT) if(WIN32) MESSAGE(WARNING "Multithreading is enabled in MQTT plugin. This feature is under development and marked as EXPERIMENTAL") else() list(APPEND default_plugin_headers ${PROJECT_SOURCE_DIR}/deps/mqtt-c/include/mqtt_pal.h ${PROJECT_SOURCE_DIR}/deps/mqtt-c/include/mqtt.h ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/pubsub_mqtt.h ${PROJECT_SOURCE_DIR}/plugins/mqtt/ua_mqtt-c_adapter.h) list(APPEND default_plugin_sources ${PROJECT_SOURCE_DIR}/deps/mqtt-c/src/mqtt_pal.c ${PROJECT_SOURCE_DIR}/deps/mqtt-c/src/mqtt.c ${PROJECT_SOURCE_DIR}/plugins/ua_pubsub_mqtt.c ${PROJECT_SOURCE_DIR}/plugins/mqtt/ua_mqtt-c_adapter.c) endif() endif() ......

Correct: ...... if(UA_ENABLE_PUBSUB_MQTT) if(WIN32) MESSAGE(WARNING "Multithreading is enabled in MQTT plugin. This feature is under development and marked as EXPERIMENTAL") endif() list(APPEND default_plugin_headers ${PROJECT_SOURCE_DIR}/deps/mqtt-c/include/mqtt_pal.h ${PROJECT_SOURCE_DIR}/deps/mqtt-c/include/mqtt.h ${PROJECT_SOURCE_DIR}/plugins/include/open62541/plugin/pubsub_mqtt.h ${PROJECT_SOURCE_DIR}/plugins/mqtt/ua_mqtt-c_adapter.h) list(APPEND default_plugin_sources ${PROJECT_SOURCE_DIR}/deps/mqtt-c/src/mqtt_pal.c ${PROJECT_SOURCE_DIR}/deps/mqtt-c/src/mqtt.c ${PROJECT_SOURCE_DIR}/plugins/ua_pubsub_mqtt.c ${PROJECT_SOURCE_DIR}/plugins/mqtt/ua_mqtt-c_adapter.c) endif() ......

Description

Error in CMakeLists.txt file - ua_pubsub_mqtt.c and other files are excluded from build on Windows platform

Background Information / Reproduction Steps

Used CMake options:

cmake .. -G "Visual Studio 16 2019" -A x64 -DUA_ENABLE_ENCRYPTION:STRING="OPENSSL" -DUA_ENABLE_MQTT=ON -DUA_ENABLE_PUBSUB=ON -DUA_ENABLE_PUBSUB_MQTT=ON

Checklist

Please provide the following information:

jpfr commented 1 year ago

Try the 1.4 branch for the next release. That code was completely refactored.

Alexk12 commented 1 year ago

Try the 1.4 branch for the next release. That code was completely refactored.

Thank you, I'll try new release.