linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Sojka <michal.sojka@cvut.cz>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-trace-devel@vger.kernel.org,
	Michal Sojka <michal.sojka@cvut.cz>
Subject: [PATCH 2/4] kernel-shark: Allow specifying TT_FONT_FILE on cmake command line
Date: Wed, 17 Mar 2021 17:40:59 +0100	[thread overview]
Message-ID: <20210317164101.30848-3-michal.sojka@cvut.cz> (raw)
In-Reply-To: <20210317164101.30848-1-michal.sojka@cvut.cz>

On distributions like NixOS, which build packages in a sandbox,
fontconfig configuration files may not be available at build time,
which leads to the following cmake warnings even if the font itself is
available:

    Fontconfig error: Cannot load default config file
    CMake Warning at CMakeLists.txt:62 (message):

      Could not find font FreeSans!

This commit allows to specify exact font location on cmake commandline
via -DTT_FONT_FILE=... When specified, automatic font look up via
fc-list is skipped.

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index efcccb1..c4731c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,8 +50,10 @@ find_package(OpenGL)
 find_package(GLUT)
 
 set(KS_FONT FreeSans)
-execute_process(COMMAND  bash "-c" "fc-list '${KS_FONT}' |grep ${KS_FONT}.ttf | cut -d':' -f 1 -z"
-                OUTPUT_VARIABLE TT_FONT_FILE)
+if (NOT TT_FONT_FILE)
+    execute_process(COMMAND  bash "-c" "fc-list '${KS_FONT}' |grep ${KS_FONT}.ttf | cut -d':' -f 1 -z"
+                    OUTPUT_VARIABLE TT_FONT_FILE)
+endif (NOT TT_FONT_FILE)
 
 if (TT_FONT_FILE)
 
-- 
2.30.1


  parent reply	other threads:[~2021-03-17 16:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 16:40 [PATCH 0/4] kernel-shark: CMake changes Michal Sojka
2021-03-17 16:40 ` [PATCH 1/4] kernel-shark: Allow specifying PKG_CONFIG_DIR on cmake command line Michal Sojka
2021-03-17 16:40 ` Michal Sojka [this message]
2021-03-17 16:41 ` [PATCH 3/4] kernel-shark: Allow installing polkit policy separately Michal Sojka
2021-03-17 16:41 ` [PATCH 4/4] kernel-shark: Do not use sudo in install_gui.sh + update README Michal Sojka
2021-03-23 13:45 ` [PATCH 0/4] kernel-shark: CMake changes Yordan Karadzhov (VMware)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210317164101.30848-3-michal.sojka@cvut.cz \
    --to=michal.sojka@cvut.cz \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).