Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pkgconfig handling for cmake. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,12 @@ else()
set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_DATADIR}")
endif()

set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h PROPERTIES GENERATED ON)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc PROPERTIES GENERATED ON)
add_definitions("-DHAVE_CONFIG_H")

if(ENABLE_DOC)
Expand Down Expand Up @@ -715,6 +719,11 @@ configure_package_config_file(cmake/Mediastreamer2Config.cmake.in
NO_SET_AND_CHECK_MACRO
)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

install(EXPORT ${EXPORT_TARGETS_NAME}Targets
FILE Mediastreamer2Targets.cmake
DESTINATION ${CONFIG_PACKAGE_LOCATION}
Expand Down
2 changes: 1 addition & 1 deletion mediastreamer.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: mediastreamer
Description: A mediastreaming library for telephony applications
Requires: ortp bctoolbox
Version: @MEDIASTREAMER_VERSION@
Libs: -L@libdir@ -lmediastreamer_base -lmediastreamer_voip
Libs: -L@libdir@ -lmediastreamer
Cflags: -I@includedir@ @MS_PUBLIC_CFLAGS@