File: python_dependencies.cmake

package info (click to toggle)
sopt 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,932 kB
  • ctags: 1,162
  • sloc: cpp: 7,220; php: 287; python: 57; ansic: 33; makefile: 5
file content (48 lines) | stat: -rw-r--r-- 1,742 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Scripts to run purify from build directory. Good for testing/debuggin.
include(EnvironmentScript)
# Function to install python files in python path ${PYTHON_PKG_DIR}
include(PythonInstall)
# Ability to find installed python packages
include(PythonPackage)
# Installs python packages that are missing.
# We choose to do this only for packages that are required to build purify.
# Leave it to the user to install packages that are needed for running
# purify.
include(PythonPackageLookup)
# Creates script for running python with the bempp package available
# Also makes python packages and selected directories available to the
# build system
add_to_python_path("${PROJECT_BINARY_DIR}/python")
add_to_python_path("${EXTERNAL_ROOT}/python")
add_python_eggs("${PROJECT_SOURCE_DIR}"
    EXCLUDE
        "${PROJECT_SOURCE_DIR}/purify*egg"
        "${PROJECT_BINARY_DIR}/Purify*egg"
)
set(LOCAL_PYTHON_EXECUTABLE "${PROJECT_BINARY_DIR}/localpython.sh")
create_environment_script(
    EXECUTABLE "${PYTHON_EXECUTABLE}"
    PATH "${LOCAL_PYTHON_EXECUTABLE}"
    PYTHON
)
# Python interpreter + libraries
find_package(CoherentPython)
# Only required for building
if(NOT cython_EXECUTABLE)
    lookup_python_package(Cython REQUIRED PATH "${EXTERNAL_ROOT}/python")
endif()
# Also required for production
find_python_package(numpy)
find_python_package(scipy)
# Finds additional info, like libraries, include dirs...
# no need check numpy features, it's all handled by cython.
set(no_numpy_feature_tests TRUE)
find_package(Numpy REQUIRED)

if(tests)
    include(AddPyTest)
    setup_pytest("${EXTERNAL_ROOT}/python" "${PROJECT_BINARY_DIR}/py.test.sh")

    lookup_python_package(pywt PIPNAME PyWavelets REQUIRED PATH "${EXTERNAL_ROOT}/python")
endif()