From 1f95e8ac9cf07059abcd926e4005b1606f837a05 Mon Sep 17 00:00:00 2001 From: Steve Gerbino Date: Mon, 23 Feb 2026 23:51:25 +0100 Subject: [PATCH] Fix INSTALL_INTERFACE for Boost versioned-layout installs on Windows boost_install's __boost_install_update_include_directory expects either a raw path or $ to replace with the correct $. When INSTALL_INTERFACE was already set, the pattern match failed and the versioned include path (include/boost-X_Y) was never applied. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ce984e3..a1cf7b2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ # Copyright (c) 2021 Dmitry Arkhipov (grisumbras@gmail.com) # Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com) # Copyright (c) 2025 Mohammad Nejati +# Copyright (c) 2026 Steve Gerbino # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -43,8 +44,7 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_CAP function(boost_capy_setup_properties target) target_compile_features(${target} PUBLIC cxx_std_20) target_include_directories(${target} PUBLIC - $ - $) + $) target_include_directories(${target} PRIVATE $) target_compile_definitions(${target} PUBLIC BOOST_CAPY_NO_LIB) @@ -87,6 +87,11 @@ else() include(GNUInstallDirs) include(CMakePackageConfigHelpers) + # Set INSTALL_INTERFACE for standalone installs (boost_install handles + # this for superproject builds, including versioned-layout paths) + target_include_directories(boost_capy PUBLIC + $) + set(BOOST_CAPY_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/boost_capy)