From b7a7ab6008f7e015665c6f8f4e16c9eb16041dd7 Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Wed, 2 Feb 2022 09:33:17 +0100 Subject: [PATCH] build(meson): don't hardcode include in CMake Config --- cmake/tomlplusplus.cmake.in | 2 +- meson.build | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/tomlplusplus.cmake.in b/cmake/tomlplusplus.cmake.in index 4a836da3..ef36b9f9 100644 --- a/cmake/tomlplusplus.cmake.in +++ b/cmake/tomlplusplus.cmake.in @@ -6,7 +6,7 @@ if(NOT TARGET tomlplusplus::tomlplusplus) # Import tomlplusplus interface library add_library(tomlplusplus::tomlplusplus INTERFACE IMPORTED) set_target_properties(tomlplusplus::tomlplusplus PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include") + INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/@includedir@") # Require C++17 target_compile_features(tomlplusplus::tomlplusplus INTERFACE cxx_std_17) diff --git a/meson.build b/meson.build index 6758a046..bf0bb032 100644 --- a/meson.build +++ b/meson.build @@ -544,10 +544,12 @@ if get_option('generate_cmake_config') and not is_subproject install_dir: get_option('datadir')/'cmake'/meson.project_name() ) + cmake_conf = configuration_data({'includedir': get_option('includedir')}) + cmake.configure_package_config_file( name: meson.project_name(), input: 'cmake'/'tomlplusplus.cmake.in', - configuration: configuration_data(), # empty conf, not needed + configuration: cmake_conf, install_dir: get_option('datadir')/'cmake'/meson.project_name(), ) endif