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. pri files functions on SUBDIRS - beyond export
QtWS25 Last Chance

pri files functions on SUBDIRS - beyond export

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qmakesubdirs
1 Posts 1 Posters 264 Views
  • 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.
  • G Offline
    G Offline
    genner
    wrote on 6 Jun 2022, 20:37 last edited by
    #1

    I am creating a function in a .pri file that will be included in a .pro file with the intent of being able to do:

    template(subdirs)
    addMyProject(libA)
    addMyProject(libB)
    addMyProject(libC)
    

    instead of

    template(subdirs)
    SUBDIRS += libA
    libA.path = source/
    SUBDIRS += libB
    libB.path = source/
    SUBDIRS += libC
    libC.path = source/
    

    Same problem if I want to use the depend keyword.

    My current implementation is the following one:

    defineTest(addMyProject) {
    
      library_name = $$1
    
      SUBDIRS += $$library_name
      export(SUBDIRS)
    
      {$$library_name}.file = {$$library_name}/source/{$$library_name}.pro
      QMAKE_EXTRA_TARGETS += {$$library_name}
      export(QMAKE_EXTRA_TARGETS)
    }
    

    The SUBDIRS part is ok. I have tried to make it work for the .file part in different ways, but still I have not found a solution.

    Each library contains different sub-projects, and the goal is to let Qt creator see only one of them (the one at the path source/libraryname.pro).

    The issue is that all the libraries are correctly displayed, but also all the other sub-projects. Basically, only the SUBDIRS variable is recognised, not the .file keyword

    Any hints?

    1 Reply Last reply
    0

    1/1

    6 Jun 2022, 20:37

    • Login

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