Warning, /acts/Detray/python/Io/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/io)
0011 file(MAKE_DIRECTORY ${_pkg_dir})
0012
0013 pybind11_add_module(DetrayIoPythonBindings src/IoModuleEntry.cpp)
0014
0015 target_link_libraries(
0016 DetrayIoPythonBindings
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.io` package.
0026 set_target_properties(
0027 DetrayIoPythonBindings
0028 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_pkg_dir}
0029 )
0030 install(
0031 TARGETS DetrayIoPythonBindings
0032 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/io
0033 )
0034
0035 # Generate the package __init__ that re-exports the compiled module.
0036 set(BINDINGS_MODULE DetrayIoPythonBindings)
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}/io
0045 )
0046
0047 acts_pybind_generate_stubs(detray.io DetrayIoPythonBindings)