From ba21da84fa607a5df943b1e9e008b615d9ebf138 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Wed, 25 Dec 2024 17:24:01 +0900 Subject: [PATCH] Generate and install pkg-config file for slint_cpp --- api/cpp/CMakeLists.txt | 18 ++++++++++++++++++ api/cpp/cmake/slint.pc.in | 16 ++++++++++++++++ xtask/src/license_headers_check.rs | 1 + 3 files changed, 35 insertions(+) create mode 100644 api/cpp/cmake/slint.pc.in diff --git a/api/cpp/CMakeLists.txt b/api/cpp/CMakeLists.txt index 24cc1c991a6..4252587120a 100644 --- a/api/cpp/CMakeLists.txt +++ b/api/cpp/CMakeLists.txt @@ -452,6 +452,24 @@ if(SLINT_BUILD_RUNTIME) endif(SLINT_BUILD_RUNTIME) +if (SLINT_BUILD_RUNTIME) + function(_slint_write_pc_file) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/slint.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/slint.pc + @ONLY + ) + + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/slint.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) + endfunction() + + cmake_language(DEFER CALL _slint_write_pc_file) + +endif(SLINT_BUILD_RUNTIME) + set(CPACK_PACKAGE_NAME "Slint-cpp") set(CPACK_PACKAGE_VENDOR "Slint") set(CPACK_VERBATIM_VARIABLES true) diff --git a/api/cpp/cmake/slint.pc.in b/api/cpp/cmake/slint.pc.in new file mode 100644 index 00000000000..d596320e120 --- /dev/null +++ b/api/cpp/cmake/slint.pc.in @@ -0,0 +1,16 @@ +# Copyright © SixtyFPS GmbH +# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 + +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=@CMAKE_INSTALL_LIBDIR@ +includedir=@CMAKE_INSTALL_INCLUDEDIR@/slint + +Name: Slint +Description: Slint C++ Runtime +Version: @PROJECT_VERSION@ + +Cflags: -I${includedir} + +Libs: -L${libdir} -lslint_cpp + diff --git a/xtask/src/license_headers_check.rs b/xtask/src/license_headers_check.rs index 3e76e6cdfce..0717064b242 100644 --- a/xtask/src/license_headers_check.rs +++ b/xtask/src/license_headers_check.rs @@ -448,6 +448,7 @@ lazy_static! { ("\\.astro$", LicenseLocation::Tag(LicenseTagStyle::c_style_comment_style())), ("\\.cmake$", LicenseLocation::Tag(LicenseTagStyle::shell_comment_style())), ("\\.cmake.in$", LicenseLocation::Tag(LicenseTagStyle::shell_comment_style())), + ("\\.pc.in$", LicenseLocation::Tag(LicenseTagStyle::shell_comment_style())), ("\\.conf$", LicenseLocation::Tag(LicenseTagStyle::shell_comment_style())), ("\\.cpp$", LicenseLocation::Tag(LicenseTagStyle::c_style_comment_style())), ("\\.css$", LicenseLocation::NoLicense),