blob: 13586ff29a02e53abd2b3211fdcffbea55a5b5cc (
plain)
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
38
39
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 808330e..0b5aaff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -664,6 +664,17 @@ if (gflags_FOUND)
endif (CMAKE_VERSION VERSION_LESS 3.9)
endif (gflags_FOUND)
+if (OS_WINDOWS)
+ set (PKGCONFIG_INSTALL_DIR)
+else ()
+ set (PKGCONFIG_INSTALL_DIR ${_glog_CMake_LIBDIR}/pkgconfig)
+endif ()
+
+if (PKGCONFIG_INSTALL_DIR)
+ configure_file ("cmake/libglog.pc.in" "${PROJECT_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}.pc" @ONLY)
+ install (FILES "${PROJECT_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}.pc" DESTINATION "${PKGCONFIG_INSTALL_DIR}")
+endif ()
+
configure_package_config_file (glog-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/glog-config.cmake
INSTALL_DESTINATION ${_glog_CMake_INSTALLDIR}
diff --git a/cmake/libglog.pc.in b/cmake/libglog.pc.in
new file mode 100644
index 0000000..98b54bb
--- /dev/null
+++ b/cmake/libglog.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+Name: libglog
+Description: Google Log (glog) C++ logging framework
+Version: 0.4.0
+Requires: gflags
+Libs: -L${libdir} -lglog
+Cflags: -I${includedir}
|