/usr/share/ECM/kde-modules/KDECMakeSettings.cmake is in extra-cmake-modules 5.18.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | #.rst:
# KDECMakeSettings
# ----------------
#
# Changes various CMake settings to what the KDE community views as more
# sensible defaults.
#
# It is recommended to include this module with the NO_POLICY_SCOPE flag,
# otherwise you may get spurious warnings with some versions of CMake.
#
# It is split into three parts, which can be independently disabled if desired.
#
# Runtime Paths
# ~~~~~~~~~~~~~
#
# The default runtime path (used on Unix systems to search for
# dynamically-linked libraries) is set to include the location that libraries
# will be installed to (as set in LIB_INSTALL_DIR), and also the linker search
# path.
#
# Note that ``LIB_INSTALL_DIR`` needs to be set before including this module.
# Typically, this is done by including the :kde-module:`KDEInstallDirs` module.
#
# This section can be disabled by setting ``KDE_SKIP_RPATH_SETTINGS`` to TRUE
# before including this module.
#
#
# Testing
# ~~~~~~~
#
# Testing is enabled by default, and an option (BUILD_TESTING) is provided for
# users to control this. See the CTest module documentation in the CMake manual
# for more details.
#
# This section can be disabled by setting ``KDE_SKIP_TEST_SETTINGS`` to TRUE
# before including this module.
#
#
# Build Settings
# ~~~~~~~~~~~~~~
#
# Various CMake build defaults are altered, such as searching source and build
# directories for includes first and enabling automoc by default.
#
# This section can be disabled by setting ``KDE_SKIP_BUILD_SETTINGS`` to TRUE
# before including this module.
#
# This section also provides an "uninstall" target that can be individually
# disabled by setting ``KDE_SKIP_UNINSTALL_TARGET`` to TRUE before including
# this module.
#
# By default on OS X, X11 and XCB related detections are disabled. However if
# the need would arise to use these technologies, the detection can be enabled
# by setting ``APPLE_FORCE_X11`` to ``ON``.
#
# A warning is printed for the developer to know that the detection is disabled on OS X.
# This message can be turned off by setting ``APPLE_SUPPRESS_X11_WARNING`` to ``ON``.
#
# Since pre-1.0.0.
#
# ``ENABLE_CLAZY`` option is added (OFF by default) when clang is being used.
# Turning this option on will force clang to load the clazy plugins for richer
# warnings on Qt-related code.
#
# If clang is not being used, this won't have an effect.
# See https://quickgit.kde.org/?p=clazy.git&a=blob&f=README&o=plain
#
# Since 5.17.0
#
# - 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
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
# Copyright 2013 Aleix Pol <aleixpol@kde.org>
# Copyright 2012-2013 Stephen Kelly <steveire@gmail.com>
# Copyright 2007 Matthias Kretz <kretz@kde.org>
# Copyright 2006-2007 Laurent Montel <montel@kde.org>
# Copyright 2006-2013 Alex Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file COPYING-CMAKE-SCRIPTS for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of extra-cmake-modules, substitute the full
# License text for the above reference.)
################# RPATH handling ##################################
if(NOT KDE_SKIP_RPATH_SETTINGS)
# Set the default RPATH to point to useful locations, namely where the
# libraries will be installed and the linker search path
if(NOT LIB_INSTALL_DIR)
message(FATAL_ERROR "LIB_INSTALL_DIR not set. This is necessary for using the RPATH settings.")
endif()
set(_abs_LIB_INSTALL_DIR "${LIB_INSTALL_DIR}")
if (NOT IS_ABSOLUTE "${_abs_LIB_INSTALL_DIR}")
set(_abs_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
endif()
if (UNIX)
# for mac os: add install name dir in addition
# check: is the rpath stuff below really required on mac os? at least it seems so to use a stock qt from qt.io
if (APPLE)
set(CMAKE_INSTALL_NAME_DIR ${_abs_LIB_INSTALL_DIR})
endif ()
# add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of
# the standard system link directories - such as /usr/lib on UNIX)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemLibDir)
list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCxxLibDir)
list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCLibDir)
if("${_isSystemLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${_abs_LIB_INSTALL_DIR}")
endif()
# Append directories in the linker search path (but outside the project)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif (UNIX)
endif()
################ Testing setup ####################################
if(NOT KDE_SKIP_TEST_SETTINGS)
# If there is a CTestConfig.cmake, include CTest.
# Otherwise, there will not be any useful settings, so just
# fake the functionality we care about from CTest.
if (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake)
include(CTest)
else()
option(BUILD_TESTING "Build the testing tree." ON)
if(BUILD_TESTING)
enable_testing()
endif ()
endif ()
endif()
################ Build-related settings ###########################
if(NOT KDE_SKIP_BUILD_SETTINGS)
# Always include srcdir and builddir in include path
# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} in about every subdir
# since cmake 2.4.0
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# put the include dirs which are in the source or build tree
# before all other include dirs, so the headers in the sources
# are prefered over the already installed ones
# since cmake 2.4.1
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
# Add the src and build dir to the BUILD_INTERFACE include directories
# of all targets. Similar to CMAKE_INCLUDE_CURRENT_DIR, but transitive.
# Since CMake 2.8.11
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
# When a shared library changes, but its includes do not, don't relink
# all dependencies. It is not needed.
# Since CMake 2.8.11
set(CMAKE_LINK_DEPENDS_NO_SHARED ON)
# Default to shared libs for KDE, if no type is explicitely given to add_library():
set(BUILD_SHARED_LIBS TRUE CACHE BOOL "If enabled, shared libs will be built by default, otherwise static libs")
# Enable automoc in cmake
# Since CMake 2.8.6
set(CMAKE_AUTOMOC ON)
# By default, create 'GUI' executables. This can be reverted on a per-target basis
# using ECMMarkNonGuiExecutable
# Since CMake 2.8.8
set(CMAKE_WIN32_EXECUTABLE ON)
set(CMAKE_MACOSX_BUNDLE ON)
# By default, don't put a prefix on MODULE targets. add_library(MODULE) is basically for plugin targets,
# and in KDE plugins don't have a prefix.
set(CMAKE_SHARED_MODULE_PREFIX "")
unset(EXECUTABLE_OUTPUT_PATH)
unset(LIBRARY_OUTPUT_PATH)
unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
# under Windows, output all executables and dlls into
# one common directory, and all static|import libraries and plugins
# into another one. This way test executables can find their dlls
# even without installation.
if(WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()
# Disable detection of X11 and related package on OS X because when using
# brew or macports, X11 can be installed and thus is detected.
option(APPLE_FORCE_X11 "Force enable X11 related detection on OS X" OFF)
option(APPLE_SUPPRESS_X11_WARNING "Suppress X11 and related technologies search disabling warning on OS X" OFF)
if(APPLE AND NOT APPLE_FORCE_X11)
if (NOT APPLE_SUPPRESS_X11_WARNING)
message(WARNING "Searching for X11 and related technologies is disabled on Apple systems. Set APPLE_FORCE_X11 to ON to change this behaviour. Set APPLE_SUPPRESS_X11_WARNING to ON to hide this warning.")
endif()
set(CMAKE_DISABLE_FIND_PACKAGE_X11 true)
set(CMAKE_DISABLE_FIND_PACKAGE_XCB true)
set(CMAKE_DISABLE_FIND_PACKAGE_Qt5X11Extras true)
endif()
option(KDE_SKIP_UNINSTALL_TARGET "Prevent an \"uninstall\" target from being generated." OFF)
if(NOT KDE_SKIP_UNINSTALL_TARGET)
include("${ECM_MODULE_DIR}/ECMUninstallTarget.cmake")
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
option(ENABLE_CLAZY "Enable Clazy warnings" OFF)
if(ENABLE_CLAZY)
set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT} -Xclang -load -Xclang ClangLazy.so -Xclang -add-plugin -Xclang clang-lazy")
endif()
endif()
###################################################################
|