From 9d98d29698d5533018c0768f305f465c35e63274 Mon Sep 17 00:00:00 2001 From: wanghaemq Date: Mon, 6 May 2024 03:36:58 -0400 Subject: [PATCH] * FIX [demo/quic] Fix the error in building quic demo. Signed-off-by: wanghaemq --- demo/quic_mqtt/CMakeLists.txt | 7 +++++-- demo/quic_mqttv5/CMakeLists.txt | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/demo/quic_mqtt/CMakeLists.txt b/demo/quic_mqtt/CMakeLists.txt index ef66f2e5..0d4be69e 100644 --- a/demo/quic_mqtt/CMakeLists.txt +++ b/demo/quic_mqtt/CMakeLists.txt @@ -11,8 +11,11 @@ cmake_minimum_required(VERSION 3.13) project(quic_client) +if (BUILD_DEMO) +else () # Call this from your own project's makefile. -find_package(nng CONFIG REQUIRED) + find_package(nng CONFIG REQUIRED) +endif (BUILD_DEMO) find_package(Threads) find_package(msquic) @@ -35,7 +38,7 @@ if(OPENSSL_FOUND) target_link_libraries(quic_client OpenSSL::Crypto OpenSSL::SSL) endif() -target_link_libraries(quic_client nng::nng msquic pthread) +target_link_libraries(quic_client nng msquic pthread) target_compile_definitions(quic_client PRIVATE NNG_ELIDE_DEPRECATED) if (NNG_ENABLE_SQLITE) diff --git a/demo/quic_mqttv5/CMakeLists.txt b/demo/quic_mqttv5/CMakeLists.txt index 011b961f..9afe456b 100644 --- a/demo/quic_mqttv5/CMakeLists.txt +++ b/demo/quic_mqttv5/CMakeLists.txt @@ -11,8 +11,11 @@ cmake_minimum_required(VERSION 3.13) project(quic_clientv5) +if (BUILD_DEMO) +else () # Call this from your own project's makefile. -find_package(nng CONFIG REQUIRED) + find_package(nng CONFIG REQUIRED) +endif (BUILD_DEMO) find_package(Threads) find_package(msquic) @@ -35,7 +38,7 @@ if(OPENSSL_FOUND) target_link_libraries(quic_client_v5 OpenSSL::Crypto OpenSSL::SSL) endif() -target_link_libraries(quic_client_v5 nng::nng msquic pthread) +target_link_libraries(quic_client_v5 nng msquic pthread) target_compile_definitions(quic_client_v5 PRIVATE NNG_ELIDE_DEPRECATED) if (NNG_ENABLE_SQLITE)