-
Notifications
You must be signed in to change notification settings - Fork 492
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
Fix compilation for Qt6 #1023
base: master
Are you sure you want to change the base?
Fix compilation for Qt6 #1023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks a lot for your contribution. I've added a couple of comments, it would be great if you could update your pull request based on them (but if you don't have time for it then we'll eventually get to it when CTK will have Qt6 support officially).
@lassoan Thank you for your comments, I updated the code and hopefully the pull request (I'm not a Git expert). Please let me know if it looks OK now! |
@lassoan Let me know if there's any action expected from me to have this pull requested be merged to your master. |
How did you build CTK with Qt6? I'm getting errors that Qt cannot be found when I'm trying to build with Qt6. What did you set your There are lots of hardcoded references to Qt5 in the CMake files. They would need to be changed similarly to how it was done for VTK: Kitware/VTK@190059d |
@lassoan Sorry, but I'm not using the original CMakeLists.txt, I've written my own. In mine, I simply changed: Also had to set And, as you mentioned, many variables had to be changed, if you set |
Please commit all your changes that were necessary to build with Qt6. We would then review those changes and either merge them or fix them up/generalize. Thank you very much! |
As I mentioned, I did not use your CMakeLIsts.txt to build the library, so all the "changes" I did are commited. I have no more contribution available... I gave a quick look at your code, there are many places where you do test First main change is to lookup for Qt6 instead of Qt5, so in ctkMacroSetupQt.cmake:
has to be changed to something like:
Then all other places has to be reworked as well, like, for instance, in Libs\Visualization\VTK\Core\Testing\Cpp\CMakeLists.txt:
should be changed to:
etc.... You may also decide to use versionless commands, and then, you simply need to remove the Qt version suffix and use
|
@jporcher How did you build CTK without using the CMakeLists.txt provided at https://github.com/jporcher/CTK/blob/qt6_support/CMakeLists.txt? Can you commit the CMakeLists.txt that you used for your own project? |
@jamesobutler That would be difficult as this CMakeLists.txt has dependencies on other files of my project, but I can paste you some part of it:
|
Few changes to make code compile with Qt6. Did not test the changes as I'm not familiar with the classes modified. However, at least it compiles if one wants to play with it.