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(DetrayPythonBindings src/CoreModuleEntry.cpp)
0014
0015 target_link_libraries(
0016 DetrayPythonBindings
0017 PRIVATE
0018 detray::core_array
0019 detray::io
0020 detray::detectors
0021 vecmem::core
0022 covfie::core
0023 )
0024
0025 # Place the compiled module inside the `detray.core` package.
0026 set_target_properties(
0027 DetrayPythonBindings
0028 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_pkg_dir}
0029 )
0030 install(
0031 TARGETS DetrayPythonBindings
0032 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/core
0033 )
0034
0035 # Generate the package __init__ that re-exports the compiled module.
0036 set(BINDINGS_MODULE DetrayPythonBindings)
0037 configure_file(
0038 ${CMAKE_CURRENT_SOURCE_DIR}/../module_init.py.in
0039 ${_pkg_dir}/__init__.py
0040 @ONLY
0041 )
0042 install(
0043 FILES ${_pkg_dir}/__init__.py
0044 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/core
0045 )
0046
0047 acts_pybind_generate_stubs(detray.core DetrayPythonBindings)