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 pkg-config support to build with Bento4 #959

Open
wants to merge 2 commits 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 Build/pkgconfig/bento4.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@

Name: @PROJECT_NAME@
Description: Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
Version: @BENTO4_VERSION@
Libs: -L${libdir} -lap4
Cflags: -I${includedir}/bento4
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ file(GLOB AP4_HEADERS
${SOURCE_METADATA}/*.h
)

add_library(ap4 STATIC ${AP4_SOURCES})
option(BUILD_SHARED_LIBRARY "Build as a shared library" OFF)
if(BUILD_SHARED_LIBRARY)
add_library(ap4 SHARED ${AP4_SOURCES})
else()
add_library(ap4 STATIC ${AP4_SOURCES})
endif()
target_include_directories(ap4 PUBLIC
${AP4_INCLUDE_DIRS}
)
Expand Down Expand Up @@ -119,6 +124,12 @@ configure_package_config_file(
INSTALL_DESTINATION "${config_install_dir}"
)

configure_file(
"Build/pkgconfig/bento4.pc.in"
"${generated_dir}/bento4.pc"
@ONLY
)

install(
TARGETS ap4 ${BENTO4_APPS_LOWERCASE}
EXPORT "${TARGETS_EXPORT_NAME}"
Expand All @@ -138,6 +149,11 @@ install(
DESTINATION "${config_install_dir}"
)

install(
FILES "${generated_dir}/bento4.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)

install(
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${namespace}"
Expand Down