2017-12-29 10 views
0

qmake의 subdirs 템플릿을 사용하려고합니다. 문제는 하위 프로젝트에 지정된 출력 디렉토리가 프로젝트에서 참조되는 디렉토리가 아닌 빌드 디렉토리에 작성된다는 것입니다. 그 다음에는 모든 것이 정상적으로 작동합니다. 이 문제를 해결할 방법이 있는지 궁금합니다.QMake subdir 기본 디렉토리가 아닌 빌드 디렉토리에 템플릿 출력

디렉터리 구조

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이 있기 때문입니다.

+0

DESTDIR = $$_PRO_FILE_PWD_/../Apps_Win 내 애플 리케이션에 대한 DESTDIR 위치를 변경했다 문제

에 대한 해결책을 찾을 수 귀하의 .PRO을 보여줄 수 있었다. – eyllanesc

+0

@eyllanesc 죄송합니다. 잘하면이게 좋다. – user373864q

+0

문제점은 무엇이며 왜 .pro가 빌드되어 있습니까? – eyllanesc

답변

관련 문제