[x265] [PATCH] cmake: generate and install pkgconfig file
Steve Borho
steve at borho.org
Wed Oct 23 00:20:08 CEST 2013
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1382480398 18000
# Tue Oct 22 17:19:58 2013 -0500
# Node ID f51a70b352878bb64c71cbcdc40898a9706db2cf
# Parent 6d96d64c4e9a2c526b57274760a7147241328cb3
cmake: generate and install pkgconfig file
Feedback appreciated; what is this missing?
diff -r 6d96d64c4e9a -r f51a70b35287 source/CMakeLists.txt
--- a/source/CMakeLists.txt Tue Oct 22 23:36:36 2013 +0530
+++ b/source/CMakeLists.txt Tue Oct 22 17:19:58 2013 -0500
@@ -189,6 +189,13 @@
ARCHIVE DESTINATION lib)
install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include)
+if(UNIX AND NOT APPLE)
+ # Produce a pkg-config file for linking against the shared lib
+ configure_file("x265.pc.in" "x265.pc" @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/x265.pc"
+ DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/pkgconfig")
+endif()
+
if(NOT WIN32)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
diff -r 6d96d64c4e9a -r f51a70b35287 source/x265.pc.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/x265.pc.in Tue Oct 22 17:19:58 2013 -0500
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: @CMAKE_PROJECT_NAME@
+Description: H.265/HEVC video encoder
+Version: @X265_LATEST_TAG@
+Libs: -L${libdir} -lx265
+Cflags: -I${includedir}
More information about the x265-devel
mailing list