|
|
@@ -5,18 +5,33 @@
|
|
|
FindPerlLibs
|
|
|
------------
|
|
|
|
|
|
-Finds Perl libraries. Perl is a general-purpose, interpreted, dynamic
|
|
|
-programming language. This module detects whether Perl is installed and
|
|
|
-determines the locations of include paths, libraries, and the library name.
|
|
|
+Finds Perl libraries:
|
|
|
+
|
|
|
+.. code-block:: cmake
|
|
|
+
|
|
|
+ find_package(PerlLibs [<version>] [...])
|
|
|
+
|
|
|
+Perl is a general-purpose, interpreted, dynamic programming language.
|
|
|
+
|
|
|
+This module detects whether Perl interpreter is installed via the
|
|
|
+:module:`FindPerl` module and determines the locations of Perl include paths,
|
|
|
+libraries, and the library name.
|
|
|
|
|
|
Result Variables
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
|
-This module sets the following variables:
|
|
|
+This module defines the following variables:
|
|
|
|
|
|
``PerlLibs_FOUND``
|
|
|
- True if ``perl.h`` and ``libperl`` were found. For backward compatibility,
|
|
|
- the ``PERLLIBS_FOUND`` variable is also set to the same value.
|
|
|
+ Boolean indicating whether the (requested version of) Perl library
|
|
|
+ (``perl.h`` and ``libperl``) is found. For backward compatibility, the
|
|
|
+ ``PERLLIBS_FOUND`` variable is also set to the same value.
|
|
|
+
|
|
|
+``PerlLibs_VERSION``
|
|
|
+ .. versionadded:: 4.2
|
|
|
+
|
|
|
+ The version of Perl library found.
|
|
|
+
|
|
|
``PERL_SITESEARCH``
|
|
|
Path to the sitesearch install directory (``-V:installsitesearch``).
|
|
|
``PERL_SITEARCH``
|
|
|
@@ -58,11 +73,18 @@ Finding Perl libraries and specifying the minimum required version:
|
|
|
.. code-block:: cmake
|
|
|
|
|
|
find_package(PerlLibs 6.0)
|
|
|
+
|
|
|
+See Also
|
|
|
+^^^^^^^^
|
|
|
+
|
|
|
+* The :module:`FindPerl` module to find the Perl interpreter.
|
|
|
#]=======================================================================]
|
|
|
|
|
|
# find the perl executable
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPerl.cmake)
|
|
|
|
|
|
+set(PerlLibs_VERSION "${Perl_VERSION}")
|
|
|
+
|
|
|
if (PERL_EXECUTABLE)
|
|
|
|
|
|
function (perl_get_info _pgi_info tag)
|
|
|
@@ -122,10 +144,10 @@ if (PERL_EXECUTABLE)
|
|
|
### PERL_POSSIBLE_LIBRARY_NAMES
|
|
|
perl_get_info(PERL_POSSIBLE_LIBRARY_NAMES libperl)
|
|
|
if (NOT PERL_POSSIBLE_LIBRARY_NAMES)
|
|
|
- set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
|
|
|
+ set(PERL_POSSIBLE_LIBRARY_NAMES perl${PerlLibs_VERSION} perl)
|
|
|
endif()
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
|
|
|
- list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING})
|
|
|
+ list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl${PerlLibs_VERSION})
|
|
|
endif()
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "MSYS|CYGWIN")
|
|
|
# On MSYS and CYGWIN environments, current perl -V:libperl gives shared
|
|
|
@@ -141,10 +163,10 @@ if (PERL_EXECUTABLE)
|
|
|
PATHS
|
|
|
"${PERL_UPDATE_ARCHLIB}/CORE"
|
|
|
"${PERL_ARCHLIB}/CORE"
|
|
|
- /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
|
|
|
- /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
|
|
|
- /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
|
|
|
- /usr/lib/perl/${PERL_VERSION_STRING}/CORE
|
|
|
+ /usr/lib/perl5/${PerlLibs_VERSION}/${PERL_ARCHNAME}/CORE
|
|
|
+ /usr/lib/perl/${PerlLibs_VERSION}/${PERL_ARCHNAME}/CORE
|
|
|
+ /usr/lib/perl5/${PerlLibs_VERSION}/CORE
|
|
|
+ /usr/lib/perl/${PerlLibs_VERSION}/CORE
|
|
|
)
|
|
|
|
|
|
### PERL_LIBRARY
|
|
|
@@ -154,24 +176,24 @@ if (PERL_EXECUTABLE)
|
|
|
PATHS
|
|
|
"${PERL_UPDATE_ARCHLIB}/CORE"
|
|
|
"${PERL_ARCHLIB}/CORE"
|
|
|
- /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
|
|
|
- /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
|
|
|
- /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
|
|
|
- /usr/lib/perl/${PERL_VERSION_STRING}/CORE
|
|
|
+ /usr/lib/perl5/${PerlLibs_VERSION}/${PERL_ARCHNAME}/CORE
|
|
|
+ /usr/lib/perl/${PerlLibs_VERSION}/${PERL_ARCHNAME}/CORE
|
|
|
+ /usr/lib/perl5/${PerlLibs_VERSION}/CORE
|
|
|
+ /usr/lib/perl/${PerlLibs_VERSION}/CORE
|
|
|
)
|
|
|
|
|
|
endif ()
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
|
|
|
- VERSION_VAR PERL_VERSION_STRING)
|
|
|
+ VERSION_VAR PerlLibs_VERSION)
|
|
|
|
|
|
# Introduced after CMake 2.6.4 to bring module into compliance
|
|
|
set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH})
|
|
|
set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH})
|
|
|
set(PERL_LIBRARIES ${PERL_LIBRARY})
|
|
|
# For backward compatibility with CMake before 2.8.8
|
|
|
-set(PERL_VERSION ${PERL_VERSION_STRING})
|
|
|
+set(PERL_VERSION ${PerlLibs_VERSION})
|
|
|
|
|
|
mark_as_advanced(
|
|
|
PERL_INCLUDE_PATH
|