From f0deb9a5a104a9e04ac714007bfb76c09ed6e6aa Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 27 Mar 2020 21:57:06 +0000 Subject: [PATCH] CMake: Make building clients, broker and C++ library optional. Issue #1641. --- CMakeLists.txt | 10 +++++++++- lib/CMakeLists.txt | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49a7e8a9..749e2d28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,9 +100,17 @@ endif (WITH_DLT) # Include projects # ======================================== +option(WITH_CLIENTS "Build clients?" ON) +option(WITH_BROKER "Build broker?" ON) + add_subdirectory(lib) -add_subdirectory(client) +if (WITH_CLIENTS) + add_subdirectory(client) +endif (WITH_CLIENTS) +if (WITH_BROKER) add_subdirectory(src) +endif (WITH_BROKER) + if (DOCUMENTATION) add_subdirectory(man) endif (DOCUMENTATION) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f81dce7c..e0ce56b3 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,7 @@ -add_subdirectory(cpp) +option(WITH_LIB_CPP "Build C++ library?" ON) +if (WITH_LIB_CPP) + add_subdirectory(cpp) +endif (WITH_LIB_CPP) include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib ${STDBOOL_H_PATH} ${STDINT_H_PATH}