aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDECMakeSettings.cmake
diff options
context:
space:
mode:
authorHarald Sitter <sitter@kde.org>2019-07-29 13:44:10 +0200
committerHarald Sitter <sitter@kde.org>2019-08-19 14:40:26 +0200
commit60ca1a27e53999721df1194813c9e670f6ffcc4a (patch)
tree505d9dbe8e5801e4c61b5bc6ac65a9e55f013a8e /kde-modules/KDECMakeSettings.cmake
parent6faff48245c213a472da2e28b2c9ece31177c682 (diff)
downloadextra-cmake-modules-60ca1a27e53999721df1194813c9e670f6ffcc4a.tar.gz
extra-cmake-modules-60ca1a27e53999721df1194813c9e670f6ffcc4a.tar.bz2
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
Diffstat (limited to 'kde-modules/KDECMakeSettings.cmake')
-rw-r--r--kde-modules/KDECMakeSettings.cmake9
1 files changed, 9 insertions, 0 deletions
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