From a3f82fca1163b05e070a881c4deadb3385aa78bd Mon Sep 17 00:00:00 2001 From: Antonio Rojas <arojas@archlinux.org> Date: Sun, 28 Apr 2019 23:30:12 +0200 Subject: [PATCH] Make QML compilation optional Precompiling QML code makes ktouch hard-depend on the Qt version it is compiled with, forcing it to be rebuilt with every new Qt version. This creates an additional burden for packagers in exchange for a negligible performance gain the first time the application is run (for every subsequent run the QML code is already compiled in the cache anyway) Differential Revision: https://phabricator.kde.org/D20861 --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce4138e..4ed05ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,8 @@ find_package(KF5 REQUIRED COMPONENTS XmlGui ) +option(COMPILE_QML "Precompile QML code" OFF) + # enable QML debugging for debug builds set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c270ba..c6bb6ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -83,7 +83,7 @@ set(ktouch_SRCS ktouchcontext.cpp ) -if (Qt5QuickCompiler_FOUND) +if (Qt5QuickCompiler_FOUND AND COMPILE_QML) qtquick_compiler_add_resources(ktouch_qml_SRCS qml/qml.qrc) else () qt5_add_resources(ktouch_qml_SRCS qml/qml.qrc)