[PATCH 1/4] kernel-shark: Allow specifying PKG_CONFIG_DIR on cmake command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On some distributions (e.g. NixOS), it is not possible to write files
to directories owned by different packages. For this reason, we cannot
always install libkshark.pc file to the directory reported by
pkg-config.

This commit allows to specify where to install the .pc file on cmake
commandline via -DPKG_CONGIG_DIR=... When specified, automatic
detection of .pc install directory is skipped.

Signed-off-by: Michal Sojka <michal.sojka@xxxxxxx>
---
 src/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1e86e9c..b81d7d9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -134,8 +134,10 @@ 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)
+    if (NOT PKG_CONGIG_DIR)
+        execute_process(COMMAND  bash "-c" "pkg-config --variable pc_path pkg-config | cut -f 1 -d: -z"
+          OUTPUT_VARIABLE PKG_CONGIG_DIR)
+    endif (NOT PKG_CONGIG_DIR)
     install(FILES "${KS_DIR}/libkshark.pc"
             DESTINATION ${PKG_CONGIG_DIR}
                 COMPONENT                 libkshark-devel)
-- 
2.30.1




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux