~ubuntu-branches/ubuntu/trusty/avogadro/trusty-proposed

« back to all changes in this revision

Viewing changes to cmake/modules/PythonDeps.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg
  • Date: 2011-05-20 18:55:49 UTC
  • mfrom: (3.2.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110520185549-berzu8h9f9330xji
Tags: 1.0.3-1ubuntu1
* Merge from debian, remaining changes (LP: #787458, #784267)
  - Disable builds for ARM as build dependency on libOpenGL and 
    libQtOpenGL

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
if(Boost_PYTHON_FOUND AND PYTHONLIBS_FOUND AND NUMPY_FOUND)
6
6
  # In cache already
7
 
  set(ALL_PYTHON_FOUND TRUE CACHE BOOL "True if all Python dependencies satisfied.")
8
 
 
9
 
else(Boost_PYTHON_FOUND AND PYTHONLIBS_FOUND AND NUMPY_FOUND)
10
 
 
 
7
  set(ALL_PYTHON_FOUND TRUE)
 
8
 
 
9
else()
11
10
  message(STATUS "Searching for python dependencies...")
12
11
 
13
12
  # Boost Python
14
13
  message(STATUS "[1/5] Boost Python")
15
14
  # CMake's new FindBoost has an option to look for additional versions
16
 
  set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0" "1.39" "1.39.0" "1.38" "1.38.0" "1.37" "1.37.0")
 
15
  set(Boost_ADDITIONAL_VERSIONS "1.45" "1.44" "1.43" "1.42" "1.41" "1.40"
 
16
    "1.40.0" "1.39" "1.39.0" "1.38" "1.38.0" "1.37" "1.37.0")
17
17
  find_package(Boost COMPONENTS python)
18
18
  if (Boost_PYTHON_FOUND)
19
19
    message(STATUS "Boost Python found...")
20
 
  else (Boost_PYTHON_FOUND)
 
20
  else()
21
21
    message(STATUS "Boost Python NOT found - Python support disabled.")
22
22
  #  message(STATUS "debian/ubuntu: install the libboost-python-dev package.")
23
 
    set(ALL_PYTHON_FOUND FALSE CACHE BOOL "True if all Python dependencies satisfied.")
 
23
    set(ALL_PYTHON_FOUND FALSE)
24
24
    return()
25
 
  endif (Boost_PYTHON_FOUND)
 
25
  endif()
26
26
 
27
27
  # Python Libraries
28
28
  message(STATUS "[2/5] Python Libraries")
30
30
  if (NOT PYTHONLIBS_FOUND)
31
31
    message(STATUS "Python libraries NOT found - Python support disabled.")
32
32
  #  message(STATUS "debian/ubuntu: install the python-dev package. Correct?????")
33
 
    set(ALL_PYTHON_FOUND FALSE CACHE BOOL "True if all Python dependencies satisfied.")
 
33
    set(ALL_PYTHON_FOUND FALSE)
34
34
    return()
35
 
  endif (NOT PYTHONLIBS_FOUND)
 
35
  endif()
36
36
 
37
37
  # Python Interpreter
38
38
  message(STATUS "[3/5] Python Interpreter")
40
40
  if (NOT PYTHONINTERP_FOUND)
41
41
    message(STATUS "Python interpreter NOT found - Python support disabled.")
42
42
  #  message(STATUS "debian/ubuntu: install the python package.")
43
 
    set(ALL_PYTHON_FOUND FALSE CACHE BOOL "True if all Python dependencies satisfied.")
 
43
    set(ALL_PYTHON_FOUND FALSE)
44
44
    return()
45
 
  endif (NOT PYTHONINTERP_FOUND)
 
45
  endif()
46
46
 
47
47
  # Numpy
48
48
  message(STATUS "[4/5] Numpy Module")
50
50
  if (NOT NUMPY_FOUND)
51
51
    message(STATUS "Numpy NOT found - Python support disabled.")
52
52
  #  message(STATUS "debian/ubuntu: install the python-numpy package.")
53
 
    set(ALL_PYTHON_FOUND FALSE CACHE BOOL "True if all Python dependencies satisfied.")
 
53
    set(ALL_PYTHON_FOUND FALSE)
54
54
    return()
55
 
  endif (NOT NUMPY_FOUND)
 
55
  endif()
56
56
 
57
57
  # SIP
58
58
  message(STATUS "[5/5] SIP Module")
59
59
  if (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
60
60
    message(STATUS "Found sip.h header...")
61
 
    execute_process(COMMAND sip -V OUTPUT_VARIABLE SIP_VERSION)
62
 
    if (${SIP_VERSION} VERSION_GREATER "4.8")
63
 
      message(STATUS "using sip version 4.8 or above...")
64
 
      add_definitions( -DSIP_4_8 )
65
 
    endif (${SIP_VERSION} VERSION_GREATER "4.8")
66
 
  else (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
 
61
  else ()
67
62
    message(STATUS "sip.h header NOT found - Python support disabled")
68
63
  #  message(STATUS "debian/ubuntu: install the python-sip4-dev package.")
69
 
    set(ALL_PYTHON_FOUND FALSE CACHE BOOL "True if all Python dependencies satisfied.")
 
64
    set(ALL_PYTHON_FOUND FALSE)
70
65
    return()
71
 
  endif (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
 
66
  endif()
72
67
 
73
68
  # Everything was found, define ENABLE_PYTHON. This can be used in code:
74
69
  #
77
72
  # #endif
78
73
  add_definitions( -DENABLE_PYTHON )
79
74
  # to be used in subdir CMakeLists.txt files
80
 
  set(ALL_PYTHON_FOUND TRUE CACHE BOOL "True if all Python dependencies satisfied.")
81
 
 
82
 
endif(Boost_PYTHON_FOUND AND PYTHONLIBS_FOUND AND NUMPY_FOUND)
83
 
 
84
 
mark_as_advanced(ALL_PYTHON_FOUND)
 
75
  set(ALL_PYTHON_FOUND TRUE)
 
76
 
 
77
endif()