FindPerl

Finds a Perl interpreter:

find_package(Perl [<version>] [...])

Perl is a general-purpose, interpreted, dynamic programming language.

Result Variables

This module defines the following variables:

Perl_FOUND

Boolean indicating whether the (requested version of) Perl executable is found. For backward compatibility, the PERL_FOUND variable is also set to the same value.

Perl_VERSION

Added in version 4.2.

The version of Perl found.

Cache Variables

The following cache variables may also be set:

PERL_EXECUTABLE

Full path to the perl executable.

Deprecated Variables

The following variables are provided for backward compatibility:

PERL_VERSION_STRING

Deprecated since version 4.2: Superseded by the Perl_VERSION.

The version of Perl found.

Examples

Finding the Perl interpreter and executing it in a process:

find_package(Perl)

if(Perl_FOUND)
  execute_process(COMMAND ${PERL_EXECUTABLE} --help)
endif()

See Also