Warning, /acts/Detray/python/core/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008
0009 set(_python_dir "${CMAKE_BINARY_DIR}/python")
0010 set(_pkg_dir ${_python_dir}/detray/core)
0011 file(MAKE_DIRECTORY ${_pkg_dir})
0012
0013 pybind11_add_module(detray_core_python_bindings src/core_module_entry.cpp)
0014
0015 target_link_libraries(
0016 detray_core_python_bindings
0017 PRIVATE detray::core_array detray::detectors vecmem::core
0018 )
0019
0020 # Place the compiled module inside the `detray.core` package.
0021 set_target_properties(
0022 detray_core_python_bindings
0023 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_pkg_dir}
0024 )
0025 install(
0026 TARGETS detray_core_python_bindings
0027 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/core
0028 )
0029
0030 # Generate the package __init__ that re-exports the compiled module.
0031 set(BINDINGS_MODULE detray_core_python_bindings)
0032 configure_file(
0033 ${CMAKE_CURRENT_SOURCE_DIR}/../module_init.py.in
0034 ${_pkg_dir}/__init__.py
0035 @ONLY
0036 )
0037 install(
0038 FILES ${_pkg_dir}/__init__.py
0039 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/core
0040 )
0041
0042 acts_pybind_generate_stubs(detray.core detray_core_python_bindings)