Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Library for all subproject
Forum Updated to NodeBB v4.3 + New Features

Library for all subproject

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.5k 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.
  • E Offline
    E Offline
    Exotic_Devel
    wrote on last edited by
    #1

    My project is divided into subprojects

    !http://i60.tinypic.com/2edmmnk.png(MYPRO)!

    Need to add a dynamic library that will be used by all subprojects. In the main project I selected [Add Library] and chose the library.

    Is this enough?

    Below my main project

    @TEMPLATE = subdirs

    SUBDIRS +=
    TecTrackerAdm
    TecTrackerOpr
    Core

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../DynamicQtWidgets/build/release/ -ldynamicqtwidgets
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../DynamicQtWidgets/build/debug/ -ldynamicqtwidgets
    else:unix: LIBS += -L$$PWD/../DynamicQtWidgets/build/ -ldynamicqtwidgets

    INCLUDEPATH += $$PWD/../DynamicQtWidgets/build
    DEPENDPATH += $$PWD/../DynamicQtWidgets/build
    @

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK no, but what you can do is create a pri file that contains the information to link to your library and include it in each project using it

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Exotic_Devel
        wrote on last edited by
        #3

        Can also choose to perform the same procedure (Menu> Add Library) in each of the subprojects?

        You can leave an example of the solution with pri file?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You can also, but if you have to modify e.g. the path to the library you'll to do it for all sub projects.

          @
          mylib.pri:

          win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../DynamicQtWidgets/build/release/ -ldynamicqtwidgets
          else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../DynamicQtWidgets/build/debug/ -ldynamicqtwidgets
          else:unix: LIBS += -L$$PWD/../DynamicQtWidgets/build/ -ldynamicqtwidgets

          INCLUDEPATH += $$PWD/../DynamicQtWidgets/build
          DEPENDPATH += $$PWD/../DynamicQtWidgets/build

          subprojectx.pri:
          include(../mylib.pri)
          @

          You may have to modify the path

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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