~ubuntu-branches/ubuntu/jaunty/cmake/jaunty-security

« back to all changes in this revision

Viewing changes to Modules/FindPythonLibs.cmake

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2005-03-02 09:22:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050302092244-y6o9j8wr27vqcqvx
Tags: 2.0.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
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:
5
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
 
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
9
9
#
10
10
 
 
11
INCLUDE(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
 
12
 
11
13
IF(WIN32)
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
14
16
    PATHS
 
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
19
29
  )
20
30
ENDIF(WIN32)
21
31
 
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
24
39
  PATHS
25
 
  /usr/lib
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
 
46
  /usr/lib
29
47
  /usr/local/lib
 
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
32
54
)
33
55
 
 
56
# Search for the python framework on Apple.
 
57
CMAKE_FIND_FRAMEWORKS(Python)
 
58
SET(PYTHON_FRAMEWORK_INCLUDES)
 
59
IF(Python_FRAMEWORKS)
 
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})
 
65
      ENDFOREACH(dir)
 
66
    ENDFOREACH(version)
 
67
  ENDIF(NOT PYTHON_INCLUDE_PATH)
 
68
ENDIF(Python_FRAMEWORKS)
 
69
 
34
70
FIND_PATH(PYTHON_INCLUDE_PATH Python.h
35
 
  /usr/include
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
 
78
  /usr/include
39
79
  /usr/local/include
 
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
42
86
)
43
87
 
44
88
IF (WIN32)
45
89
  MARK_AS_ADVANCED(
46
 
    PYTHON_DEBUG_LIBRARY 
47
 
    PYTHON_LIBRARY 
 
90
    PYTHON_DEBUG_LIBRARY
 
91
    PYTHON_LIBRARY
48
92
    PYTHON_INCLUDE_PATH
49
93
  )
50
94
ENDIF(WIN32)
 
95
 
 
96
# Python Should be built and installed as a Framework on OSX
 
97
IF(Python_FRAMEWORKS)
 
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)
 
111
 
 
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
 
115
# module.
 
116
SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
 
117
SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")