Building Qt3D 6.0.0
-
So, for some random reason Qt3D is no longer distributed in dll form with the qt installer and we have to build it ourselves.
The maintenance tool states that Qt3D is to be built with conan, however no further instructions are provided as far as I can see.
The supplied README in the source directory installed with the qt3d 6.0.0 package does not instill a lot of confidence in it by leading withQt5 is a rapidly changing bleeding edge environment. This branch is our initial support for it and thus is also rapidly changing and bleeding edge. This branch is experimental, and unsupported. This information is provided for advanced use only.
and it proceeds with obscure build instructions referencing a private repository, so no help there.
trying to simply follow a standard conan build, after defining the
QT_PATH
environment variable, In theconan build
step I get this error message:-- Configuring done CMake Error at C:/Qt/6.0.0/msvc2019_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:676 (add_dependencies): The dependency target "3DQuick_autogen" of target "3DQuick_automoc_json_extraction" does not exist. Call Stack (most recent call first): C:/Qt/6.0.0/msvc2019_64/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:711 (qt6_extract_metatypes) src/quick3d/quick3d/CMakeLists.txt:66 (qt6_qml_type_registration)
Is there anyone who actually got this to work, and how?
-
@Jakob-Weiss Perhaps there will be helpful to you:
-
Thank you for these links - given these seem to be the only information on how to build these libraries, they should definitely be easier to find than they are now.
I tried installing with
conan.exe install C:/Qt/AdditionalLibraries/Qt/qt3d-6.0.0/Src --build=missing --profile=C:/Qt/Tools/Conan/profiles/qt-6.0.0-msvc2019_64 -s build_type=Release -g cmake_paths -g=cmake -g deploy
. I modified the reference because theqt/beta
did not work for me and I didn't find any information on how to set up that conan user/reference. However, with this line conan runs successfully but only produces some text files in the output folder and definitely does not build anything. What am I missing?Full log:
C:\dev\build\Qt3D> conan.exe install C:\Qt\AdditionalLibraries\Qt\qt3d-6.0.0\Src\ --build=missing --profile=C:/Qt/Tools/Conan/profiles/qt-6.0.0-msvc2019_64 -s build_type=Release -g cmake_paths -g=cmake -g deploy` Configuration: [settings] arch=x86_64 build_type=Release compiler=Visual Studio compiler.runtime=MD compiler.version=16 os=Windows [options] qt6=6.0.0 [build_requires] [env] QT_PATH=C:/Qt\6.0.0/msvc2019_64 conanfile.py (qt3d/6.0.0): Installing package Requirements Packages Installing (downloading, building) binaries... conanfile.py (qt3d/6.0.0): Generator deploy created deploy_manifest.txt conanfile.py (qt3d/6.0.0): Generator cmake_paths created conan_paths.cmake conanfile.py (qt3d/6.0.0): Generator cmake created conanbuildinfo.cmake conanfile.py (qt3d/6.0.0): Generator txt created conanbuildinfo.txt conanfile.py (qt3d/6.0.0): Generated conaninfo.txt conanfile.py (qt3d/6.0.0): Generated graphinfo
-
@Jakob-Weiss I'm afraid I don't have experience building these Conan packages, so I'll defer to someone who has done it before
-
Hi!
I've not tried it on Windows, but this works on my mac:
conan install qt3d/6.0.0@qt/final --build=missing -s build_type=Release -g cmake_paths -g=cmake -g deploy --profile=/Users/Shared/Qt/Tools/Conan/profiles/qt-6.0.0-macx-clang
The
qt/beta
from the documentation page should beqt/final
Note that this is subject to the same platform requirements as when building the rest of Qt (in particular you need perl interpreter in your path).
You can of course build it without conan doing something like:
cd C:/Qt/AdditionalLibraries/Qt/qt3d-6.0.0/Src mkdir build cd build /path/to/qt/bin/qmake .. jom jom install
Hope this helps!
-
Thank you for the great suggestions! using the qt/final instead of qt/beta makes conan do something, however, then I'm back to the exact CMake error from my initial post regarding the
3DQuick_automoc_json_extraction
target.I also tried out the variant using qmake/jom, but then I run into a different compilation error:
C:\Qt\AdditionalLibraries\Qt\qt3d-6.0.0\Src\src\render\surfaces\vulkaninstance.cpp(51): error C2027: use of undefined type 'QVulkanInstance' C:\Qt\AdditionalLibraries\Qt\qt3d-6.0.0\Src\src\render\surfaces\vulkaninstance_p.h(60): note: see declaration of 'QVulkanInstance'
These errors are intrinsically confusing (QVulkanInstance is obviously defined, it even says so) and I can't think of anything to fix it. I have the vulkan SDK installed and explicitly adding it to the qmake include paths doesn't help either...
-
For error C2027: use of undefined type 'QVulkanInstance', After look into the qvulkaninstance.h, you need to have vulkan header
#if __has_include(<vulkan/vulkan.h>) || defined(Q_CLANG_QDOC)
Solution:
- install the vulkan sdk (https://github.com/ARM-software/vulkan-sdk, I don't have to test this method)
- OR, Go to github, https://github.com/ARM-software/vulkan-sdk/tree/master/include/vulkan, copy two files into C:\Qt\6.0.0\msvc2019_64\include\vulkan
-
thanks for trying to shed some light on this.
As I said, I have already installed the vulkan SDK (the "official" one from LunarG as I am trying to build for windows). I have even added the include directory directly in the *.pro file, and have observed that when opening the qt3d project with QtCreator, it can correctly resolve the vulkan libraries, so I think this is not the problem. I will try your suggestion of putting the vulkan headers directly in the qt directory and see if that gets me anywhere..