.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "ECM" "7" "Oct 14, 2024" "6.7" "Extra CMake Modules" .SH NAME ecm \- Extra CMake Modules .SH INTRODUCTION .sp The Extra CMake Modules package, or ECM, adds to the modules provided by CMake, including ones used by \fBfind_package()\fP to find common software, ones that can be used directly in \fBCMakeLists.txt\fP files to perform common tasks and toolchain files that must be specified on the commandline by the user. .sp In addition, it provides common build settings used in software produced by the KDE community. .sp While the driving force of this module is to reduce duplication in CMake scripts across KDE software, it is intended to be useful for any software that uses the CMake build system. .SH USAGE .sp To use ECM, add the following to your \fBCMakeLists.txt\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) .EE .UNINDENT .UNINDENT .sp (note that you may want to append \fB${ECM_MODULE_PATH}\fP to \fBCMAKE_MODULE_PATH\fP rather than discarding the existing value). You can then just include the modules you require, or use \fBfind_package()\fP as needed. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX include(ECMInstallIcons) .EE .UNINDENT .UNINDENT .sp Developers of KDE software will often want to use the KDE standard settings provided by ECM; they can do the following: .INDENT 0.0 .INDENT 3.5 .sp .EX find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(KDEInstallDirs) include(KDECompilerSettings) include(KDECMakeSettings) .EE .UNINDENT .UNINDENT .sp Note that any combination of the above includes can be used if you only want some of the settings. Some of the functionality of \fI\%KDECMakeSettings\fP can also be selectively disabled. .SS Organization .sp ECM provides four different types of modules. .INDENT 0.0 .IP \(bu 2 Core modules provide helpful macros for use in project CMake scripts. See \fI\%ecm\-modules(7)\fP for more information. .IP \(bu 2 Find modules extend the functionality of CMake’s \fBfind_package()\fP command. See \fI\%ecm\-find\-modules(7)\fP for more information. .IP \(bu 2 KDE modules provide common settings for software produced by KDE; much of this may also be useful to other projects. See \fI\%ecm\-kde\-modules(7)\fP for more information. .IP \(bu 2 Toolchain files change the build tools and targets used by CMake. See \fI\%ecm\-toolchains(7)\fP for more information. .UNINDENT .sp The \fB${ECM_MODULE_DIR}\fP, \fB${ECM_FIND_MODULE_DIR}\fP and \fB${ECM_KDE_MODULE_DIR}\fP variables may be used instead of \fB${ECM_MODULE_PATH}\fP if you only need some of this functionality. .SH DEVELOPMENT .sp The \fI\%ecm\-developer(7)\fP manual contains more information about developing for Extra CMake Modules. .SH LICENSE .sp All code is licensed under the \X'tty: link https://opensource.org/licenses/BSD-3-Clause'\fI\%BSD 3\-Clause license\fP\X'tty: link'\&. .SH LINKS .INDENT 0.0 .IP \(bu 2 Home page: \X'tty: link https://commits.kde.org/extra-cmake-modules'\fI\%https://commits.kde.org/extra\-cmake\-modules\fP\X'tty: link' .IP \(bu 2 Documentation: \X'tty: link https://api.kde.org/ecm/'\fI\%https://api.kde.org/ecm/\fP\X'tty: link' .IP \(bu 2 Mailing list: \X'tty: link https://mail.kde.org/mailman/listinfo/kde-buildsystem'\fI\%https://mail.kde.org/mailman/listinfo/kde\-buildsystem\fP\X'tty: link' .IP \(bu 2 IRC channel: #kde\-devel on Libera Chat .IP \(bu 2 Git repository: \X'tty: link https://commits.kde.org/extra-cmake-modules'\fI\%https://commits.kde.org/extra\-cmake\-modules\fP\X'tty: link' .UNINDENT .SH COPYRIGHT KDE Developers .\" Generated by docutils manpage writer. .