Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. cmake how to set multi QML_IMPORT_PATH?it does not work.
Forum Updated to NodeBB v4.3 + New Features

cmake how to set multi QML_IMPORT_PATH?it does not work.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 212 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QtTester
    wrote on last edited by
    #1

    6.9.3+vs2022 , here are the codes:

    list(APPEND QML_IMPORT_PATHS ${CMAKE_BINARY_DIR}/TwoDEncoder/ ${CMAKE_BINARY_DIR}/QmlComponents/)
    list(REMOVE_DUPLICATES QML_IMPORT_PATHS)
    set(QML_IMPORT_PATH ${QML_IMPORT_PATHS} CACHE STRING "qml import path" FORCE)
    message("paths:" ${QML_IMPORT_PATHS})
    

    but the cache does not write two directory, and the editor always tells not found the module:

    wechat_2025-10-11_110650_188.jpg

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QtTester
      wrote on last edited by
      #3

      it's my mistake , i set the path in another place. sorry.

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #2

        Put quotes around the list if you want to stringify it properly:

        set(QML_IMPORT_PATH "${QML_IMPORT_PATHS}" CACHE STRING "qml import path" FORCE)
        

        (Z(:^

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          QtTester
          wrote on last edited by
          #3

          it's my mistake , i set the path in another place. sorry.

          1 Reply Last reply
          0
          • Q QtTester has marked this topic as solved on

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved