diff options
author | Andrea Pappacoda <[email protected]> | 2021-10-05 10:17:06 +0200 |
---|---|---|
committer | Andrea Pappacoda <[email protected]> | 2021-10-05 10:22:33 +0200 |
commit | 345de8a5414fec432a773d9c2f7644f8be410a1b (patch) | |
tree | ce75fb7a2691b6f5326fa67e86f3555069dd9cc2 /cmake | |
parent | e831805cc034d46740ec12b18d00cb015aafe7e2 (diff) | |
download | xbyak-345de8a5414fec432a773d9c2f7644f8be410a1b.tar.gz xbyak-345de8a5414fec432a773d9c2f7644f8be410a1b.zip |
build(meson): generate CMake package config files
The cmake/config.cmake.in file uses the 'install(EXPORT)` CMake feature,
that is not (yet?) supported by Meson (see
https://github.com/mesonbuild/meson/issues/7632#issuecomment-704932266).
To work around this issue I created a simple CMake config file that
defines a single IMPORTED target.
It is really basic, but since xbyak is a header-only library defining a
single target works without issues.
This is useful because with this feature when building the library using
Meson, CMake users will be able to still use `find_package(xbyak)`, and
are not forced to use the FindPkgConfig module
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/meson-config.cmake.in | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/meson-config.cmake.in b/cmake/meson-config.cmake.in new file mode 100644 index 0000000..9aeef78 --- /dev/null +++ b/cmake/meson-config.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +if(NOT TARGET @TARGET_NAME@) + add_library(@TARGET_NAME@ INTERFACE IMPORTED) + set_target_properties(@TARGET_NAME@ PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_FILE}/include" + ) +endif() |