mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
Ensure that the 'OUTPUT' locations in CMake for Python examples is accurate (#4499)
Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
This commit is contained in:
parent
59e388ece1
commit
bb9cd5dd49
|
@ -13,17 +13,18 @@ set(z3py_bindings_build_dest "${PROJECT_BINARY_DIR}/python")
|
||||||
|
|
||||||
set(build_z3_python_examples_target_depends "")
|
set(build_z3_python_examples_target_depends "")
|
||||||
foreach (example_file ${python_example_files})
|
foreach (example_file ${python_example_files})
|
||||||
add_custom_command(OUTPUT "${z3py_bindings_build_dest}/${example_file}"
|
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"
|
COMMAND "${CMAKE_COMMAND}" "-E" "copy"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/${example_file}"
|
"${CMAKE_CURRENT_SOURCE_DIR}/${example_file}"
|
||||||
# We flatten the hierarchy so that all python files have
|
# We flatten the hierarchy so that all python files have
|
||||||
# the `z3` directory in their directory so that their import
|
# the `z3` directory in their directory so that their import
|
||||||
# statements "just work".
|
# statements "just work".
|
||||||
"${z3py_bindings_build_dest}/"
|
"${z3py_bindings_build_dest}/${example_file_name}"
|
||||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${example_file}"
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${example_file}"
|
||||||
COMMENT "Copying \"${example_file}\" to ${z3py_bindings_build_dest}/${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}")
|
list(APPEND build_z3_python_examples_target_depends "${z3py_bindings_build_dest}/${example_file_name}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(build_z3_python_examples
|
add_custom_target(build_z3_python_examples
|
||||||
|
|
Loading…
Reference in a new issue