How to use QML_IMPORT_PATH with Qt Cmake Project?

前端 未结 2 515
南方客
南方客 2021-01-18 11:05

I need to provide some modules for project.

Now, it looks for them in QT directory(I\'ve installed it in $HOME), but instead of it I wa

2条回答
  •  甜味超标
    2021-01-18 11:11

    With the new and upcoming QtCreator 4.1 you will be able to do that. Just set QML_IMPORT_PATH in your CMake cache. If you have multiple paths, separate them with a ; which is just how a list is done in CMake.

    list(APPEND QML_DIRS "dir1")
    list(APPEND QML_DIRS "dir2")
    set(QML_IMPORT_PATH "${QML_DIRS}" CACHE STRING "Qt Creator 4.1 extra qml import paths")
    

提交回复
热议问题