FindPerl.cmake 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # - Find perl
  2. # this module looks for Perl
  3. #
  4. # PERL_EXECUTABLE - the full path to perl
  5. # PERL_FOUND - If false, don't attempt to use perl.
  6. #=============================================================================
  7. # Copyright 2001-2009 Kitware, Inc.
  8. #
  9. # Distributed under the OSI-approved BSD License (the "License");
  10. # see accompanying file Copyright.txt for details.
  11. #
  12. # This software is distributed WITHOUT ANY WARRANTY; without even the
  13. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. # See the License for more information.
  15. #=============================================================================
  16. # (To distributed this file outside of CMake, substitute the full
  17. # License text for the above reference.)
  18. INCLUDE(FindCygwin)
  19. SET(PERL_POSSIBLE_BIN_PATHS
  20. ${CYGWIN_INSTALL_PATH}/bin
  21. )
  22. IF(WIN32)
  23. GET_FILENAME_COMPONENT(
  24. ActivePerl_CurrentVersion
  25. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]"
  26. NAME)
  27. SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
  28. "C:/Perl/bin"
  29. [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
  30. )
  31. ENDIF(WIN32)
  32. FIND_PROGRAM(PERL_EXECUTABLE
  33. NAMES perl
  34. PATHS ${PERL_POSSIBLE_BIN_PATHS}
  35. )
  36. # Deprecated settings for compatibility with CMake1.4
  37. SET(PERL ${PERL_EXECUTABLE})
  38. # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
  39. # all listed variables are TRUE
  40. INCLUDE(FindPackageHandleStandardArgs)
  41. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE)
  42. MARK_AS_ADVANCED(PERL_EXECUTABLE)