paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
2.92k stars 795 forks source link

add 2 variables to cmake file: QT_PATH, QT_VERSION #340

Closed zhoutotong closed 1 year ago

zhoutotong commented 1 year ago

specify qt version and install path to solved #338

paceholder commented 1 year ago

What is the purpose of specifying a version for Qt 5.xx? Do you intend to have several Qt5 installations on your computer?

zhoutotong commented 1 year ago

What is the purpose of specifying a version for Qt 5.xx? Do you intend to have several Qt5 installations on your computer?

I try to compile v3.x in Ubuntu 20.04 system, and the default version of Qt in Ubuntu 20.04 is 5.12, it failed with https://github.com/paceholder/nodeeditor/issues/338, then I try to install 5.15 to my system, and it install in that path: $HOME/Qt.

In addition, build version 3. x must use Qt version 5.15 or above.

paceholder commented 1 year ago

Maybe it is just easier to hardcode the required version 5.15? It is the last version for the 5.x branch.

zhoutotong commented 1 year ago

If the minimum Qt version of QtNodes is Qt 5.15, you only need to change the version requirements in readme.rst.

But still hope that the QT_PATH variable can be added, otherwise the manually installed Qt in the Ubuntu environment cannot be found by cmake

paceholder commented 1 year ago

But still hope that the QT_PATH variable can be added, otherwise the manually installed Qt in the Ubuntu environment cannot be found by cmake

It is usually done by defining an enviroment variable Qt5_DIR. It could be, for example: Qt5_DIR=<QTDIR>/lib/cmake/Qt5

Alternatively you could pass the root directory of your Qt installation when configuring the cmake. For example

cmake .. -DCMAKE_PREFIX_PATH=$HOME/Qt/5.11.2/gcc_64 
zhoutotong commented 1 year ago

Thank you for your idea, but I still hope you can specify the Qt version in cmake, for example:

find_package(Qt5 5.15...)
paceholder commented 1 year ago

Sorry, I thought I did it already. In fact, I just modified the README.

paceholder commented 1 year ago

@zhoutotong Before I restrict the version, could you please invest 10 minutes and try the fix described on this page? https://stackoverflow.com/questions/50064670/qt-library-link-errors-in-windows It is called 3rd issue fix. Maybe we could work-around it easily and do not block the library users from using an older Qt distribution on their systems.

paceholder commented 1 year ago

@zhoutotong any luck trying the fix?