我正在尝试使用qmake的subdirs
模板。问题是子项目中指定的输出目录是在构建目录中创建的,而不是在项目中引用的目录。除此之外一切正常。我想知道是否有办法解决这个问题。
目录结构
build-project_dir/
-Apps/ --this gets created
-Other things
project_dir/
-main.pro
-Apps/ -- I want it to use this instead
-Server/
----Server.pro
----some logic files
-Parser/
----Parser.pro
----Parser files
-muparser/
-build/
----muparser.pro
----main.cpp
Main.pro
TEMPLATE = subdirs
# where to find the sub projects - give the folders
Server.subdir = Server
Parser.subdir = Parser
muparser.file = muparser-2.2.5\build\muparser.pro
# what subproject depends on others
Server.depends = Parser
Parser.depends = muparser
SUBDIRS = muparser Parser Server
Server.pro
TEMPLATE = app
QT += core sql websockets xml
QT -= gui
TARGET = Server
CONFIG += console
CONFIG -= app_bundle
CONFIG += thread
SOURCES += $$files(src/*.cpp, true) $$files(src/*.c, true)
HEADERS += $$files(src/*.h, true)
INCLUDEPATH += src src/things/include
LIBS += -L../lib -lParser
DESTDIR = ../Apps
Parser.pro
TEMPLATE = lib
QT -= gui
TARGET = Parser
DEFINES += PARSER_LIBRARY
SOURCES += parser.cpp
HEADERS += parser.h
INCLUDEPATH += ./include
DEPENDPATH += $$PWD/./
LIBS += -L../lib -lmuparser
DESTDIR += ../lib
DLLDESTDIR += ../Apps
原因是因为那里需要DLL。