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. How to add library to app dependency list in QtCreator?

How to add library to app dependency list in QtCreator?

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.3k 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.
  • T Offline
    T Offline
    Tramvon
    wrote on last edited by
    #1

    I'm trying to create QtQuick extention, and can't understand, how I can add it to my app project, that it was compiling, picks, and for android, packing in one apk?

    I have next directory structure:
    @dev_root
    all.pro
    app
    app.pro
    ext
    ext.pro
    @

    all.pro:
    @
    TEMPLATE = subdirs

    SUBDIRS +=
    app
    ext
    @

    I try to open all.pro in QtCreator, both app.pro and ext.pro opens, seems to be good. The .pro file with TEMPLATE = subdirs, as I understand, , is an analogue of MSVC solution. In MSVC, I can simply specify the dependency, and lib will be built before building exe, but in qtCreator I can't find such feature.

    I try to do as writes in net - open app.pro, right click on it, "Add library..." — "Internal library". In dialog "Choise the project file the library to link to" combobox is always empty, and I can't select my library.

    What I'm doing wrong?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      If I understood it correctly, you have an application project in app.pro and a library project in ext.pro.

      Does ext.pro contains ?
      @
      TEMPLATE = lib
      @

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tramvon
        wrote on last edited by
        #3

        Yes, it does

        @
        TEMPLATE = lib
        TARGET = filedialog
        QT += qml quick declarative
        CONFIG += qt plugin

        TARGET = $$qtLibraryTarget($$TARGET)
        uri = com.purefractalsolutions.gkdroidfiledialog
        
        # Input
        SOURCES += \
            dialogPlugin.cpp \
            directory.cpp \
            file.cpp
        
        HEADERS += \
            dialogPlugin.h \
            directory.h \
            file.h
        
        OTHER_FILES = qmldir
        
        !equals(_PRO_FILE_PWD_, $$OUT_PWD) {
            copy_qmldir.target = $$OUT_PWD/qmldir
            copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
            copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
            QMAKE_EXTRA_TARGETS += copy_qmldir
            PRE_TARGETDEPS += $$copy_qmldir.target
        }
        
        qmldir.files = qmldir
        unix {
            installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
            qmldir.path = $$installPath
            target.path = $$installPath
            INSTALLS += target qmldir
        }   
        

        @

        1 Reply Last reply
        0

        • Login

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