From 30b209a14c4de265294f3a758034876a76f020de Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 15 Sep 2026 17:52:28 +0500 Subject: [PATCH] cmake: remove wide boost include Replacing it with appending `Boost::headers` to `Boost_LIBRARIES` - this target is constructed both for Boost config and FindBoost and just references `Boost_INCLUDE_DIRS`, so it will automatically propagate to all `Boost_LIBRARIES` consumers. This is only needed for FindBoost users though. --- cmake/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6f99406a94..85910e6e75 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -389,7 +389,12 @@ if(USE_MMAP) endif() find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +# This is only needed for FindBoost, when libraries are just paths to the library files on the disk. +# If Boost is found using cmake config, then all its Boost_LIBRARIES are targets +# and automatically depend on the headers. +list(APPEND Boost_LIBRARIES Boost::headers) message(STATUS "Boost include files found in ${Boost_INCLUDE_DIRS}") +message(STATUS "Boost libraries found in ${Boost_LIBRARIES}") if(COLLADA_SUPPORT) find_package(OpenCOLLADA REQUIRED) @@ -490,8 +495,6 @@ else() endif() endif(MSVC) -include_directories(${Boost_INCLUDE_DIRS}) - if(NOT SCHEMA_VERSIONS) if(WASM_BUILD) # super arbitrarily try to keep size down at least a little bit