Dax89 / QHexView

A versatile Hexadecimal widget for Qt5
MIT License
323 stars 101 forks source link

5.0 branch and Qt5 cmake compatibility #76

Closed audetto closed 11 months ago

audetto commented 11 months ago

Hi,

I am trying to build the 5.0 branch with Qt5 and the line

https://github.com/Dax89/QHexView/blob/48b0e6c817d8f88189454d991ca8c4509dddb5e0/CMakeLists.txt#L5

fails in cmake with

CMake Warning at source/frontends/qt/QHexView/CMakeLists.txt:5 (find_package):
[cmake]   By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
[cmake]   asked CMake to find a package configuration file provided by "Qt6", but
[cmake]   CMake did not find one.
[cmake] 
[cmake]   Could not find a package configuration file provided by "Qt6" with any of
[cmake]   the following names:
[cmake] 
[cmake]     Qt6Config.cmake
[cmake]     qt6-config.cmake

But if I remove all the lines https://github.com/Dax89/QHexView/blob/48b0e6c817d8f88189454d991ca8c4509dddb5e0/CMakeLists.txt#L5-L9

then everything works correctly as it is my application to find Qt5. I think this is the case since the source files are in the INTERFACE section, so they are complied as part of my lib, not this lib (???)

It is the case that since this is not the "main" cmake file, it should leave it to something else to find the right Qt things? Imagine I have both Qt5 and Qt6 and I want to use Qt5, this library will instead find Qt6 first?

audetto commented 11 months ago

uhmm, it is only a cmake warning, it still works.

but I still think that since QT is not used in this cmake file, it should not be requested.

Dax89 commented 11 months ago

Yeah it can be removed, so it uses the correct Qt version from the main project.

I will push a fix tomorrow.