blob: f460c88415770326388d31e4971c611353efe597 (
plain)
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
49
50
51
|
#####################
## CMakeLists.txt
## Top contributors (to current version):
## Andres Noetzli
## This file is part of the CVC4 project.
## Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
## in the top-level source directory and their institutional affiliations.
## All rights reserved. See the file COPYING in the top-level source
## directory for licensing information.
##
set(EXAMPLES_API_PYTHON
bitvectors_and_arrays
bitvectors
combination
datatypes
exceptions
extract
floating_point
helloworld
linear_arith
sequences
sets
strings
sygus-fun
sygus-grammar
sygus-inv
)
find_package(PythonInterp ${CVC5_BINDINGS_PYTHON_VERSION} REQUIRED)
# Find Python bindings in the corresponding python-*/site-packages directory.
# Lookup Python module directory and store path in PYTHON_MODULE_PATH.
execute_process(COMMAND
${PYTHON_EXECUTABLE} -c
"from distutils.sysconfig import get_python_lib;\
print(get_python_lib(plat_specific=True,\
prefix='${CMAKE_PREFIX_PATH}/../..'))"
OUTPUT_VARIABLE PYTHON_MODULE_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
foreach(example ${EXAMPLES_API_PYTHON})
set(example_test example/api/python/${example})
add_test(
NAME ${example_test}
COMMAND
"${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/api/python/${example}.py"
)
set_tests_properties(${example_test} PROPERTIES
LABELS "example"
ENVIRONMENT PYTHONPATH=${PYTHON_MODULE_PATH})
endforeach()
|