Building of certain modules fails with Unknown CMake command "qt_internal_add_qml_module".
-
I am trying to package Qt6 for MacPorts and keep running into problems with building modules that define
qt_internal_add_qml_module
in theirCMakeLists.txt
(e.g.,qt3d
,qt5compat
, andqtmultimedia
).I successfully build
qtbase
using the recommendedconfigure
method and useqt-configure-module
followed bycmake --build .
andcmake --install
for the modules. That works well for several of them (e.g.,qtdeclarative
,qtimageformats
,qtlanguageserver
,qtshadertools
, andqtsvg
), but all the ones that attempt to useqt_internal_add_qml_module
fail with the error message above. I looked around in the source, but indeed cannot find that function defined anywhere; admittedly, I am not that well versed incmake
so I might just be looking in the wrong places...Anyone else experienced this as well and is able to give a pointer on how to fix it?
-
I don't know what goes wrong for you. Are you sure that you're using a consistent set of modules? Maybe there's another Qt incompatible version lurking somewhere, e.g. set in
CMAKE_PREFIX_PATH
?Anyhow, to answer some of your questions:
qt_internal_add_qml_module
is defined inqtdeclarative/src/qml/Qt6QmlBuildInternals.cmake
, and (after installation) in<installdir>/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake
. -
thanks for the response @kkoehne and pointing to where the
qt_internal_add_qml_module
function is defined. I indeed see it in the source (qtdeclarative-everywhere-src-6.3.0
) but it isn't present at the location you mention for after the installation. So clearly something is amiss there, but now I at least have a good idea on where to start to debug it! -
I noticed that in this configuration,
<installdir>/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake
is actually not installed by qtdeclarative. The other cmake files are installed.Any idea why this?
On other platforms like debian (but it configures with cmake directly) there is no such problem.
-