From 6b255f077019cd892c22443f9cdea5332c1ed6ee Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Tue, 10 Oct 2023 11:00:29 +0100 Subject: [PATCH] Add uuid library if build option set #1319 --- CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b6874203..c018c8e02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ #******************************************************************************* -# Copyright (c) 2015, 2020 logi.cals GmbH and others +# Copyright (c) 2015, 2023 logi.cals GmbH and others # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 @@ -44,7 +44,7 @@ ENDIF() ## build options SET(PAHO_WITH_SSL FALSE CACHE BOOL "Flag that defines whether to build ssl-enabled binaries too. ") -SET(PAHO_WITH_LIBUUID TRUE CACHE BOOL "Flag that defines whether libuuid or a custom uuid implementation should be used") +SET(PAHO_WITH_LIBUUID FALSE CACHE BOOL "Flag that defines whether libuuid or a custom uuid implementation should be used") SET(PAHO_BUILD_SHARED TRUE CACHE BOOL "Build shared library") SET(PAHO_BUILD_STATIC FALSE CACHE BOOL "Build static library") SET(PAHO_BUILD_DOCUMENTATION FALSE CACHE BOOL "Create and install the HTML based API documentation (requires Doxygen)") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c064090c..0f795b9a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ #******************************************************************************* -# Copyright (c) 2015, 2020 logi.cals GmbH and others +# Copyright (c) 2015, 2023 logi.cals GmbH and others # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 @@ -68,6 +68,9 @@ ELSEIF (UNIX) IF(LIB_ANL) SET(LIBS_SYSTEM "${LIBS_SYSTEM}" anl) ENDIF() + IF(PAHO_WITH_LIBUUID) + SET(LIBS_SYSTEM "${LIBS_SYSTEM}" uuid) + ENDIF() ADD_DEFINITIONS(-D_GNU_SOURCE -fvisibility=hidden) ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Android") SET(LIBS_SYSTEM c dl)