cmake+forms: install the MorphForms QML module as the forms_qml component, and ship the header qt_forms includes - #811
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…nent, and ship the header qt_forms includes
`cmake --install` of a MORPH_BUILD_FORMS_QML=ON build installed the
controller-core header and nothing of the QML module itself, so a packaged
morph -- a vcpkg port, say -- could not be used to render a form: there was no
target to link and no module to import. And the one piece that was installed
could not be compiled from the install: measured against a Windows install
built with MORPH_BUILD_FORMS_QML alone,
forms_controller_core.hpp(32): fatal error C1083: Cannot open include
file: 'morph/qt/qt_executor.hpp'
because qt_executor.hpp belongs to the `qt` component (MORPH_BUILD_QT, which
needs Qt WebSockets). The in-tree build and the header-set verification both
read the source tree, so neither could see it.
- `qt_forms` now lists qt_executor.hpp in its own header set (it needs only
QtCore), so the component installs what it includes.
- The QML module installs and exports as `forms_qml`: `morph::forms_qml`
(backing library) and `morph::forms_qmlplugin`, plus the object libraries
`qt_add_qml_module(... OUTPUT_TARGETS)` reports for a static module -- its
compiled resources and the plugin's static initialiser. Without those an
application links and then finds no MorphForms at run time. Each gets an
EXPORT_NAME so nothing arrives as morph::morph_*.
- qmldir, the .qmltypes and the sources go to MORPH_INSTALL_QMLDIR
(default <libdir>/qml) for tooling, exported to consumers as
`morph_QML_IMPORT_PATH`. The installed qmldir's `linktarget` is rewritten
to `morph::forms_qmlplugin`, the name a static-Qt build's QML plugin
import looks the plugin up by.
- morphConfig.cmake finds Qt6 Core/Gui/Qml/Quick for the component.
scripts/check_forms_qml_install.sh measures it the way check_install_export.sh
measures the C++ side: install to a scratch prefix, then build and *run* an
application that instantiates DynamicForm from `import MorphForms` via
find_package(morph COMPONENTS forms_qml qt_forms). Its vacuity guard runs the
same application linked against morph::forms_qml without the plugin, which
must fail (`module "MorphForms" plugin "morph_forms_moduleplugin" not
found`), so the check is shown to measure the plugin. Run locally on Windows
(MSVC 14.51, Qt 6.11.1): all four steps ok. New CI job
install-export-forms-qml runs it on ubuntu-24.04 with Qt 6.8.1.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Yaraslaut
force-pushed
the
feature/forms-qml-install
branch
from
September 25, 2026 06:19
687a7ad to
8962fad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cmake --installof aMORPH_BUILD_FORMS_QML=ONbuild installed no QML module (nothing to link, nothing to import), and the one forms header it did install did not compile from the install:(
qt_executor.hppbelonged only to theqtcomponent, which needs Qt WebSockets.) In-tree builds and header-set verification read the source tree, so neither saw it.qt_formsshipsqt_executor.hppforms_qmlmorph::forms_qml+morph::forms_qmlplugin+ theOUTPUT_TARGETSobject libraries (compiled resources, static plugin initialiser) — without them the app links but finds noMorphFormsat run time; all withEXPORT_NAMEs (nomorph::morph_*)qmldir,.qmltypes, sources →MORPH_INSTALL_QMLDIR(default<libdir>/qml), exported asmorph_QML_IMPORT_PATH; installedqmldirlinktargetrewritten tomorph::forms_qmlplugin(what a static-Qt/WASM build's QML plugin import resolves)morphConfig.cmakefind_dependency(Qt6 6.5 COMPONENTS Core Gui Qml Quick)forforms_qmlConsumer usage (README +
forms.md"Shipped Qt/QML reference renderer"):Verification: new
scripts/check_forms_qml_install.shinstalls to a scratch prefix, then builds and runs an app that instantiatesDynamicFormfromimport MorphForms; its vacuity guard runs the same app without the plugin and requires it to fail (module "MorphForms" plugin ... not found). Local run on Windows (MSVC 14.51, Qt 6.11.1): all steps ok. New CI jobinstall-export-forms-qml(ubuntu-24.04, Qt 6.8.1) runs it — first run is on this PR.forms_qml_logic317 passed.🤖 Generated with Claude Code