How to Build QMLLS Binary from Source
-
I am trying to use the QML language server
qmlls
to support QML language in other editors. However, I do not know how to compileqmlls
binary from source. I found the source code in this repository and tried but fail to find some documentation to get how to build it.I have attempted to clone the repo and run
cmake .
intools/qmlls
but an error occurs:CMake Error at CMakeLists.txt:8 (qt_internal_add_app): Unknown CMake command "qt_internal_add_app".
It seems I need to somehow import this
qt_internal_add_app
function fromQtToolHelpers.cmake
inqtbase
repo. However, I am not sure how to import it as a dependency. Hopefully, there is a way to buildqmlls
only from a small set of files.Also, would there be a way to get
qmlls
binary directly? If that is possible, I think the language server could be installed easily and integrated into many code editors. -
It seems I need to somehow import this qt_internal_add_app function from QtToolHelpers.cmake in qtbase repo. However, I am not sure how to import it as a dependency. Hopefully, there is a way to build qmlls only from a small set of files.
The qmlls binary is supposed to be built as part of qtdeclarative - and should be part of the normal Qt packages, since Qt 6.3.0 I believe. So if you haven't built Qt yourself so far, it's probably best to check out whether you need to install additional packages from your system.
If you are building Qt yourself, and you don't do a top-level build, make sure that the qtlanguageserver repository is built & configured & installed before configuring qtdeclarative.
-
Hi @kkoehne, thanks for the fast reply.
So, does that mean I have to have Qt fully installed/built to use
qmlls
? It would be wonderful if there is a simple way to getqmlls
binary for a user's platform. In that way, other code editors could have a dedicated extension to support QML installed automatically without requiring users to preinstall a full Qt base dependency. -
@GLaDOS1105 said in How to Build QMLLS Binary from Source:
So, does that mean I have to have Qt fully installed/built to use qmlls?
This is currently the intended workflow, yes.
What's your use case for having the QML language server, but no actual QML library or runtime?
You can try to de-bundle it manually by packaging qmlls, dependant dll's and plugins separately. But this is not something I believe anybody is offering currently.
-
Thanks again for the answer!
I am trying to build a Visual Studio Code extension to support QML with PySide. PySide 6 itself provides QML library and other tool binaries except
qmlls
. Thus, I think it would be helpful to build it from source directly on installing the extension. Would there be any other better ways to achieve this? I believe if PySide 6 hasqmlls
binary pre-built likeqmllint
, it would be much easier to extend its support on other editors. -
Thanks again for the answer!
I am trying to build a Visual Studio Code extension to support QML with PySide. PySide 6 itself provides QML library and other tool binaries except
qmlls
. Thus, I think it would be helpful to build it from source directly on installing the extension. Would there be any other better ways to achieve this? I believe if PySide 6 hasqmlls
binary pre-built likeqmllint
, it would be much easier to extend its support on other editors.I am trying to build a Visual Studio Code extension to support QML with PySide. PySide 6 itself provides QML library and other tool binaries except
qmlls
. Thus, I think it would be helpful to build it from source directly on installing the extension. Would there be any other better ways to achieve this? I believe if PySide 6 hasqmlls
binary pre-built likeqmllint
, it would be much easier to extend its support on other editors.Hey,
so you are trying to rely on the binary from a PySide wheel to package it into an extension?
or your approach is to build an extension that looks inside thesite-packages/PySide6/qmlls
to use it from the current installation? -
I would prefer the second approach: looking inside the
site-packages/PySide6/qmlls
. However, in the current version of PySide6, there is no binaryqmlls
at all. I was able to build the extension integrating other PySide tools, includingrcc
anduic
, with the helper functions insite-packages/PySide6/scripts/pyside_tool.py
but no anything related toqmlls
can be found in there. Is it possible to find another way to get the binary? I think building the binary from source would be a detour and easy to break than using something provided by PySide package directly. -
J JonB referenced this topic on