2 From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
3 Author: Gianfranco Costamagna <locutusofborg@debian.org>
4 Date: Thu, 31 Dec 2020 15:34:13 +0100
5 Subject: [PATCH] Add pkgconfig handling for cmake.
6 Forwarded: https://github.com/BelledonneCommunications/mediastreamer2/pull/27
7 Last-Update: 2020-12-31
10 CMakeLists.txt | 9 +++++++++
11 mediastreamer.pc.in | 2 +-
12 2 files changed, 10 insertions(+), 1 deletion(-)
14 diff --git a/CMakeLists.txt b/CMakeLists.txt
15 index 022b83113..3092755bb 100644
18 @@ -682,8 +682,12 @@ else()
19 set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_DATADIR}")
22 +set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
23 +set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
24 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h)
25 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h PROPERTIES GENERATED ON)
26 +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc)
27 +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc PROPERTIES GENERATED ON)
28 add_definitions("-DHAVE_CONFIG_H")
31 @@ -715,6 +719,11 @@ configure_package_config_file(cmake/Mediastreamer2Config.cmake.in
32 NO_SET_AND_CHECK_MACRO
36 + "${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc"
37 + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
40 install(EXPORT ${EXPORT_TARGETS_NAME}Targets
41 FILE Mediastreamer2Targets.cmake
42 DESTINATION ${CONFIG_PACKAGE_LOCATION}
43 diff --git a/mediastreamer.pc.in b/mediastreamer.pc.in
44 index 3870fda82..480bb1686 100644
45 --- a/mediastreamer.pc.in
46 +++ b/mediastreamer.pc.in
47 @@ -7,5 +7,5 @@ Name: mediastreamer
48 Description: A mediastreaming library for telephony applications
49 Requires: ortp bctoolbox
50 Version: @MEDIASTREAMER_VERSION@
51 -Libs: -L@libdir@ -lmediastreamer_base -lmediastreamer_voip
52 +Libs: -L@libdir@ -lmediastreamer
53 Cflags: -I@includedir@ @MS_PUBLIC_CFLAGS@