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