void-packages/srcpkgs/deepin-movie-reborn/patches/48.patch
2019-08-01 03:11:43 +00:00

43 lines
1.7 KiB
Diff

From 0a46b32065fc7508cc9af611d6809187a42be91d Mon Sep 17 00:00:00 2001
From: Gary Wang <wzc782970009@gmail.com>
Date: Tue, 30 Jul 2019 11:24:28 +0800
Subject: [PATCH] fix: build failed if cannot find dtk-settings tool
---
src/CMakeLists.txt | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git src/CMakeLists.txt src/CMakeLists.txt
index b403c96..55b0318 100644
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -42,12 +42,15 @@ list(APPEND SRCS ${MPV_SRCS})
list(APPEND PROJECT_INCLUDE ${PROJECT_SOURCE_DIR}/src/backends/mpv)
#~
-add_custom_target(json_i18n ALL
- /usr/lib/dtk2/dtk-settings resources/data/settings.json -o common/settings_translation.cpp
- COMMAND sed -i "s,#include .*,#include <DSettings>," common/settings_translation.cpp
- VERBATIM
- SOURCES resources/data/settings.json
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/)
+set (DTK_SETTINGS_TOOLS_EXECUTABLE ${DTKCORE_TOOL_DIR}/dtk-settings)
+if (EXISTS ${DTK_SETTINGS_TOOLS_EXECUTABLE})
+ add_custom_target(json_i18n ALL
+ ${DTKCORE_TOOL_DIR}/dtk-settings resources/data/settings.json -o common/settings_translation.cpp
+ COMMAND sed -i "s,#include .*,#include <DSettings>," common/settings_translation.cpp
+ VERBATIM
+ SOURCES resources/data/settings.json
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/)
+endif ()
## translations
file(GLOB TS LIST_DIRECTORIES false translations/${CMD_NAME}*.ts)
@@ -61,7 +64,6 @@ endif ()
# ~
add_executable(${CMD_NAME} ${SRCS} ${RCS} ${QM})
-add_dependencies(${CMD_NAME} json_i18n)
target_include_directories(${CMD_NAME} PUBLIC ${PROJECT_INCLUDE})
set(TARGET_LIBS X11 Xext Xtst PkgConfig::Xcb Qt5::Widgets Qt5::X11Extras Qt5::Network