1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9e70c8..be4938e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -268,6 +268,15 @@ target_include_directories(snappy-static
SET_TARGET_PROPERTIES(snappy-static PROPERTIES OUTPUT_NAME snappy)
+if(UNIX)
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/cmake/snappy.pc.in"
+ "${PROJECT_BINARY_DIR}/snappy.pc"
+ @ONLY
+ )
+ install(FILES "${PROJECT_BINARY_DIR}/snappy.pc" DESTINATION lib/$ENV{DEB_HOST_MULTIARCH}/pkgconfig)
+endif(UNIX)
+
if(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
add_library(snappy_test_support "")
target_sources(snappy_test_support
diff --git a/cmake/snappy.pc.in b/cmake/snappy.pc.in
new file mode 100644
index 0000000..6c43545
--- /dev/null
+++ b/cmake/snappy.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/include
+
+Name: @PROJECT_NAME@
+Description: A fast compression/decompression library
+Version: @PROJECT_VERSION@
+Libs: -L${libdir} -lsnappy
+Cflags: -I${includedir}
\ No newline at end of file
|