Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
cmake: add pkgconfig (fixes #90) (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-scheck authored Sep 29, 2022
1 parent 71f1519 commit 34c8f44
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,18 @@ set_target_properties(rem PROPERTIES OUTPUT_NAME "rem-static")
endif()


##############################################################################
#
# Packaging section
#

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(packaging)
endif()

configure_file(packaging/librem.pc.in librem.pc @ONLY)


##############################################################################
#
# Install section
Expand All @@ -202,3 +214,8 @@ install(TARGETS rem-shared
NAMELINK_ONLY
COMPONENT Development
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librem.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Development
)
12 changes: 12 additions & 0 deletions packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(CPACK_PACKAGE_NAME librem)
set(CPACK_PACKAGE_VENDOR baresip)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Audio and video processing media library")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_VERBATIM_VARIABLES YES)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")

include(CPack)
11 changes: 11 additions & 0 deletions packaging/librem.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix=${prefix}
libdir={$prefix}/lib
includedir=${prefix}/include/rem

Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Libs: -L${libdir} -lrem -lre
Cflags: -I${includedir}

0 comments on commit 34c8f44

Please sign in to comment.