From 9f54a0b79b4be6333fd1f37d9510f60183daba26 Mon Sep 17 00:00:00 2001 From: Anohkka <61073541+Anohkka@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:12:29 -0300 Subject: [PATCH] Prevent FetchContent_MakeAvailable from duplicating the mongoose target --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 152bf9318..27403fbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.18) project(cpr VERSION 1.14.1 LANGUAGES CXX) math(EXPR cpr_VERSION_NUM "${cpr_VERSION_MAJOR} * 0x10000 + ${cpr_VERSION_MINOR} * 0x100 + ${cpr_VERSION_PATCH}" OUTPUT_FORMAT HEXADECIMAL) @@ -384,8 +384,8 @@ if(CPR_BUILD_TESTS) FetchContent_Declare(mongoose URL https://github.com/cesanta/mongoose/archive/7.7.tar.gz URL_HASH SHA256=4e5733dae31c3a81156af63ca9aa3a6b9b736547f21f23c3ab2f8e3f1ecc16c0 # the hash for 7.7.tar.gz - USES_TERMINAL_DOWNLOAD TRUE) # <---- This is needed only for Ninja to show download progress - # We can not use FetchContent_MakeAvailable, since we need to patch mongoose to use CMake + USES_TERMINAL_DOWNLOAD TRUE # This is needed only for Ninja to show download progress + SOURCE_SUBDIR "?") # Nonexistent directory to prevent FetchContent_MakeAvailable from calling add_subdirectory and duplicating the mongoose target if (NOT mongoose_POPULATED) FetchContent_MakeAvailable(mongoose)