From d66702ba37ebb689d259bff80908003544b24812 Mon Sep 17 00:00:00 2001 From: Kai Buschulte Date: Wed, 29 Jun 2022 15:31:19 +0200 Subject: [PATCH] Fix CMake build for versions <3.19 CMake <3.19 does not support interface targets with sources. For better IDE integrations we still can add the config.h using the `target_sources` command. Signed-off-by: Kai Buschulte --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77ef82d1..4ab59cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,10 +104,8 @@ option(WITH_APPS "Build apps?" ON) option(WITH_PLUGINS "Build plugins?" ON) option(DOCUMENTATION "Build documentation?" ON) -add_library(config-header - INTERFACE - config.h -) +add_library(config-header INTERFACE) +target_sources(config-header INTERFACE config.h) target_include_directories(config-header INTERFACE ${mosquitto_SOURCE_DIR}