Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Detray/python/Examples/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/examples)
0011 
0012 if(DETRAY_BUILD_TEST_UTILS)
0013     file(MAKE_DIRECTORY ${_pkg_dir})
0014 
0015     pybind11_add_module(DetrayExamplesPythonBindings src/ExamplesModuleEntry.cpp)
0016 
0017     target_link_libraries(
0018         DetrayExamplesPythonBindings
0019         PRIVATE
0020             detray::core_array
0021             detray::io
0022             detray::test_common
0023             detray::test_utils
0024     )
0025 
0026     # Place the compiled module inside the `detray.examples` package.
0027     set_target_properties(
0028         DetrayExamplesPythonBindings
0029         PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_pkg_dir}
0030     )
0031     install(
0032         TARGETS DetrayExamplesPythonBindings
0033         DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/examples
0034     )
0035 
0036     # Generate the package __init__ that re-exports the compiled module.
0037     set(BINDINGS_MODULE DetrayExamplesPythonBindings)
0038     configure_file(
0039         ${CMAKE_CURRENT_SOURCE_DIR}/../module_init.py.in
0040         ${_pkg_dir}/__init__.py
0041         @ONLY
0042     )
0043     install(
0044         FILES ${_pkg_dir}/__init__.py
0045         DESTINATION ${DETRAY_PYTHON_INSTALL_DIR}/examples
0046     )
0047 
0048     acts_pybind_generate_stubs(detray.examples DetrayExamplesPythonBindings)
0049 endif()