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