FindPythonLibs.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # This module finds if Python is installed and determines where the
  3. # include files and libraries are. It also determines what the name of
  4. # the library is. This code sets the following variables:
  5. #
  6. # PYTHON_LIBRARY = the full path to the library found
  7. # PYTHON_INCLUDE_PATH = the path to where tcl.h can be found
  8. # PYTHON_DEBUG_LIBRARY = the full path to the debug library found
  9. #
  10. IF(WIN32)
  11. FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
  12. NAMES python python21_d python20_d
  13. PATHS
  14. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs/Debug
  15. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs/Debug
  16. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
  17. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs
  18. )
  19. ENDIF(WIN32)
  20. FIND_LIBRARY(PYTHON_LIBRARY
  21. NAMES python python21 python2.1 python20 python2.0 python1.5 python15 python22 python2.2
  22. PATHS
  23. /usr/lib
  24. /usr/lib/python1.5/config
  25. /usr/lib/python2.1/config
  26. /usr/lib/python2.0/config
  27. /usr/lib/python2.2/config
  28. /usr/local/lib
  29. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
  30. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs
  31. )
  32. FIND_PATH(PYTHON_INCLUDE_PATH Python.h
  33. /usr/include
  34. /usr/include/python1.5
  35. /usr/include/python2.1
  36. /usr/include/python2.0
  37. /usr/include/python2.2
  38. /usr/local/include
  39. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/include
  40. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/include
  41. )
  42. IF (WIN32)
  43. MARK_AS_ADVANCED(
  44. PYTHON_DEBUG_LIBRARY
  45. PYTHON_LIBRARY
  46. PYTHON_INCLUDE_PATH
  47. )
  48. ENDIF(WIN32)