提交 2f51abf9 编写于 作者: S Steve Wills 提交者: jp9000

libobs: Add pkgconfig support

Based on:

http://dailycommit.blogspot.com/2016/10/how-to-generate-pkg-config-file-with.html
https://people.freedesktop.org/~dbn/pkg-config-guide.html

Should allow third party plugins to find and use libobs more easily.

Closes obsproject/obs-studio#1467
上级 47285c2b
...@@ -447,6 +447,14 @@ if(BUILD_CAPTIONS) ...@@ -447,6 +447,14 @@ if(BUILD_CAPTIONS)
endif() endif()
add_library(libobs SHARED ${libobs_SOURCES} ${libobs_HEADERS}) add_library(libobs SHARED ${libobs_SOURCES} ${libobs_HEADERS})
if(UNIX AND NOT APPLE)
set(DEST_DIR "${CMAKE_INSTALL_PREFIX}")
foreach(LIB "obs" "rt")
set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
endforeach()
CONFIGURE_FILE("libobs.pc.in" "libobs.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libobs.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
endif()
set_target_properties(libobs PROPERTIES set_target_properties(libobs PROPERTIES
OUTPUT_NAME obs OUTPUT_NAME obs
......
prefix=@DEST_DIR@
exec_prefix=${prefix}
libdir=${prefix}/@OBS_LIBRARY_DESTINATION@
includedir=${prefix}/include
Name: libobs
Description: OBS Studio Library
Version: @OBS_VERSION@
Requires: x11
Cflags: -I${includedir}
Libs: -L${libdir} @PRIVATE_LIBS@
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册