---
name: "ecm-find-modules"
section: "7"
platform: "linux"
package: "extra-cmake-modules"
version: "6.31.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ecm-find-modules"
---

# ecm-find-modules(7)

ECM Find Modules Reference

## NAME

ecm-find-modules - ECM Find Modules Reference

## INTRODUCTION

Find modules are used by the CMake **find\_package** command to search for packages that do not provide their own CMake package config files. CMake provides an extensive set of find modules, and Extra CMake Modules (ECM) adds to that.

To use ECM’s find modules, you need to tell CMake to find the ECM package, and then add either **${ECM\_MODULE\_PATH}** or **${ECM\_FIND\_MODULE\_DIR}** to the **CMAKE\_MODULE\_PATH** variable:

```
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_FIND_MODULE_DIR})
```

Using **${ECM\_MODULE\_PATH}** will also make the modules intended for direct use by CMake scripts available (see **[ecm-modules(7)](/ecm-modules/7.md)** \<#manual:[ecm-modules(7)](/ecm-modules/7.md)\> and **[ecm-kde-modules(7)](/ecm-kde-modules/7.md)** \<#manual:[ecm-kde-modules(7)](/ecm-kde-modules/7.md)\>).

You can also make local copies of find modules using the **ecm\_use\_find\_modules** function from **ECMUseFindModules** \<#module:ECMUseFindModules\>, which is automatically included when ECM is found:

```
find_package(ECM REQUIRED NO_MODULE)
ecm_use_find_modules(
    DIR "${CMAKE_BINARY_DIR}/cmake"
    MODULES FindEGL.cmake
)
set(CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/cmake")
```

This allows selective use of ECM’s find modules, and the NO\_OVERRIDE argument can be used to ensure that if CMake ships its own version of that find module, it will be used instead.

## ALL FIND MODULES

### Find7Zip

Try to find 7-Zip.

If the 7-Zip executable is not in your PATH, you can provide an alternative name or full path location with the **7Zip\_EXECUTABLE** variable.

This will define the following variables:

- **7Zip\_FOUND**

  TRUE if 7-Zip is available

- **7Zip\_EXECUTABLE**

  Path to 7-Zip executable

If **7Zip\_FOUND** is TRUE, it will also define the following imported target:

- **7Zip::7Zip**

  Path to 7-Zip executable

**Note:**

It will see to only find the original 7-Zip, not one of the  p7zip forks.

Since 5.113.0.

### Find7z

Try to find 7z.

If the 7z executable is not in your PATH, you can provide an alternative name or full path location with the **7z\_EXECUTABLE** variable.

This will define the following variables:

- **7z\_FOUND**

  TRUE if 7z is available

- **7z\_EXECUTABLE**

  Path to 7z executable

If **7z\_FOUND** is TRUE, it will also define the following imported target:

- **7z::7z**

  Path to 7z executable

**Note:**

Only works on Windows.

Deprecated: since 5.113, use  **Find7Zip** \<#find-module:Find7Zip\>.

Since 5.85.0.

### FindCanberra

Try to find Canberra event sound library.

This will define the following variables:

- **Canberra\_FOUND**

  True if (the requested version of) Canberra is available

- **Canberra\_VERSION**

  The version of Canberra

- **Canberra\_LIBRARIES**

  The libraries of Canberra for use with target\_link\_libraries()

- **Canberra\_INCLUDE\_DIRS**

  The include dirs of Canberra for use with target\_include\_directories()

If **Canberra\_FOUND** is TRUE, it will also define the following imported target:

- **Canberra::Canberra**

  The Canberra library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

Since 5.56.0.

### FindEGL

Try to find EGL.

This will define the following variables:

- **EGL\_FOUND**

  True if (the requested version of) EGL is available

- **EGL\_VERSION**

  The version of EGL; note that this is the API version defined in the headers, rather than the version of the implementation (eg: Mesa)

- **EGL\_LIBRARIES**

  This can be passed to target\_link\_libraries() instead of the **EGL::EGL** target

- **EGL\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the target is not used for linking

- **EGL\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the target is not used for linking

If **EGL\_FOUND** is TRUE, it will also define the following imported target:

- **EGL::EGL**

  The EGL library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

Since pre-1.0.0.

### FindFFmpeg

Try to find FFmpeg components.

The following components are available:

```
AVCODEC  AVFILTER    AVDEVICE  AVFORMAT
AVUTIL   SWRESAMPLE  SWSCALE   POSTPROCESS
```

If no components are specified in the find\_module call, the following ones will be chosen as default:

```
AVFORMAT AVUTIL AVCODEC
```

### Imported Targets

This module provides the following imported targets, if found:

- **FFmpeg::FFmpeg**

  For all the required FFmpeg components

- **FFmpeg::\<component\>**

  For each \<component\> that was found

### Result Variables

This will define the following variables:

- **FFMPEG\_FOUND**

  System has the all required components.

- **FFMPEG\_INCLUDE\_DIRS**

  Include directory necessary for using the required components headers.

- **FFMPEG\_LIBRARIES**

  Link these to use the required FFmpeg components.

- **FFMPEG\_DEFINITIONS**

  Compiler switches required for using the required FFmpeg components.

Additionally for each of the components, the following variables will be defined:

- **\<component\>\_FOUND**

  True if (the requestion version of) \<component\> is available

- **\<component\>\_INCLUDE\_DIRS**

  Include directory necessary for using the \<component\> headers

- **\<component\>\_LIBRARIES**

  Link these to use \<component\>

- **\<component\>\_DEFINITIONS**

  Compiler switches required for using \<component\>

- **\<component\>\_VERSION**

  The components version (NOTE: always empty on Windows)

As the versions of the various FFmpeg components differ for a given release, and CMake supports only one common version for all components, use the following to specify required versions for multiple components:

```
find_package(FFmpeg 57.48 COMPONENTS AVCODEC)
find_package(FFmpeg 57.40 COMPONENTS AVFORMAT)
find_package(FFmpeg 55.27 COMPONENTS AVUTIL)
```

NOTE: version checking is skipped on Windows

Since 6.20.0.

### FindGLIB2

Try to locate the GLib2 library. If found, this will define the following variables:

- **GLIB2\_FOUND**

  True if the GLib2 library is available

- **GLIB2\_INCLUDE\_DIRS**

  The GLib2 include directories

- **GLIB2\_LIBRARIES**

  The GLib2 libraries for linking

- **GLIB2\_INCLUDE\_DIR**

  Deprecated, use **GLIB2\_INCLUDE\_DIRS**

- **GLIB2\_LIBRARY**

  Deprecated, use **GLIB2\_LIBRARIES**

If **GLIB2\_FOUND** is TRUE, it will also define the following imported target:

- **GLIB2::GLIB2**

  The GLIB2 library

- **GLIB2::GTHREAD2**

  The GThread2 library (since 6.7.0)

- **GLIB2::GOBJECT**

  The GObject library (since 6.7.0)

- **GLIB2::GIO**

  The GIO library (since 6.7.0)

Since 5.41.0.

### FindGperf

Try to find GNU gperf.

If the gperf executable is not in your PATH, you can provide an alternative name or full path location with the **Gperf\_EXECUTABLE** variable.

This will define the following variables:

- **Gperf\_FOUND**

  True if gperf is available.

- **Gperf\_EXECUTABLE**

  The gperf executable.

- **Gperf\_VERSION**

  The gperf version. (since 5.85)

If **Gperf\_FOUND** is TRUE, it will also define the following imported target:

- **GPerf::Gperf**

  The gperf executable.

and the following public function:

```
ecm_gperf_generate(<GperfInput> <OutputFile> <OutputVariable(|target (since 5.83))>
                   [GENERATION_FLAGS <flags>])
```

Run **gperf** on **\<GperfInput\>** to generate **\<OutputFile\>**, adding it to the **\<OutputVariable\>** variable which contains the source for the target where **\<OutputFile\>** is going to be built or, since KF 5.83, if the given argument is a target, to the list of private sources of that target. The target must not be an alias. The optional **GENERATION\_FLAGS** argument is needed to pass extra parameters to **gperf** (note you cannot override that way the output file).

A simple invocation would be:

```
ecm_gperf_generate(simple.gperf ${CMAKE_CURRENT_BINARY_DIR}/simple.h MySources)
```

Since 5.35.0.

### FindGradle

Provides the ability to build Android AAR libraries using Gradle.

This relies on the Qt provided Gradle, so a Qt for Android installation is required.

```
gradle_add_aar(<target>
               BUIDLFILE build.gradle
               NAME <aar-name>)
```

This builds an Android AAR library using the given **build.gradle** file.

```
gradle_install_aar(<target>
                   DESTINATION <dest>)
```

Installs a Android AAR library that has been created with **gradle\_add\_aar**.

Since 5.76.0.

### FindIcoTool

Try to find icotool.

If the icotool executable is not in your PATH, you can provide an alternative name or full path location with the **IcoTool\_EXECUTABLE** variable.

This will define the following variables:

- **IcoTool\_FOUND**

  True if icotool is available.

- **IcoTool\_EXECUTABLE**

  The icotool executable.

If **IcoTool\_FOUND** is TRUE, it will also define the following imported target:

- **IcoTool::IcoTool**

  The icotool executable.

Since 5.49.

### FindInotify

- **Try to find inotify on this system. This finds:**

  - •

    libinotify on Unix like systems, or

  - •

    the kernel’s inotify.

This will define the following variables:

- **Inotify\_FOUND**

  True if inotify is available

- **Inotify\_LIBRARIES**

  This has to be passed to target\_link\_libraries()

- **Inotify\_INCLUDE\_DIRS**

  This has to be passed to target\_include\_directories()

On some platforms like Linux and SunOS, the libraries and include directories are empty, even though **Inotify\_FOUND** may be set to TRUE. This is because no special includes or libraries are needed. On other systems these may be needed to use inotify.

Since 5.32.0.

### FindIsoCodes

Try to find iso-codes data files. Once done this will define:

- **IsoCodes\_FOUND**

  Whether the system has iso-codes

- **IsoCodes\_PREFIX**

  The location in which the iso-codes data files are found

- **IsoCodes\_DOMAINS**

  The available domains provided by iso-codes

Since 5.80.0.

### FindKF5

Find KDE Frameworks 5 with a single find\_package() call.

This will use the package config files provided by the individual frameworks. For example, if you wish to find KArchive, which presents itself to CMake as KF5Archive (ie: you would do **find\_package(KF5Archive)** to find it directly), you can do

```
find_package(KF5 COMPONENTS Archive)
```

If all the required components (those given in the COMPONENTS argument, but not those given in the OPTIONAL\_COMPONENTS argument) are found, **KF5\_FOUND** will be set to true. Otherwise, it will be set to false.

Since pre-1.0.0.

### FindKF6

Find KDE Frameworks 6 with a single find\_package() call.

This will use the package config files provided by the individual frameworks. For example, if you wish to find KArchive, which presents itself to CMake as KF6Archive (ie: you would do **find\_package(KF6Archive)** to find it directly), you can do

```
find_package(KF6 COMPONENTS Archive)
```

If all the required components (those given in the COMPONENTS argument, but not those given in the OPTIONAL\_COMPONENTS argument) are found, **KF6\_FOUND** will be set to true. Otherwise, it will be set to false.

Since 6.0.0.

### FindLibExiv2

Try to find the Exiv2 library.

This will define the following variables:

- **LibExiv2\_FOUND**

  True if (the requested version of) Exiv2 is available

- **LibExiv2\_VERSION**

  The version of Exiv2

- **LibExiv2\_INCLUDE\_DIRS**

  The include dirs of Exiv2 for use with target\_include\_directories()

- **LibExiv2\_LIBRARIES**

  The Exiv2 library for use with target\_link\_libraries(). This can be passed to target\_link\_libraries() instead of the **LibExiv2::LibExiv2** target

If **LibExiv2\_FOUND** is TRUE, it will also define the following imported target:

- **LibExiv2::LibExiv2**

  The Exiv2 library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

Since 5.53.0.

### FindLibGit2

Try to find libgit2 on a Unix system.

This will define the following variables:

- **LIBGIT2\_FOUND**

  True if (the requested version of) libgit2 is available

- **LIBGIT2\_VERSION**

  The version of libgit2

- **LIBGIT2\_LIBRARIES**

  This can be passed to target\_link\_libraries() instead of the **LibGit2::LibGit2** target

- **LIBGIT2\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the target is not used for linking

- **LIBGIT2\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the target is not used for linking

If **LIBGIT2\_FOUND** is TRUE, it will also define the following imported target:

- **LibGit2::LibGit2**

  The libgit2 library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

Since 1.3.0.

### FindLibMount

Try to find the libmount library (part of util-linux), once done this will define:

- **LibMount\_FOUND**

  LibMount was found on the system.

- **LibMount\_INCLUDE\_DIRS**

  The libmount include directory.

- **LibMount\_LIBRARIES**

  The libmount libraries.

- **LibMount\_VERSION**

  The libmount version.

If **LibMount\_FOUND** is TRUE, it will also define the following imported target:

- **LibMount::LibMount**

  The libmount library

Since 5.83.0

### FindLibcap

Try to find the setcap binary and cap libraries

This will define:

- **Libcap\_FOUND**

  system has the cap library and setcap binary

- **Libcap\_LIBRARIES**

  cap libraries to link against

- **SETCAP\_EXECUTABLE**

  path of the setcap binary

- **In addition, the following targets are defined:**

  **Libcap::SetCapabilities**

Since 5.80.0

### FindOpenEXR

Try to find the OpenEXR libraries.

This will define the following variables:

- **OpenEXR\_FOUND**

  True if OpenEXR is available

- **OpenEXR\_LIBRARIES**

  Link to these to use OpenEXR

- **OpenEXR\_INCLUDE\_DIRS**

  Include directory for OpenEXR

- **OpenEXR\_DEFINITIONS**

  Compiler flags required to link against OpenEXR

and the following imported targets:

- **OpenEXR::IlmImf**

  The OpenEXR core library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

Since pre-1.0.0.

### FindPhoneNumber

Try to find PhoneNumber.

This is a component-based find module, which makes use of the COMPONENTS and OPTIONAL\_COMPONENTS arguments to find\_module.  The following components are available:

```
PhoneNumber  GeoCoding
```

If no components are specified, this module will act as though all components were passed to OPTIONAL\_COMPONENTS.

This module will define the following variables, independently of the components searched for or found:

- **PhoneNumber\_FOUND**

  True if (the requestion version of) PhoneNumber is available

For each searched-for components, **PhoneNumber\_\<component\>\_FOUND** will be set to TRUE if the corresponding library was found, and FALSE otherwise.  If **PhoneNumber\_\<component\>\_FOUND** is TRUE, the imported target **PhoneNumber::\<component\>** will be defined.

Since 5.54.0.

### FindPoppler

Try to find Poppler.

This is a component-based find module, which makes use of the COMPONENTS and OPTIONAL\_COMPONENTS arguments to find\_module.  The following components are available:

```
Core  Cpp  Qt5  Qt4  Glib
```

If no components are specified, this module will act as though all components were passed to OPTIONAL\_COMPONENTS.

This module will define the following variables, independently of the components searched for or found:

- **Poppler\_FOUND**

  TRUE if (the requested version of) Poppler is available

- **Poppler\_VERSION**

  Found Poppler version

- **Poppler\_TARGETS**

  A list of all targets imported by this module (note that there may be more than the components that were requested)

- **Poppler\_LIBRARIES**

  This can be passed to target\_link\_libraries() instead of the imported targets

- **Poppler\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the targets are not used for linking

- **Poppler\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the targets are not used for linking

For each searched-for components, **Poppler\_\<component\>\_FOUND** will be set to TRUE if the corresponding Poppler library was found, and FALSE otherwise.  If **Poppler\_\<component\>\_FOUND** is TRUE, the imported target **Poppler::\<component\>** will be defined.  This module will also attempt to determine **Poppler\_\*\_VERSION** variables for each imported target, although **Poppler\_VERSION** should normally be sufficient.

In general we recommend using the imported targets, as they are easier to use and provide more control.  Bear in mind, however, that if any target is in the link interface of an exported library, it must be made available by the package config file.

Since 5.19

### FindPulseAudio

Try to locate the PulseAudio library. If found, this will define the following variables:

- **PulseAudio\_FOUND**

  True if the system has the PulseAudio library of at least the minimum version specified by either the version parameter to find\_package() or the variable PulseAudio\_MINIMUM\_VERSION

- **PulseAudio\_INCLUDE\_DIRS**

  The PulseAudio include directory

- **PulseAudio\_LIBRARIES**

  The PulseAudio libraries for linking

- **PulseAudio\_MAINLOOP\_LIBRARY**

  The libraries needed to use PulseAudio Mainloop

- **PulseAudio\_VERSION**

  The version of PulseAudio that was found

- **PulseAudio\_INCLUDE\_DIR**

  Deprecated, use **PulseAudio\_INCLUDE\_DIRS**

- **PulseAudio\_LIBRARY**

  Deprecated, use **PulseAudio\_LIBRARIES**

If **PulseAudio\_FOUND** is TRUE, it will also define the following imported target:

- **PulseAudio::PulseAudio**

  The PulseAudio library

Since 5.41.0.

### FindQtWaylandScanner

Try to find qtwaylandscanner.

If the qtwaylandscanner executable is not in your PATH, you can provide an alternative name or full path location with the **QtWaylandScanner\_EXECUTABLE** variable.

This will define the following variables:

- **QtWaylandScanner\_FOUND**

  True if qtwaylandscanner is available

- **QtWaylandScanner\_EXECUTABLE**

  The qtwaylandscanner executable.

If **QtWaylandScanner\_FOUND** is TRUE, it will also define the following imported target:

- **Wayland::QtScanner**

  The qtwaylandscanner executable.

This module provides the following functions to generate C++ protocol implementations:

- •

  **ecm\_add\_qtwayland\_client\_protocol**

- •

  **ecm\_add\_qtwayland\_server\_protocol**

```
ecm_add_qtwayland_client_protocol(<target>
                                  PROTOCOL <xmlfile>
                                  BASENAME <basename>
                                  [PREFIX <prefix>]
                                  [PRIVATE_CODE])
ecm_add_qtwayland_client_protocol(<source_files_var>
                                  PROTOCOL <xmlfile>
                                  BASENAME <basename>
                                  [PREFIX <prefix>]
                                  [PRIVATE_CODE])
```

Generate C++ wrapper to Wayland client protocol files from **\<xmlfile\>** XML definition for the **\<basename\>** interface and append those files to **\<source\_files\_var\>** or **\<target\>**.  Pass the **\<prefix\>** argument if the interface names don’t start with **qt\_** or **wl\_**. **PRIVATE\_CODE** instructs wayland-scanner to hide marshalling code from the compiled DSO for use in other DSOs. The default is to export this code.

WaylandScanner is required and will be searched for.

```
ecm_add_qtwayland_server_protocol(<target>
                                  PROTOCOL <xmlfile>
                                  BASENAME <basename>
                                  [PREFIX <prefix>]
                                  [PRIVATE_CODE])
ecm_add_qtwayland_server_protocol(<source_files_var>
                                  PROTOCOL <xmlfile>
                                  BASENAME <basename>
                                  [PREFIX <prefix>]
                                  [PRIVATE_CODE])
```

Generate C++ wrapper to Wayland server protocol files from **\<xmlfile\>** XML definition for the **\<basename\>** interface and append those files to **\<source\_files\_var\>** or **\<target\>**.  Pass the **\<prefix\>** argument if the interface names don’t start with **qt\_** or **wl\_**. **PRIVATE\_CODE** instructs wayland-scanner to hide marshalling code from the compiled DSO for use in other DSOs. The default is to export this code.

WaylandScanner is required and will be searched for.

Since 1.4.0.

### FindSasl2

Try to find the SASL2 library.

This will define the following variables:

- **Sasl2\_FOUND**

  System has SASL2.

- **Sasl2\_VERSION**

  The version of SASL2.

- **Sasl2\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the target is not used for linking.

- **Sasl2\_LIBRARIES**

  The SASL2 library. This can be passed to target\_link\_libraries() instead of the **Sasl2::Sasl2** target

If **Sasl2\_FOUND** is TRUE, the following imported target will be available:

- **Sasl2::Sasl2**

  The SASL2 library

Since 5.41.0.

### FindSeccomp

Try to locate the libseccomp library.

This will define the following variables:

- **Seccomp\_FOUND**

  True if the seccomp library is available

- **Seccomp\_INCLUDE\_DIRS**

  The seccomp include directories

- **Seccomp\_LIBRARIES**

  The seccomp libraries for linking

If **Seccomp\_FOUND** is TRUE, it will also define the following imported target:

- **Seccomp::Seccomp**

  The Seccomp library

Since 5.44.0.

### FindSharedMimeInfo

Try to find the shared-mime-info package.

This will define the following variables:

- **SharedMimeInfo\_FOUND**

  True if system has the shared-mime-info package

- **UPDATE\_MIME\_DATABASE\_EXECUTABLE**

  The update-mime-database executable

and the following imported targets:

- **SharedMimeInfo::UpdateMimeDatabase**

  The update-mime-database executable

The follow macro is available:

```
update_xdg_mimetypes(<path>)
```

Updates the XDG mime database at install time (unless the **$DESTDIR** environment variable is set, in which case it is up to package managers to perform this task).

Since pre-1.0.0.

### FindTaglib

Try to find the Taglib library.

This will define the following variables:

- **Taglib\_FOUND**

  True if the system has the taglib library of at least the minimum version specified by the version parameter to find\_package()

- **Taglib\_INCLUDE\_DIRS**

  The taglib include dirs for use with target\_include\_directories

- **Taglib\_LIBRARIES**

  The taglib libraries for use with target\_link\_libraries()

- **Taglib\_VERSION**

  The version of taglib that was found

If **Taglib\_FOUND** is TRUE, it will also define the following imported target:

- **Taglib::Taglib**

  The Taglib library

Since 5.72.0

### FindUDev

Try to find the UDev library.

This will define the following variables:

- **UDev\_FOUND**

  System has UDev.

- **UDev\_INCLUDE\_DIRS**

  The libudev include directory.

- **UDev\_LIBRARIES**

  The libudev libraries.

- **UDev\_VERSION**

  The libudev version.

If **UDev\_FOUND** is TRUE, it will also define the following imported target:

- **UDev::UDev**

  The UDev library

Since 5.57.0.

### FindWayland

Try to find Wayland.

This is a component-based find module, which makes use of the COMPONENTS and OPTIONAL\_COMPONENTS arguments to find\_module.  The following components are available:

```
Client  Server  Cursor  Egl
```

If no components are specified, this module will act as though all components were passed to OPTIONAL\_COMPONENTS.

This module will define the following variables, independently of the components searched for or found:

- **Wayland\_FOUND**

  TRUE if (the requested version of) Wayland is available

- **Wayland\_VERSION**

  Found Wayland version

- **Wayland\_TARGETS**

  A list of all targets imported by this module (note that there may be more than the components that were requested)

- **Wayland\_LIBRARIES**

  This can be passed to target\_link\_libraries() instead of the imported targets

- **Wayland\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the targets are not used for linking

- **Wayland\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the targets are not used for linking

- **Wayland\_DATADIR**

  The core wayland protocols data directory Since 5.73.0

For each searched-for components, **Wayland\_\<component\>\_FOUND** will be set to TRUE if the corresponding Wayland library was found, and FALSE otherwise.  If **Wayland\_\<component\>\_FOUND** is TRUE, the imported target **Wayland::\<component\>** will be defined.  This module will also attempt to determine **Wayland\_\*\_VERSION** variables for each imported target, although **Wayland\_VERSION** should normally be sufficient.

In general we recommend using the imported targets, as they are easier to use and provide more control.  Bear in mind, however, that if any target is in the link interface of an exported library, it must be made available by the package config file.

Since pre-1.0.0.

### FindWaylandProtocols

Try to find wayland-protocols on a Unix system.

This will define the following variables:

- **WaylandProtocols\_FOUND**

  True if (the requested version of) wayland-protocols is available

- **WaylandProtocols\_VERSION**

  The version of wayland-protocols

- **WaylandProtocols\_DATADIR**

  The wayland protocols data directory

### FindWaylandScanner

Try to find wayland-scanner.

If the wayland-scanner executable is not in your PATH, you can provide an alternative name or full path location with the **WaylandScanner\_EXECUTABLE** variable.

This will define the following variables:

- **WaylandScanner\_FOUND**

  True if wayland-scanner is available.

- **WaylandScanner\_EXECUTABLE**

  The wayland-scanner executable.

If **WaylandScanner\_FOUND** is TRUE, it will also define the following imported target:

- **Wayland::Scanner**

  The wayland-scanner executable.

This module provides the following functions to generate C protocol implementations:

- •

  **ecm\_add\_wayland\_client\_protocol**

- •

  **ecm\_add\_wayland\_server\_protocol**

```
ecm_add_wayland_client_protocol(<target>
                                PROTOCOL <xmlfile>
                                BASENAME <basename>
                                [PRIVATE_CODE])
ecm_add_wayland_client_protocol(<source_files_var>
                                PROTOCOL <xmlfile>
                                BASENAME <basename>
                                [PRIVATE_CODE])
```

Generate Wayland client protocol files from **\<xmlfile\>** XML definition for the **\<basename\>** interface and append those files to **\<source\_files\_var\>** or **\<target\>**.

**PRIVATE\_CODE** instructs wayland-scanner to hide marshalling code from the compiled DSO for use in other DSOs. The default is to export this code.

```
ecm_add_wayland_server_protocol(<target>
                                PROTOCOL <xmlfile>
                                BASENAME <basename>
                                [PRIVATE_CODE])
ecm_add_wayland_server_protocol(<source_files_var>
                                PROTOCOL <xmlfile>
                                BASENAME <basename>
                                [PRIVATE_CODE])
```

Generate Wayland server protocol files from **\<xmlfile\>** XML definition for the **\<basename\>** interface and append those files to **\<source\_files\_var\>** or **\<target\>**.

**PRIVATE\_CODE** instructs wayland-scanner to hide marshalling code from the compiled DSO for use in other DSOs. The default is to export this code.

Since 1.4.0.

### FindX11\_XCB

Try to find the X11 XCB compatibility library.

This will define the following variables:

- **X11\_XCB\_FOUND**

  True if (the requested version of) libX11-xcb is available

- **X11\_XCB\_VERSION**

  The version of libX11-xcb (this is not guaranteed to be set even when X11\_XCB\_FOUND is true)

- **X11\_XCB\_LIBRARIES**

  This can be passed to target\_link\_libraries() instead of the **EGL::EGL** target

- **X11\_XCB\_INCLUDE\_DIR**

  This should be passed to target\_include\_directories() if the target is not used for linking

- **X11\_XCB\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the target is not used for linking

If **X11\_XCB\_FOUND** is TRUE, it will also define the following imported target:

- **X11::XCB**

  The X11 XCB compatibility library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

Since pre-1.0.0.

### FindXCB

Try to find XCB.

This is a component-based find module, which makes use of the COMPONENTS and OPTIONAL\_COMPONENTS arguments to find\_module.  The following components are available:

```
XCB
ATOM         AUX          COMPOSITE    CURSOR       DAMAGE
DPMS         DRI2         DRI3         EVENT        EWMH
GLX          ICCCM        IMAGE        KEYSYMS      PRESENT
RANDR        RECORD       RENDER       RENDERUTIL   RES
SCREENSAVER  SHAPE        SHM          SYNC         UTIL
XF86DRI      XFIXES       XINERAMA     XINPUT       XKB
XTEST        XV           XVMC
```

If no components are specified, this module will act as though all components were passed to OPTIONAL\_COMPONENTS. Before 5.82 this excluded XINPUT. Since 5.82 all components are searched for.

This module will define the following variables, independently of the components searched for or found:

- **XCB\_FOUND**

  True if (the requestion version of) xcb is available

- **XCB\_VERSION**

  Found xcb version

- **XCB\_TARGETS**

  A list of all targets imported by this module (note that there may be more than the components that were requested)

- **XCB\_LIBRARIES**

  This can be passed to target\_link\_libraries() instead of the imported targets

- **XCB\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the targets are not used for linking

- **XCB\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the targets are not used for linking

For each searched-for components, **XCB\_\<component\>\_FOUND** will be set to true if the corresponding xcb library was found, and false otherwise.  If **XCB\_\<component\>\_FOUND** is true, the imported target **XCB::\<component\>** will be defined.  This module will also attempt to determine **XCB\_\*\_VERSION** variables for each imported target, although **XCB\_VERSION** should normally be sufficient.

In general we recommend using the imported targets, as they are easier to use and provide more control.  Bear in mind, however, that if any target is in the link interface of an exported library, it must be made available by the package config file.

Since pre-1.0.0.

### Findepoxy

Try to find libepoxy on a Unix system.

This will define the following variables:

- **epoxy\_FOUND**

  True if (the requested version of) libepoxy is available

- **epoxy\_VERSION**

  The version of libepoxy

- **epoxy\_LIBRARIES**

  This should be passed to target\_link\_libraries() if the target is not used for linking

- **epoxy\_INCLUDE\_DIRS**

  This should be passed to target\_include\_directories() if the target is not used for linking

- **epoxy\_DEFINITIONS**

  This should be passed to target\_compile\_options() if the target is not used for linking

- **epoxy\_HAS\_GLX**

  True if GLX support is available

If **epoxy\_FOUND** is TRUE, it will also define the following imported target:

- **epoxy::epoxy**

  The epoxy library

In general we recommend using the imported target, as it is easier to use. Bear in mind, however, that if the target is in the link interface of an exported library, it must be made available by the package config file.

### Findgzip

Try to find gzip.

If the gzip executable is not in your PATH, you can provide an alternative name or full path location with the **gzip\_EXECUTABLE** variable.

This will define the following variables:

- **gzip\_FOUND**

  TRUE if gzip is available

- **gzip\_EXECUTABLE**

  Path to gzip executable

If **gzip\_FOUND** is TRUE, it will also define the following imported target:

- **gzip::gzip**

  Path to gzip executable

Since 5.85.0.

## SEE ALSO

**[ecm(7)](/ecm/7.md)** \<#manual:[ecm(7)](/ecm/7.md)\>, **[ecm-modules(7)](/ecm-modules/7.md)** \<#manual:[ecm-modules(7)](/ecm-modules/7.md)\>, **[ecm-kde-modules(7)](/ecm-kde-modules/7.md)** \<#manual:[ecm-kde-modules(7)](/ecm-kde-modules/7.md)\>

## Copyright

KDE Developers
