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. [Solved] One lib from subdir project

[Solved] One lib from subdir project

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

    Hi Folks,

    I have one Qt subdir project that contains many project (shared lib projects), but the little problem is: after compilation I will have many .so files.
    Can anybody tell me, how can I configure my subdir project to generate only one .so as its output?

    Regards,
    Norbert

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      One lib template PRO file, one library.
      Replace your subdirs pro file with a lib pro file. In the SOURCES and HEADERS include your subdirectory sources/headers including the relative path like:
      @
      TEMPLATE = lib
      TARGET = whatever
      ...
      HEADERS +=
      subdira/a.h
      subdira/b.h
      subdirb/c.h
      subdirb/d.h
      SOURCES +=
      subdira/a.cpp
      subdira/b.cpp
      subdirb/c.cpp
      subdirb/d.cpp
      @
      Or you can arrange the same thing using include(subdira/subdira.pri) in this pro file and a *.pri file in each subdirectory listing only the files in that subdir (including the relative path) e.g. Subdira.pri
      @
      HEADERS +=
      subdira/a.h
      subdira/b.h
      SOURCES +=
      subdira/a.cpp
      Subdira/b.cpp
      @

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moravas
        wrote on last edited by
        #3

        Hi,

        I tried it and it is not beautiful and transparency. Is there other possibility?

        Regards,
        Norbert

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Other options:

          • Put all your source files in one directory
          • Use a different build system, e.g. CMake or qbs, with a different set of oddities.
          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