Build Systems
CXX-Qt can be integrated into existing CMake projects or built with only cargo. The getting started guide provides documentation on how to set up your project:
CXX-Qt could work with any C++ build system so long as the QMAKE
, CXX_QT_EXPORT_DIR
and CXX_QT_EXPORT_CRATE_<CRATE-NAME>
environment variables are set before calling Cargo.
Take a look at our CMake code for how this can be used.
However, using C++ build systems besides Cargo or CMake with CXX-Qt is untested and the use of these environment variables is SemVer-exempt!
For information on building for WebAssembly (wasm), see: Building for Webassembly
CxxQtBuilder
With both build systems a build script (build.rs
) file needs to be used,
so that CXX-Qt knows which files to look for bridges and to build a Qt C++ library for linking later.
See CxxQtBuilder
documentation for more details.
QML Modules
When using QML with CXX-Qt QML modules can be output.
This allows for attributes such as #[qml_element]
to register the QObject
with the QML type system without any C++ code.
See QmlModule
documentation for more details.