Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /acts/Python/Core/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # Configure setup and install python files
0002 set(_python_dir "${CMAKE_BINARY_DIR}/python")
0003 file(MAKE_DIRECTORY ${_python_dir})
0004 file(MAKE_DIRECTORY ${_python_dir}/acts)
0005 
0006 set(py_files __init__.py _adapter.py)
0007 
0008 pybind11_add_module(ActsPythonBindings src/CoreModuleEntry.cpp)
0009 
0010 target_sources(
0011     ActsPythonBindings
0012     PRIVATE
0013         src/Definitions.cpp
0014         src/Utilities.cpp
0015         src/MagneticField.cpp
0016         src/Material.cpp
0017         src/Surfaces.cpp
0018         src/Geometry.cpp
0019         src/GeometryGen1.cpp
0020         src/GeometryGen3.cpp
0021         src/Navigation.cpp
0022         src/Propagation.cpp
0023         src/Seeding.cpp
0024         src/TrackFinding.cpp
0025         src/Visualization.cpp
0026 )
0027 
0028 # Add ToroidalField Python binding as a separate module if Examples are enabled
0029 if(ACTS_BUILD_EXAMPLES)
0030     pybind11_add_module(acts_toroidal_field
0031         ${CMAKE_SOURCE_DIR}/Examples/Detectors/MagneticField/src/ToroidalFieldBindings.cpp
0032     )
0033     target_link_libraries(
0034         acts_toroidal_field
0035         PUBLIC ActsExamplesMagneticField Acts::Core
0036     )
0037     target_include_directories(
0038         acts_toroidal_field
0039         PRIVATE ${CMAKE_SOURCE_DIR}/Examples/Detectors/MagneticField/include
0040     )
0041     set_target_properties(
0042         acts_toroidal_field
0043         PROPERTIES
0044             LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0045             INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0046     )
0047     install(TARGETS acts_toroidal_field DESTINATION ${ACTS_PYTHON_INSTALL_DIR})
0048 endif()
0049 
0050 install(TARGETS ActsPythonBindings DESTINATION ${ACTS_PYTHON_INSTALL_DIR})
0051 
0052 set_target_properties(
0053     ActsPythonBindings
0054     PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0055 )
0056 set_target_properties(
0057     ActsPythonBindings
0058     PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0059 )
0060 
0061 target_link_libraries(
0062     ActsPythonBindings
0063     PUBLIC Acts::Core Acts::PythonUtilities
0064 )
0065 
0066 configure_file(setup.sh.in ${_python_dir}/setup.sh @ONLY)
0067 install(FILES ${_python_dir}/setup.sh DESTINATION ${ACTS_PYTHON_INSTALL_DIR})
0068 
0069 foreach(f ${py_files})
0070     set(_target ${_python_dir}/acts/${f})
0071     get_filename_component(_dir ${_target} DIRECTORY)
0072     file(MAKE_DIRECTORY ${_dir})
0073 
0074     file(
0075         CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/python/${f} ${_target}
0076         SYMBOLIC
0077     )
0078 
0079     get_filename_component(_rel ${f} DIRECTORY)
0080 
0081     install(
0082         FILES ${CMAKE_CURRENT_SOURCE_DIR}/python/${f}
0083         DESTINATION ${ACTS_PYTHON_INSTALL_DIR}/${_rel}
0084     )
0085 endforeach()