FindGDB

Find the GNU Debugger.

Hints

This module reads hints about search locations from variables:

GDB_ROOT

Preferred installation prefix.

Users may set these hints as normal CMake variables, cache entries or environment variables.

Imported Targets

This module provides the following imported targets, if found:

GDB::GDB

The GNU Debugger executable.

Result Variables

This will define the following variables:

GDB_FOUND

True if the system has GDB installed.

GDB_VERSION

The version of GDB which was found (eg. 2.5).

GDB_VERSION_MAJOR

GDB major version found (eg. 2).

GDB_VERSION_MINOR

GDB minor version found (eg. 5).

Cache Variables

The following cache variables may also be set:

GDB_EXECUTABLE

The full path to the GDB executable.

Components

The module accepts architecture support query using COMPONENTS. For example, support for armv7e-m and i386 architectures can be check as follow:

find_package(GDB COMPONENTS armv7e-m i386)
if(GDB_FOUND)
  message("GDB found: ${GDB_EXECUTABLE}")
endif()