File: CMakeLists.txt

package info (click to toggle)
z3 4.13.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,364 kB
  • sloc: cpp: 501,803; python: 16,788; cs: 10,567; java: 9,687; ml: 3,282; ansic: 2,531; sh: 162; javascript: 37; makefile: 32
file content (34 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (3)
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
set(python_example_files
  all_interval_series.py
  complex/complex.py
  example.py
  hamiltonian/hamiltonian.py
  mus/marco.py
  mus/mss.py
  socrates.py
  visitor.py
)

set(z3py_bindings_build_dest "${PROJECT_BINARY_DIR}/python")

set(build_z3_python_examples_target_depends "")
foreach (example_file ${python_example_files})
  get_filename_component(example_file_name "${example_file}" NAME)
  add_custom_command(OUTPUT "${z3py_bindings_build_dest}/${example_file_name}"
    COMMAND "${CMAKE_COMMAND}" "-E" "copy"
      "${CMAKE_CURRENT_SOURCE_DIR}/${example_file}"
      # We flatten the hierarchy so that all python files have
      # the `z3` directory in their directory so that their import
      # statements "just work".
      "${z3py_bindings_build_dest}/${example_file_name}"
    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${example_file}"
    COMMENT "Copying \"${example_file}\" to ${z3py_bindings_build_dest}/${example_file_name}"
  )
  list(APPEND build_z3_python_examples_target_depends "${z3py_bindings_build_dest}/${example_file_name}")
endforeach()

add_custom_target(build_z3_python_examples
  ALL
  DEPENDS
    ${build_z3_python_examples_target_depends}
)