1 ############################################################################## 3 # @brief Find Perl interpreter. 5 # @par Output variables: 8 # @tp @b Perl_FOUND @endtp 9 # <td>Was the Python executable found.</td> 12 # @tp @b PERL_FOUND @endtp 13 # <td>Alias for @b Perl_FOUND for backwards compatibility.</td> 16 # @tp @b PERL_EXECUTABLE @endtp 17 # <td>Path to the Perl interpreter.</td> 20 # @tp @b Perl_DIR @endtp 21 # <td>Installation prefix of the Perl interpreter.</td> 24 # @tp @b PERL_VERSION_STRING @endtp 25 # <td>Perl version found e.g. 5.12.4.</td> 28 # @tp @b PERL_VERSION_MAJOR @endtp 29 # <td>Perl major version found e.g. 5.</td> 32 # @tp @b PERL_VERSION_MINOR @endtp 33 # <td>Perl minor version found e.g. 12.</td> 36 # @tp @b PERL_VERSION_PATCH @endtp 37 # <td>Perl patch version found e.g. 4.</td> 41 # @note This module has been copied from CMake 2.8.5 and modified to also 42 # obtain the version information of the found Perl interpreter. 44 # @ingroup CMakeFindModules 45 ############################################################################## 47 #============================================================================= 48 # Copyright 2001-2009 Kitware, Inc. 50 # Distributed under the OSI-approved BSD License (the "License"); 51 # see accompanying file Copyright.txt for details. 53 # This software is distributed WITHOUT ANY WARRANTY; without even the 54 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 55 # See the License for more information. 56 #============================================================================= 57 # (To distribute this file outside of CMake, substitute the full 58 # License text for the above reference.) 60 include (
"${CMAKE_ROOT}/Modules/FindCygwin.cmake")
64 get_filename_component ( 65 ActivePerl_CurrentVersion 66 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]
" 69 set (PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS} 71 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
" 73 unset (ActivePerl_CurrentVersion) 76 find_program (PERL_EXECUTABLE NAMES perl PATHS ${PERL_POSSIBLE_BIN_PATHS}) 77 unset (PERL_POSSIBLE_BIN_PATHS) 80 string (REGEX REPLACE "/bin/[pP]erl[^/]*
" "" Perl_DIR "${PERL_EXECUTABLE}
") 81 execute_process (COMMAND "${PERL_EXECUTABLE}
" --version OUTPUT_VARIABLE _Perl_STDOUT ERROR_VARIABLE _Perl_STDERR) 82 if (_Perl_STDOUT MATCHES "[( ]v([0-9]+)\\.([0-9]+)\\.([0-9]+)[ )]
") 83 set (PERL_VERSION_MAJOR "${CMAKE_MATCH_1}
") 84 set (PERL_VERSION_MINOR "${CMAKE_MATCH_2}
") 85 set (PERL_VERSION_PATCH "${CMAKE_MATCH_3}
") 88 message (WARNING "Failed to determine version of Perl interpreter (${PERL_EXECUTABLE})! Error:\n${_Perl_STDERR}
") 94 include (FindPackageHandleStandardArgs) 96 find_package_handle_standard_args ( 104 if (NOT DEFINED Perl_FOUND AND DEFINED PERL_FOUND) 105 set (Perl_FOUND "${PERL_FOUND}
") 108 mark_as_advanced (PERL_EXECUTABLE)
cmake PERL_POSSIBLE_BIN_PATHS