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(DetraySvgtoolsPythonBindings src/Svgtools.cpp)
0023
0024 target_link_libraries(
0025 DetraySvgtoolsPythonBindings
0026 PRIVATE
0027 detray::core_array
0028 detray::io
0029 detray::detectors
0030 detray::svgtools
0031 vecmem::core
0032 )
0033
0034 # Place the compiled module inside the `detray.svgtools` package.
0035 set_target_properties(
0036 DetraySvgtoolsPythonBindings
0037 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_pkg_dir}
0038 )
0039 install(
0040 TARGETS DetraySvgtoolsPythonBindings
0041 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/svgtools
0042 )
0043
0044 # Generate the package __init__ that re-exports the compiled module.
0045 set(BINDINGS_MODULE DetraySvgtoolsPythonBindings)
0046 configure_file(
0047 ${CMAKE_CURRENT_SOURCE_DIR}/module_init.py.in
0048 ${_pkg_dir}/__init__.py
0049 @ONLY
0050 )
0051 install(
0052 FILES ${_pkg_dir}/__init__.py
0053 DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/svgtools
0054 )
0055
0056 acts_pybind_generate_stubs(detray.svgtools DetraySvgtoolsPythonBindings)