Updated formatting of documentation plus a little reorganization.
[cmake.git] / Modules / FindPerl.cmake
blobb3c5e4feb968f89cd88ca5665d3627fbbfe83417
1 # - Find perl
2 # this module looks for Perl
4 #  PERL_EXECUTABLE - the full path to perl
5 #  PERL_FOUND      - If false, don't attempt to use perl.
7 INCLUDE(FindCygwin)
9 SET(PERL_POSSIBLE_BIN_PATHS
10   ${CYGWIN_INSTALL_PATH}/bin
11   )
13 IF(WIN32)
14   GET_FILENAME_COMPONENT(
15     ActivePerl_CurrentVersion 
16     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]" 
17     NAME)
18   SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
19     "C:/Perl/bin" 
20     [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
21     )
22 ENDIF(WIN32)
24 FIND_PROGRAM(PERL_EXECUTABLE
25   NAMES perl
26   PATHS ${PERL_POSSIBLE_BIN_PATHS}
27   )
29 # Deprecated settings for compatibility with CMake1.4
30 SET(PERL ${PERL_EXECUTABLE})
32 # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if 
33 # all listed variables are TRUE
34 INCLUDE(FindPackageHandleStandardArgs)
35 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE)
37 MARK_AS_ADVANCED(PERL_EXECUTABLE)