FindPythonLibs.cmake 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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
  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/local/lib
  28. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
  29. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs
  30. )
  31. FIND_PATH(PYTHON_INCLUDE_PATH Python.h
  32. /usr/include
  33. /usr/include/python1.5
  34. /usr/include/python2.1
  35. /usr/include/python2.0
  36. /usr/local/include
  37. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/include
  38. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/include
  39. )
  40. IF (WIN32)
  41. MARK_AS_ADVANCED(
  42. PYTHON_DEBUG_LIBRARY
  43. PYTHON_LIBRARY
  44. PYTHON_INCLUDE_PATH
  45. )
  46. ENDIF(WIN32)