-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Provide in the cmake configuration the C++ standard which was used to compile ROOT #7644
Comments
The better solution would be to improve |
Hi @amadio , that is an "active requirement". What I actually needed at some point is a "passive" information, an answer to a quaestion "What standard was used?". So these are similar, but yet different things. Best regards, Andrii |
Hi @amadio , just found another code where people would benefit from this feature https://github.com/acts-project/acts/blob/main/CMakeLists.txt line 104 Best regards, Andrii |
+1. Since ROOT requires that downstream projects be compiled with the same C++ standard that was used for ROOT, ROOT should expose that standard as Many projects have to extract that information by regex-matching, e.g. https://gitlab.cern.ch/hepmc/HepMC3/-/blob/master/CMakeLists.txt#L153-171 . |
ROOT's targets already export the C++ standard they were built with, so if you just link your project with ROOT using those targets, you already get the same C++ standard used in your code. Worst case, you can call |
in reality most projects set their
ah, that's already way better than regex-matching, thanks!
👍 |
hi @bellenot : would it be hard to expose the standard in a potential new ROOT_CXX_STANDARD variable in your opinion? |
No, but that requires quite some changes, also for the projects using ROOT. I'll investigate (I have plenty of changes for CMake on Windows anyway) |
@amadio Oh! You're right, sorry, I misunderstood the requirement... Will make a PR now. Thanks! |
Happy to see this moving forward!
this should be sufficiently backwards-compatible. unless a downstream project was somehow setting and using a variable called like that already they should see no change. (P.S. don't forget to update https://root.cern/manual/integrate_root_into_my_cmake_project ) |
Right, thanks Enrico! |
@eguiraud Here is the PR for the doc: root-project/web#938 |
Hi @bellenot, It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise. Sincerely, |
Hi all,
It makes sense to compile software with ROOT using exactly the same C++ standard.
However, there is no nice way to obtain this information from ROOT cmake config.
Everything that is provided is a list of C++ flags.
Describe the solution you'd like
Have a CMake variable ROOT_CXX_STANDARD in ROOT cmake config.
Describe alternatives you've considered
Parsing the ROOT_CXX_FLAGS and hoping for the best.
Best regards,
Andrii
The text was updated successfully, but these errors were encountered: