[Solved] One lib from subdir project



  • 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



  • 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
    @



  • Hi,

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

    Regards,
    Norbert



  • 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.

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.