Skip to content

Commit

Permalink
build(meson): don't hardcode include in CMake Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tachi107 committed Feb 2, 2022
1 parent 228dc33 commit b7a7ab6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/tomlplusplus.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b7a7ab6

Please sign in to comment.