Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install missing #1

Open
machinekoder opened this issue Aug 19, 2018 · 2 comments
Open

Install missing #1

machinekoder opened this issue Aug 19, 2018 · 2 comments

Comments

@machinekoder
Copy link

Unfortunately, this example is missing the install step. QML plugins / modules / extensions (whatever you may call it) should be installed in QT_INSTALL_QML. Please take a look at the QMake equivalent generated by Qt Creator.

@machinekoder
Copy link
Author

Something along the lines of

set(URI QuickContainers)
string(REPLACE "." "/" TARGETPATH ${URI})
execute_process(COMMAND qmake -query QT_INSTALL_QML OUTPUT_VARIABLE QT_INSTALL_QML_RAW)
string(REPLACE "\n" "" QT_INSTALL_QML ${QT_INSTALL_QML_RAW})
set(DESTDIR "${QT_INSTALL_QML}/${TARGETPATH}")
install(TARGETS QuickContainers DESTINATION ${DESTDIR})

should do the trick.

Note that querying qmake isn't really nice, but seems to be the only option at the moment.

@StefanFabian
Copy link

Thank you, this was a great help.
I'd just like to add:
The URI has to be the name of the module and the TARGETS has to be the plugin specified in the qmldir.
In the sample they are both QuickContainers but in other cases they may vary.
Also, this is missing the step to install the qmldir file:

install(FILES ${CMAKE_CURRENT_LIST_DIR}/qmldir DESTINATION ${DESTDIR})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants