diff options
author | Michal Sojka <michal.sojka@cvut.cz> | 2021-03-17 17:40:59 +0100 |
---|---|---|
committer | Yordan Karadzhov (VMware) <y.karadz@gmail.com> | 2021-03-22 17:19:39 +0200 |
commit | eec8dfe4d374009482e7447bc610966ad688bfcb (patch) | |
tree | 3b8b62b5b4993d0258faa2b93254c808c6d6aa06 | |
parent | 9fbb7a6a731a1fdff5aabacb9e6d2e0bf04aa5e9 (diff) | |
download | kernel-shark-eec8dfe4d374009482e7447bc610966ad688bfcb.tar.gz |
kernel-shark: Allow specifying TT_FONT_FILE on cmake command line
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.
Link: https://lore.kernel.org/linux-trace-devel/20210317164101.30848-3-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-- | CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index efcccb12..c4731c17 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) |