commit 54ea2768cc6d4f7a59429e40ad1c87f654cd0978 parent 2667b2cd63d4783f8e9a1012d7b2c236659e7e13 Author: Robbert van der Helm <mail@robbertvanderhelm.nl> Date: Thu, 3 Nov 2022 15:49:39 +0100 Also generate a clap.pc pkg-config file This allows build systems to detect the presence of system-wide installed CLAP libraries in a simple portable way. Diffstat:
M | CMakeLists.txt | | | 6 | ++++++ |
A | clap.pc.in | | | 8 | ++++++++ |
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -28,6 +28,12 @@ write_basic_package_version_file( COMPATIBILITY AnyNewerVersion) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/clap-config-version.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/clap") +# In addition to the above generated `clap-config.cmake` file, we'll also +# provide a pkg-config file to make it easier to consume this library in a +# portable way +configure_file(clap.pc.in "${CMAKE_CURRENT_BINARY_DIR}/clap.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/clap.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + # clap-tests should always be available, to avoid build failing here and there # because the target doesn't exists add_custom_target(clap-tests) diff --git a/clap.pc.in b/clap.pc.in @@ -0,0 +1,8 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: clap +Description: The interface headers for the CLAP audio plugin API +Version: @CMAKE_PROJECT_VERSION@ + +Cflags: -I${includedir}