aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYordan Karadzhov (VMware) <y.karadz@gmail.com>2021-02-11 12:32:04 +0200
committerYordan Karadzhov (VMware) <y.karadz@gmail.com>2021-02-16 10:25:14 +0200
commite203bded4c5dcc48f9619a9c26ab9234c8bedcd4 (patch)
treecbf3a2b595bf7e174d9d747effa7153898f7ed89
parent39e7be5bd85359a28a8f32c8c415d577cbcb15f5 (diff)
downloadkernel-shark-e203bded4c5dcc48f9619a9c26ab9234c8bedcd4.tar.gz
kernel-shark: Add pkg-config configuration for libkshark
Add auto-generated pkg-config setup file to install for pkg-config. To be used for building against libkshark. Link: https://lore.kernel.org/linux-trace-devel/20210211103205.418588-27-y.karadz@gmail.com Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
-rw-r--r--CMakeLists.txt3
-rwxr-xr-xbuild/cmake_clean.sh1
-rw-r--r--build/libkshark.pc.cmake10
-rw-r--r--src/CMakeLists.txt6
4 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ca33fd0..efcccb12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,4 +167,7 @@ configure_file(${KS_DIR}/build/ks.desktop.cmake
configure_file(${KS_DIR}/build/org.freedesktop.kshark-record.policy.cmake
${KS_DIR}/org.freedesktop.kshark-record.policy)
+configure_file(${KS_DIR}/build/libkshark.pc.cmake
+ ${KS_DIR}/libkshark.pc @ONLY)
+
message("")
diff --git a/build/cmake_clean.sh b/build/cmake_clean.sh
index 2ca1136a..d645c324 100755
--- a/build/cmake_clean.sh
+++ b/build/cmake_clean.sh
@@ -12,6 +12,7 @@ rm -rf Testing/
rm -f ../tests/*.dat
rm -f ../lib/*
rm ../kernelshark.desktop
+rm ../libkshark.pc
rm ../org.freedesktop.kshark-record.policy
rm -f ../src/KsCmakeDef.hpp
rm -f CMakeDoxyfile.in
diff --git a/build/libkshark.pc.cmake b/build/libkshark.pc.cmake
new file mode 100644
index 00000000..ad4ce34c
--- /dev/null
+++ b/build/libkshark.pc.cmake
@@ -0,0 +1,10 @@
+prefix=@_INSTALL_PREFIX@
+libdir=@_LIBDIR@
+includedir=${prefix}/include/@KS_APP_NAME@
+
+Name: libkshark
+URL: https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/
+Description: Library for accessing ftrace file system
+Version: @KS_VERSION_STRING@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lkshark
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 41589010..6a6eda1d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -133,6 +133,12 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE)
DESTINATION ${_INSTALL_PREFIX}/bin/
COMPONENT kernelshark)
+ execute_process(COMMAND bash "-c" "pkg-config --variable pc_path pkg-config | cut -f 1 -d: -z"
+ OUTPUT_VARIABLE PKG_CONGIG_DIR)
+ install(FILES "${KS_DIR}/libkshark.pc"
+ DESTINATION ${PKG_CONGIG_DIR}
+ COMPONENT libkshark-devel)
+
endif (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE)
add_subdirectory(plugins)