Skip to content

Conversation

@guitargeek
Copy link
Contributor

As Sergey said in the comment in tutorials/CMakeLists.txt, this tutorials project stopped working standalone. But, it still uses find_package(ROOT) to find ROOT, even though it's not installed yet as we are building ROOT itself at the same time.

This should better not be done. This commit suggest to remove it, and also replaces the variables defined by find_package(ROOT) with the built time variables.

This follows up on 9d2dc6e c21bc3f, and 458803e, which did the same for the test/ and roottest/ subdirectories.

As Sergey said in the comment in `tutorials/CMakeLists.txt`, this
tutorials project stopped working standalone. But, it still uses
`find_package(ROOT)` to find ROOT, even though it's not installed yet as
we are building ROOT itself at the same time.

This should better not be done. This commit suggest to remove it, and
also replaces the variables defined by `find_package(ROOT)` with the
built time variables.

This follows up on 9d2dc6e c21bc3f, and 458803e, which did
the same for the `test/` and `roottest/` subdirectories.
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 11h 12m 43s ⏱️
 3 769 tests  3 769 ✅ 0 💤 0 ❌
75 858 runs  75 858 ✅ 0 💤 0 ❌

Results for commit 0eb4990.

Copy link
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but maybe make the path to root.exe explicit.

set(ROOT_root_CMD root.exe)
endif()
enable_testing()
set(ROOT_root_CMD root.exe)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will call /usr/bin/root.exe or similar if installed.

Suggested change
set(ROOT_root_CMD root.exe)
set(ROOT_root_CMD $<TARGET_FILE:root>)

enable_testing()
set(ROOT_root_CMD root.exe)
if(NOT MSVC) # Ignore environment on Windows
set(ROOT_environ PATH=${CMAKE_BINARY_DIR}/bin:$ENV{PATH}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PATH will theoretically fix up the root.exe path issue above, but I would still invoke it with the full path. It makes things clearer when you debug.

If you think whether the PATH can be removed now, I don't think so, because there might be some things like hist2workspace that might need to be invoked during the tutorials. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! In the end, I want to make everything independent of environment variables, for better portability. If there is a tutorial that starts root binaries, they should prepend gROOT->GetBinaryDir(). Would you agree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants