Skip to content

Commit a2541da

Browse files
committed
1 parent 4831779 commit a2541da

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

CMakeLists.txt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -581,22 +581,25 @@ endif()
581581
ROOT_ADD_TEST_SUBDIRECTORY(tutorials)
582582

583583
#---hsimple.root---------(use the executable for clearer dependencies and proper return code)---
584-
add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root)
585-
add_dependencies(hsimple onepcm)
586-
add_custom_command(OUTPUT tutorials/hsimple.root
587-
VERBATIM
588-
COMMAND
589-
${CMAKE_COMMAND} -E env
590-
ROOT_INCLUDE_PATH=${DEFAULT_ROOT_INCLUDE_PATH}
591-
ROOTIGNOREPREFIX=1
592-
ROOT_HIST=0
593-
$<TARGET_FILE:root.exe> -q -b -n
594-
-e ".L ${CMAKE_SOURCE_DIR}/tutorials/hsimple.C"
595-
-e "hsimple();"
596-
-e return
597-
WORKING_DIRECTORY tutorials
598-
DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts)
599-
install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
584+
# We can't build hsimple when cross compiling
585+
if(NOT CMAKE_CROSSCOMPILING)
586+
add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root)
587+
add_dependencies(hsimple onepcm)
588+
add_custom_command(OUTPUT tutorials/hsimple.root
589+
VERBATIM
590+
COMMAND
591+
${CMAKE_COMMAND} -E env
592+
ROOT_INCLUDE_PATH=${DEFAULT_ROOT_INCLUDE_PATH}
593+
ROOTIGNOREPREFIX=1
594+
ROOT_HIST=0
595+
$<TARGET_FILE:root.exe> -q -b -n
596+
-e ".L ${CMAKE_SOURCE_DIR}/tutorials/hsimple.C"
597+
-e "hsimple();"
598+
-e return
599+
WORKING_DIRECTORY tutorials
600+
DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts)
601+
install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
602+
endif()
600603

601604
if(runtime_cxxmodules)
602605
add_dependencies(hsimple modules_idx)

0 commit comments

Comments
 (0)