PDA

View Full Version : QMake remove unwanted empty folders



pospiech
5th October 2015, 20:55
I am working with an external library that consists of only a .cpp and a .h file.
The pro file for it is rather simple. However it creates all files in folders I do not want.
I rather want them in a different structure, that worked well with Qt 4.x



QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

DEFINES += QLIB_COMPILE_LIBRARY
TEMPLATE = lib
CONFIG += shared debug_and_release build_all

TARGET = QLIB
CONFIG(debug, debug|release) {
TARGET = $$join(TARGET,,,d) # if compiling in debug mode, append a "d" to the library name
}
SOURCES += QLIB.cpp
HEADERS += QLIB.h


If I run qmake it creates theses files and folders


./*_resource.rc
./Makefile*
./debug/
./release/
both with
- *.o
- moc_*
- .a file
- .dll file

I want them to be different:



PROJECT_ROOT = .
BIN_DIR = $${PROJECT_ROOT}/lib
debug:DESTDIR = $${BIN_DIR}/debug/
release:DESTDIR = $${BIN_DIR}/release/

BUILD_DIR = $${PROJECT_ROOT}/build
debug:OBJECTS_DIR = $${BUILD_DIR}/debug/
release:OBJECTS_DIR = $${BUILD_DIR}/release/

RCC_DIR = $${BUILD_DIR}/res
MOC_DIR = $${BUILD_DIR}/moc
UI_DIR = $${BUILD_DIR}/ui


this creates the .o and .moc files in /build/
and the .a and .dll files in /lib/

However I still get empty folders
/debug/
/release/
and all *.rc files in the main folder instead of build/res/.

why?

Edit:
this question is identical to this one: http://www.qtcentre.org/threads/59078-Configuring-qmake-to-put-files-inside-proper-folder
though I do not see the answer as a solution.