QUItCoding / qnanopainter

Library for implementing OpenGL accelerated Qt (Quick) C++ UI components.
http://quitcoding.com
Other
405 stars 79 forks source link

add cmake #63

Closed mariuszmaximus closed 2 years ago

mariuszmaximus commented 2 years ago

first relese, tested only on windows

QUItCoding commented 2 years ago

I tested this by opening the qnanopainter/CMakeList.txt with Qt Creator on my Windows PC, but it didn't seem to fully work.

With Qt 6.3.0 I'm getting:

libqnanopainter\CMakeLists.txt:7: error: Could not find a package configuration file provided by "Qt5Widgets" with any of the following names: Qt5WidgetsConfig.cmake qt5widgets-config.cmake Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed.

With Qt 5.15 I'm getting: CMakeLists.txt:39: error: Cannot find source file: ../../libqnanopainter/libqnanopainterdata.qrc Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

Please instruct usage & system, getting this to work with latest Qt 6 versions would be preferred as CMake is the official build system there.

mariuszmaximus commented 2 years ago

I fix it ! I don't have 6.3 but install it , and then make 5&6 compatible cmake

mariuszmaximus commented 2 years ago

Please look at my last commit "cmake for Qt5 and Qt6 " I tested it on Windows Qt 6.3.0 and 5.15

mariuszmaximus commented 2 years ago

one more fix in cmake I tested Qt 5.12 and fix for old versions Qt

QUItCoding commented 2 years ago

Tested now and it kinda works!

With Qt 5.15 it built without issues.

With Qt 6.3.0 I'm getting error: qnanopainter\libqnanopainter\ext\GLES3\gl3platform.h:28: error: C1083: Cannot open include file: 'KHR/khrplatform.h': No such file or directory

The reason this happens is that gles2 & gles3 backends are enabled even when they shouldn't be on Windows. Commenting out the "private/qnanobackendgles2.h" etc. gles includes from libqnanopainter\CMakeLists.txt fixes it. So I think this would need similar autodetection as include.pri does "qtConfig(opengles2) | qtConfig(opengles3) { ...".

But I think this can be pushed in as the initial CMake support and follow-up paches can be done for improvements. Thanks Mariusz!

mariuszmaximus commented 2 years ago

Look at #65

A look at your include.pri

and add more IF() in cmake

I tested on OFFICIAL https://www.qt.io/download C:\Qt\5.15.2\mingw81_64 C:\Qt\6.3.0\mingw_64

And MSYS2 https://packages.msys2.org/group/mingw-w64-x86_64-qt5 https://packages.msys2.org/group/mingw-w64-x86_64-qt6

Is possible build for android qnanopainter ?

Best

Mariusz

W dniu 03.06.2022 o 19:54, QUIt Coding pisze:

Tested now and it kinda works!

With Qt 5.15 it built without issues.

With Qt 6.3.0 I'm getting error: qnanopainter\libqnanopainter\ext\GLES3\gl3platform.h:28: error: C1083: Cannot open include file: 'KHR/khrplatform.h': No such file or directory

The reason this happens is that gles2 & gles3 backends are enabled even when they shouldn't be on Windows. Commenting out the "private/qnanobackendgles2.h" etc. gles includes from libqnanopainter\CMakeLists.txt fixes it. So I think this would need similar autodetection as include.pri does "qtConfig(opengles2) | qtConfig(opengles3) { ...".

But I think this can be pushed in as the initial CMake support and follow-up paches can be done for improvements. Thanks Mariusz!

— Reply to this email directly, view it on GitHub https://github.com/QUItCoding/qnanopainter/pull/63#issuecomment-1146220597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7TIFDYHDTKCPVD372ZYB3VNJBGDANCNFSM5WOP2LRA. You are receiving this because you authored the thread.Message ID: @.***>

QUItCoding commented 2 years ago

For windows I rarely use Qt mingw builds, always the msvc. And yes, QNanoPainter works fully on Android when building with qmake and using gles backends. I will check your latest improvements patches soonish, thanks!