diff options
author | Michal Sojka <michal.sojka@cvut.cz> | 2021-03-17 17:40:58 +0100 |
---|---|---|
committer | Yordan Karadzhov (VMware) <y.karadz@gmail.com> | 2021-03-22 17:19:05 +0200 |
commit | 9fbb7a6a731a1fdff5aabacb9e6d2e0bf04aa5e9 (patch) | |
tree | fc2911e63ffc9bc1aca80d5411906b158ba644f8 | |
parent | a461ff8f477e7e3992cab47f2bbe14e2d73ac69f (diff) | |
download | kernel-shark-9fbb7a6a731a1fdff5aabacb9e6d2e0bf04aa5e9.tar.gz |
kernel-shark: Allow specifying PKG_CONFIG_DIR on cmake command line
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.
Link: https://lore.kernel.org/linux-trace-devel/20210317164101.30848-2-michal.sojka@cvut.cz
Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
-rw-r--r-- | src/CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e86e9cb..b81d7d95 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) |