From b2edcd67d0a6c84892fa6187e09d5e10302d2e1c Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 7 Sep 2025 08:03:52 +1000 Subject: [PATCH 1/3] CMake 3.15 is required, 3.14 does not work --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c01ebcb9e..0a665fc5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ # Official repository: https://github.com/boostorg/json # -cmake_minimum_required(VERSION 3.8...3.16) +cmake_minimum_required(VERSION 3.15...3.16) set(BOOST_JSON_VERSION 2) if(BOOST_SUPERPROJECT_VERSION) From fc2009f4d60e7533c0040995d094b44003d57ef1 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Wed, 10 Sep 2025 11:21:37 +1000 Subject: [PATCH 2/3] CMake 3.14 is required (due to parser), 3.13 does not work --- CMakeLists.txt | 2 +- test/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a665fc5e..14d3a9564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ # Official repository: https://github.com/boostorg/json # -cmake_minimum_required(VERSION 3.15...3.16) +cmake_minimum_required(VERSION 3.14...3.16) set(BOOST_JSON_VERSION 2) if(BOOST_SUPERPROJECT_VERSION) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 68becd75a..58c50cdbe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -61,7 +61,9 @@ target_compile_definitions(boost_json-no_exceptions PRIVATE BOOST_JSON_NO_LIB=1 ) target_compile_options(boost_json-no_exceptions PRIVATE - $<$:-fno-exceptions> + $<$:-fno-exceptions> + $<$:-fno-exceptions> + $<$:-fno-exceptions> $<$:/wd4530> $<$:/wd4577> ) From fa1223af8540e99c96a30aa7f9421d27b6613c7b Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Thu, 11 Sep 2025 22:21:05 +1000 Subject: [PATCH 3/3] CMake 3.12 required for Python3 BoostPrettyPrinters, CMake 3.8 now works --- CMakeLists.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14d3a9564..0d7ec42ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ # Official repository: https://github.com/boostorg/json # -cmake_minimum_required(VERSION 3.14...3.16) +cmake_minimum_required(VERSION 3.8...3.16) set(BOOST_JSON_VERSION 2) if(BOOST_SUPERPROJECT_VERSION) @@ -54,16 +54,19 @@ if(BOOST_JSON_IS_ROOT) unset(CMAKE_FOLDER) endif() -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pretty_printers") -find_package(BoostPrettyPrinters QUIET) -if(BoostPrettyPrinters_FOUND) - boost_pretty_printers_gdb_python_header( - TARGET boost_json_regenerate_printers - INPUT src/boost_json_gdb_printers.py - OUTPUT include/boost/json/detail/gdb_printers.hpp - HEADER_GUARD BOOST_JSON_DETAIL_GDB_PRINTERS_HPP - NO_DISABLE_MACRO - EXCLUDE_FROM_ALL) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pretty_printers") + # Note: find_package(Python3) supported in cmake-3.12 onwards + find_package(BoostPrettyPrinters QUIET) + if(BoostPrettyPrinters_FOUND) + boost_pretty_printers_gdb_python_header( + TARGET boost_json_regenerate_printers + INPUT src/boost_json_gdb_printers.py + OUTPUT include/boost/json/detail/gdb_printers.hpp + HEADER_GUARD BOOST_JSON_DETAIL_GDB_PRINTERS_HPP + NO_DISABLE_MACRO + EXCLUDE_FROM_ALL) + endif() endif() function(boost_json_setup_properties target)