Skip to content

[build] Remove hsimple tutorial from main CMake build #15930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 5 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,11 @@ endif()
file(GLOB_RECURSE artifact_files RELATIVE ${CMAKE_SOURCE_DIR} tutorials/* etc/* test/* icons/* fonts/* macros/* ${jsroot_files} ${openui5_files})
set(artifact_files_builddir)
foreach(artifact_file ${artifact_files})
# Filter out hsimple.root; someone might have created it in the src dir, and the hsimple.root
# target below will interfere.
if (NOT (artifact_file STREQUAL "tutorials/hsimple.root"))
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${artifact_file}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/${artifact_file} ${CMAKE_BINARY_DIR}/${artifact_file}
COMMENT "Copying ${CMAKE_SOURCE_DIR}/${artifact_file}"
DEPENDS ${CMAKE_SOURCE_DIR}/${artifact_file})
list(APPEND artifact_files_builddir ${CMAKE_BINARY_DIR}/${artifact_file})
endif()
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${artifact_file}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/${artifact_file} ${CMAKE_BINARY_DIR}/${artifact_file}
COMMENT "Copying ${CMAKE_SOURCE_DIR}/${artifact_file}"
DEPENDS ${CMAKE_SOURCE_DIR}/${artifact_file})
list(APPEND artifact_files_builddir ${CMAKE_BINARY_DIR}/${artifact_file})
endforeach()
add_custom_target(move_artifacts DEPENDS ${stamp_file} ${artifact_files_builddir})

Expand Down Expand Up @@ -599,26 +595,6 @@ if(runtime_cxxmodules)
set_directory_properties(PROPERTIES ADDITIONAL_CLEAN_FILES "${library_output_dir}/modules.timestamp")
endif()

#---hsimple.root---------(use the executable for clearer dependencies and proper return code)---
add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root)
add_dependencies(hsimple onepcm)
if(WIN32)
set(hsimple_cmd COMMAND ${CMAKE_COMMAND} -E env PATH="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\\\;%PATH%"
ROOTIGNOREPREFIX=1 ROOT_HIST=0 $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return)
else()
set(hsimple_cmd COMMAND ${MODULES_ROOT_INCPATH} ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}}
ROOTIGNOREPREFIX=1 ROOT_HIST=0 $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return)
endif()
add_custom_command(OUTPUT tutorials/hsimple.root
${hsimple_cmd}
WORKING_DIRECTORY tutorials
DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts)
install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)

if(runtime_cxxmodules)
add_dependencies(hsimple modules_idx)
endif()

#---version--------------------------------------------------------------------------------------
if(NOT WIN32)
add_custom_target(version COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/unix/makeversion.py
Expand Down
3 changes: 3 additions & 0 deletions tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -894,3 +894,6 @@ if(ROOT_pyroot_FOUND)

endforeach()
endif()

# Copy hsimple.root over to build directory as it may be needed by tutorials or other tests
configure_file(hsimple.root ${CMAKE_BINARY_DIR}/tutorials/hsimple.root COPYONLY)
Binary file added tutorials/hsimple.root
Binary file not shown.
Loading