3
3
# include files and libraries are. It also determines what the name of
4
4
# the library is. This code sets the following variables:
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
6
# PYTHON_LIBRARIES = the full path to the library found
7
# PYTHON_INCLUDE_PATH = the path to where Python.h can be found
8
# PYTHON_DEBUG_LIBRARIES = the full path to the debug library found
11
INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
12
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
13
NAMES python python21_d python20_d
14
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
15
NAMES python23_d python22_d python21_d python20_d python
17
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs/Debug
18
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs
19
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs/Debug
20
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs
15
21
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs/Debug
22
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
16
23
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs/Debug
17
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
18
24
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs
25
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/libs/Debug
26
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/libs
27
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/libs/Debug
28
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/libs
22
FIND_LIBRARY(PYTHON_LIBRARY
23
NAMES python python21 python2.1 python20 python2.0
32
FIND_LIBRARY(PYTHON_LIBRARY
33
NAMES python23 python2.3 python2.3.dll
34
python22 python2.2 python2.2.dll
35
python21 python2.1 python2.1.dll
36
python20 python2.0 python2.0.dll
37
python16 python1.6 python1.6.dll
38
python15 python1.5 python1.5.dll
26
/usr/lib/python1.5/config
40
/usr/lib/python2.3/config
41
/usr/lib/python2.2/config
27
42
/usr/lib/python2.1/config
28
43
/usr/lib/python2.0/config
44
/usr/lib/python1.6/config
45
/usr/lib/python1.5/config
48
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs
49
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs
30
50
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
31
51
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs
52
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/libs
53
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/libs
56
# Search for the python framework on Apple.
57
CMAKE_FIND_FRAMEWORKS(Python)
58
SET(PYTHON_FRAMEWORK_INCLUDES)
60
IF(NOT PYTHON_INCLUDE_PATH)
61
FOREACH(version 2.3 2.2 2.1 2.0 1.6 1.5)
62
FOREACH(dir ${Python_FRAMEWORKS})
63
SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
64
${dir}/Versions/${version}/include/python${version})
67
ENDIF(NOT PYTHON_INCLUDE_PATH)
68
ENDIF(Python_FRAMEWORKS)
34
70
FIND_PATH(PYTHON_INCLUDE_PATH Python.h
36
/usr/include/python1.5
71
${PYTHON_FRAMEWORK_INCLUDES}
72
/usr/include/python2.3
73
/usr/include/python2.2
37
74
/usr/include/python2.1
38
75
/usr/include/python2.0
76
/usr/include/python1.6
77
/usr/include/python1.5
80
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/include
81
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/include
40
82
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/include
41
83
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/include
84
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/include
85
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/include
48
92
PYTHON_INCLUDE_PATH
96
# Python Should be built and installed as a Framework on OSX
98
# If a framework has been selected for the include path,
99
# make sure "-framework" is used to link it.
100
IF("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
101
SET(PYTHON_LIBRARY "")
102
SET(PYTHON_DEBUG_LIBRARY "")
103
ENDIF("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
104
IF(NOT PYTHON_LIBRARY)
105
SET (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
106
ENDIF(NOT PYTHON_LIBRARY)
107
IF(NOT PYTHON_DEBUG_LIBRARY)
108
SET (PYTHON_DEBUG_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
109
ENDIF(NOT PYTHON_DEBUG_LIBRARY)
110
ENDIF(Python_FRAMEWORKS)
112
# We use PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the cache entries
113
# because they are meant to specify the location of a single library.
114
# We now set the variables listed by the documentation for this
116
SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
117
SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")