Qmake project dependencies (linked libraries)

后端 未结 5 1126
执念已碎
执念已碎 2020-12-12 10:46

I have a project that links to a number of shared libraries.

Lets say project A depends on projects B and C

Ideally, I want to impose the following dependenc

5条回答
  •  伪装坚强ぢ
    2020-12-12 11:36

    I use the solution below. This works without the usage of an extra .pro file with subdir template.

    TEMPLATE = app
    TARGET = MyApp
    PRE_TARGETDEPS = ../../libs/MyLib/MyLib.a
    INCLUDEPATH += ../../libs/MyLib/include 
    HEADERS += src/MyApp.h \
        ../../libs/MyLib/incude/MyLib.h
    SOURCES += src/MyApp.cpp
    LIBS += ../../libs/MyLib/MyLib.a
    
    MyLib.target = ../../libs/MyLib/MyLib.a
    MyLib.commands = cd ../../libs/MyLib && make
    MyLib.depends = ../../libs/MyLib/Makefile
    QMAKE_EXTRA_TARGETS += MyLib
    

提交回复
热议问题