Skip to content

Commit

Permalink
cmake: add pkgconfig (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers authored Aug 27, 2022
1 parent 3dbe73b commit 8c10b83
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
30 changes: 21 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

cmake_minimum_required(VERSION 3.7)

project(re VERSION 2.6.1 LANGUAGES C)
project(re
VERSION 2.6.1
LANGUAGES C
HOMEPAGE_URL https://github.com/baresip/re
DESCRIPTION "Generic library for real-time communications"
)

set(PROJECT_SOVERSION 8) # bump if ABI breaks

Expand Down Expand Up @@ -554,6 +559,18 @@ set_target_properties(re PROPERTIES OUTPUT_NAME "re-static")
endif()


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

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

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


##############################################################################
#
# Install section
Expand Down Expand Up @@ -582,11 +599,6 @@ install(FILES cmake/re-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/re
)

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

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(packaging)
endif()
install(FILES libre.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
12 changes: 12 additions & 0 deletions packaging/libre.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix=${prefix}
libdir={$prefix}/lib
includedir=${prefix}/include/re

Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Libs: -L${libdir} -lre
Libs.private: -L${libdir} -lre -ldl -lssl -lcrypto -lz -lpthread
Cflags: -I${includedir}

0 comments on commit 8c10b83

Please sign in to comment.