1ECM(7) Extra CMake Modules ECM(7)
2
3
4
6 ecm - Extra CMake Modules
7
9 The Extra CMake Modules package, or ECM, adds to the modules provided
10 by CMake, including ones used by find_package() to find common soft‐
11 ware, ones that can be used directly in CMakeLists.txt files to perform
12 common tasks and toolchain files that must be specified on the command‐
13 line by the user.
14
15 In addition, it provides common build settings used in software pro‐
16 duced by the KDE community.
17
18 While the driving force of this module is to reduce duplication in
19 CMake scripts across KDE software, it is intended to be useful for any
20 software that uses the CMake build system.
21
23 To use ECM, add the following to your CMakeLists.txt:
24
25 find_package(ECM REQUIRED NO_MODULE)
26 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
27
28 (note that you may want to append ${ECM_MODULE_PATH} to CMAKE_MOD‐
29 ULE_PATH rather than discarding the existing value). You can then just
30 include the modules you require, or use find_package() as needed. For
31 example:
32
33 include(ECMInstallIcons)
34
35 Developers of KDE software will often want to use the KDE standard set‐
36 tings provided by ECM; they can do the following:
37
38 find_package(ECM REQUIRED NO_MODULE)
39 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
40 include(KDEInstallDirs)
41 include(KDECompilerSettings)
42 include(KDECMakeSettings)
43
44 Note that any combination of the above includes can be used if you only
45 want some of the settings. Some of the functionality of KDECMakeSet‐
46 tings can also be selectively disabled.
47
48 Organization
49 ECM provides four different types of modules.
50
51 · Core modules provide helpful macros for use in project CMake scripts.
52 See ecm-modules(7) for more information.
53
54 · Find modules extend the functionality of CMake’s find_package() com‐
55 mand. See ecm-find-modules(7) for more information.
56
57 · KDE modules provide common settings for software produced by KDE;
58 much of this may also be useful to other projects. See ecm-kde-mod‐
59 ules(7) for more information.
60
61 · Toolchain files change the build tools and targets used by CMake. See
62 ecm-toolchains(7) for more information.
63
64 The ${ECM_MODULE_DIR}, ${ECM_FIND_MODULE_DIR} and ${ECM_KDE_MODULE_DIR}
65 variables may be used instead of ${ECM_MODULE_PATH} if you only need
66 some of this functionality.
67
69 The ecm-developer(7) manual contains more information about developing
70 for Extra CMake Modules.
71
73 All code is licensed under the BSD 3-Clause license.
74
76 · Home page: https://commits.kde.org/extra-cmake-modules
77
78 · Documentation: https://api.kde.org/ecm/
79
80 · Mailing list: https://mail.kde.org/mailman/listinfo/kde-buildsystem
81
82 · IRC channel: #kde-devel on Freenode
83
84 · Git repository: https://commits.kde.org/extra-cmake-modules
85
87 KDE Developers
88
89
90
91
925.58 May 14, 2019 ECM(7)