Skip to content

Commit

Permalink
Generate and install pkg-config file for slint_cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
task-jp committed Dec 25, 2024
1 parent cc1a9be commit ff8cec6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions api/cpp/cmake/slint.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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

0 comments on commit ff8cec6

Please sign in to comment.