Skip to content

Conversation

@guitargeek
Copy link
Contributor

As Sergey said in the comment in test/CMakeLists.txt, this test
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.

Apparently that works, and sets the flags like ROOT_opengl_FOUND, but
we should not rely on this and use the build-time configuration flags
instead.

@guitargeek guitargeek self-assigned this Dec 4, 2025
@guitargeek guitargeek requested a review from bellenot as a code owner December 4, 2025 09:34
@guitargeek guitargeek added in:Build System clean build Ask CI to do non-incremental build on PR labels Dec 4, 2025
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to remove this file? Could it be possible that someone in the world is still using it? Should we perhaps change the deprecation message to specify a ROOT release when this will be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly necessary, but it's a bit confusing to keep as it's called RootNewMacros.cmake, with "New" in the name, but deprecated and replaced by RootMacros.cmake without "New". I would like to keep confusing situations like this behind for good.

Users will have seen the deprecation message for 6 years now. I think people will understand if we remove it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I you think this is controversial, I can bring it forward in a separate PR!

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

...only if it exists 🙂 Otherwise, they automatically get the new RootMacros.cmake via the find_package(ROOT REQUIRED) before in the file. So they actually to the right thing, to even be backwards compatible with ROOT before 6.20.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, sorry, I overlooked at it...

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Test Results

    22 files      22 suites   3d 19h 46m 25s ⏱️
 3 784 tests  3 784 ✅ 0 💤 0 ❌
81 227 runs  81 227 ✅ 0 💤 0 ❌

Results for commit 994c94c.

♻️ This comment has been updated with latest results.

Comment on lines -8 to -9
# This shows nicely how to compile and link applications
# using the ROOT libraries on all supported platforms.
Copy link
Member

Choose a reason for hiding this comment

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

Can we update the PR description and commit log on where we now document and/or demonstrate the modern way to build you application that uses ROOT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, anywhere where we use ROOT_EXECUTABLE or ROOT_STANDARD_LIBRARY_PACKAGE I guess? I don't see what made this test/CMakeLists.txt a good place "to show nicely how to compile and link applications using the ROOT libraries on all supported platforms". That comment seemed pretty random to me.

Copy link
Member

Choose a reason for hiding this comment

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

Rather than random, it is historical. Once upon a time, this was a tidy smallish standalone (Makefile then CMake) example that build dictionaries, libraries and executables that use ROOT. I can see that over time we drifted away from that (seemingly breaking the standalone part and getting a bit complex). However unless (but I assume we actually do have one) we have a replacement documentation, then this would be the closest we have to a documentation. (If we don't have the documentation and nice examples, then this PR can still proceed but we need to open an issue to remind us to write that documentation).

Well, anywhere where we use ROOT_EXECUTABLE or ROOT_STANDARD_LIBRARY_PACKAGE

Humm .. that does not sound enough, it also needs at least the call to find_package(ROOT) and a good set of usage of the CMake function we recommend using. i.e. enough for a CMake beginner to get started.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I see now! The entry-point documentation for using ROOT via CMake is here now:
https://root.cern/manual/integrate_root_into_my_cmake_project/#full-example-event-project

Do you see anything missing from there? I think it's good that we advocate the custom macros like ROOT_EXECTUABLE too much, and instead show how to use standard CMake, just like the example on the website does.

Copy link
Member

Choose a reason for hiding this comment

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

That looks fine enough (although it 'requires' the information provide by Henry Schreiner. It is linked from our documentation but we depends on that linked page staying up.

Has been deprecated since ROOT 6.20 and can now be removed.
As Sergey said in the comment in `test/CMakeLists.txt`, this test
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.

Apparently that works, and sets the flags like `ROOT_opengl_FOUND`, but
we should not rely on this and use the build-time configuration flags
instead.
@guitargeek
Copy link
Contributor Author

@pcanal, I addressed all your inline comments

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

Thanks.

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

Labels

clean build Ask CI to do non-incremental build on PR in:Build System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants