Skip to content

cmake: Switch ROOT to config mode#1050

Merged
dennisklein merged 5 commits intoFairRootGroup:devfrom
ChristianTackeGSI:pr/cmake_root_configmode
Apr 13, 2021
Merged

cmake: Switch ROOT to config mode#1050
dennisklein merged 5 commits intoFairRootGroup:devfrom
ChristianTackeGSI:pr/cmake_root_configmode

Conversation

@ChristianTackeGSI
Copy link
Copy Markdown
Member

Instead of using the internal find module, let's use ROOT's own cmake config mode system.

This commit does the basic switch over.
It turns all used library targetd over to their ROOT:: equivalent and does some basic cleanup.

It should compile and hopefully run the test suite.

There is more stuff to cleanup afterwards.


Checklist:

Comment thread base/MQ/CMakeLists.txt Outdated
Comment thread CMakeLists.txt
PATHS ${ROOT_BINDIR}
NO_DEFAULT_PATH
)
include(ROOTMacros)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
include(ROOTMacros)

Nothing in this module should be in use in FairRoot any more, why include it? (The file may be used by experiment repos however)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I see, it was included in the deleted FindROOT.cmake

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

And without this, some things don't work. Don't ask me what. I forgot about it.

So maybe experiments will need to add this include somewhere? Because the find_package wont load it any more.

Comment thread CMakeLists.txt Outdated
@dennisklein dennisklein added this to the v19.0 milestone Apr 8, 2021
@ChristianTackeGSI ChristianTackeGSI force-pushed the pr/cmake_root_configmode branch 3 times, most recently from 5b27a78 to 6738926 Compare April 8, 2021 16:05
@ChristianTackeGSI ChristianTackeGSI marked this pull request as ready for review April 8, 2021 21:34
@ChristianTackeGSI
Copy link
Copy Markdown
Member Author

Okay, this should be ready for a first real review.

I think, I have already adressed all the raised issues above.

That said:

  • Reviewing the complete diff is probably not very pleasant.
  • Each commit should be easier to review.
  • If needed, this PR can be split at each commit to reduce the review overhead (it compiles / tests fine after each commit).
  • I guess, I missed something, but I do think, this is in a shape to be reviewed and considered.

@dennisklein dennisklein force-pushed the pr/cmake_root_configmode branch from 694b7fc to 909718e Compare April 10, 2021 21:15
All the ROOT library targets that we use, should use the
ROOT:: namespace. So let's switch them over.

For this iteration, let's add all the needed ones to our
own discovery code.
As we now should use targets to link to all ROOT libraries,
there shouldn't be any need to use target_link_directories
to tell cmake about the directory for those libs.
In preparation for switching ROOT to config mode, let's
rename some variables and move things around into newer
places.

* Move `include(ROOTMacros)` out of FindROOT.
* Move setting ROOT_CINT_EXECUTABLE out of FindROOT into
  ROOTMacros.
* Rename variables:
  ROOT_HAS_OPENGL -> ROOT_opengl_FOUND
  ROOT_GDML_FOUND -> ROOT_gdml_FOUND
  (and move setting of it into FindROOT)
Instead of using the internal find module, let's use ROOT's
own cmake config mode system.
* We should use ROOT:: targets that give us the include
  directories.
* ROOT_INCLUDE_DIR doesn't work anyway, it's now
  ROOT_INCLUDE_DIRS, if we want it at all.

Also replace ROOT_BINARY_DIR by ROOT_BINDIR.
@ChristianTackeGSI ChristianTackeGSI force-pushed the pr/cmake_root_configmode branch from 909718e to d605425 Compare April 11, 2021 12:51
@dennisklein dennisklein merged commit 7a8f333 into FairRootGroup:dev Apr 13, 2021
@ChristianTackeGSI ChristianTackeGSI deleted the pr/cmake_root_configmode branch April 13, 2021 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants