From 60ca1a27e53999721df1194813c9e670f6ffcc4a Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Mon, 29 Jul 2019 13:44:10 +0200 Subject: set autorcc and autouic by default Summary: I couldn't find any pertinent discussion on the topic but some reviews I stumbled over did set it on some of our application repos and also wonder why we don't enable it by default. autorcc allows more idiomatic use of qrc as they may be used like any "ordinary" source file and cmake will know what to do with them (namely compile into relevant cpp for inclusion in target) without the developer having to worry about anything. autouic does the same albeit for .ui files. Test Plan: .qrc files can be added to src list variables and will get automatically generated into cpp files in the binary dir and built into the target Reviewers: apol Reviewed By: apol Subscribers: cgiboudeaux, vkrause, kossebau, apol, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D22805 --- kde-modules/KDECMakeSettings.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kde-modules/KDECMakeSettings.cmake') diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 99d2ae05..6bbb90da 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -78,6 +78,8 @@ # - Uninstall target functionality since 1.7.0. # - ``APPLE_FORCE_X11`` option since 5.14.0 (detecting X11 was previously the default behavior) # - ``APPLE_SUPPRESS_X11_WARNING`` option since 5.14.0 +# - CMAKE_AUTORCC and CMAKE_AUTOUIC enabled by default when supported by cmake +# (>= 3.0) since 5.62.0 # # Translations # ~~~~~~~~~~~~ @@ -238,6 +240,13 @@ if(NOT KDE_SKIP_BUILD_SETTINGS) # Since CMake 2.8.6 set(CMAKE_AUTOMOC ON) + # Enable autorcc and autouic in cmake so qrc and ui files get generated. + # Since CMake 3.0 + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + set(CMAKE_AUTORCC ON) + set(CMAKE_AUTOUIC ON) + endif() + # By default, create 'GUI' executables. This can be reverted on a per-target basis # using ECMMarkNonGuiExecutable # Since CMake 2.8.8 -- cgit v1.2.1