Skip to content

Commit 54771c4

Browse files
committed
[pyroot] Move JupyROOT files at build time.
Fix #17859.
1 parent 58192ab commit 54771c4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bindings/jupyroot/CMakeLists.txt

+11-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ set(py_sources
2727
JupyROOT/magics/jsrootmagic.py
2828
)
2929

30-
set(JupyROOTPySrcDir python/JupyROOT)
31-
file(COPY ${JupyROOTPySrcDir} DESTINATION ${localruntimedir})
30+
# Create a target that keeps JupyROOT source in the build tree up to date:
31+
set(JupyROOTPySrcDir ${CMAKE_CURRENT_SOURCE_DIR}/python/JupyROOT/)
32+
file(GLOB_RECURSE input_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${JupyROOTPySrcDir}/**)
33+
set(output_files ${input_files})
34+
list(TRANSFORM output_files REPLACE "python/" ${localruntimedir}/)
35+
36+
add_custom_command(OUTPUT ${output_files}
37+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${JupyROOTPySrcDir} ${localruntimedir}/JupyROOT/
38+
COMMENT "Copy JupyROOT"
39+
DEPENDS ${input_files})
40+
add_custom_target(JupyROOT ALL DEPENDS ${output_files})
3241

3342
# Compile .py files
3443
foreach(py_source ${py_sources})

0 commit comments

Comments
 (0)