Warning, /acts/Detray/python/plugins/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/svgtools)
0011
0012 if(NOT TARGET detray::svgtools)
0013 message(
0014 STATUS
0015 "Skipping 'detray.svgtools' python module: 'detray::svgtools' not available"
0016 )
0017 return()
0018 endif()
0019
0020 file(MAKE_DIRECTORY ${_pkg_dir})
0021
0022 pybind11_add_module(detray_svgtools_python_bindings src/svgtools.cpp)
0023
0024 target_link_libraries(
0025 detray_svgtools_python_bindings
0026 PRIVATE detray::core_array detray::detectors detray::svgtools vecmem::core
0027 )
0028
0029 # Place the compiled module inside the `detray.svgtools` package.
0030 set_target_properties(
0031 detray_svgtools_python_bindings
0032 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_pkg_dir}
0033 )
0034 install(
0035 TARGETS detray_svgtools_python_bindings
0036 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/svgtools
0037 )
0038
0039 # Generate the package __init__ that re-exports the compiled module.
0040 set(BINDINGS_MODULE detray_svgtools_python_bindings)
0041 configure_file(
0042 ${CMAKE_CURRENT_SOURCE_DIR}/module_init.py.in
0043 ${_pkg_dir}/__init__.py
0044 @ONLY
0045 )
0046 install(
0047 FILES ${_pkg_dir}/__init__.py
0048 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/svgtools
0049 )
0050
0051 acts_pybind_generate_stubs(detray.svgtools detray_svgtools_python_bindings)