As an example we have a main .pro file which it's a subdirs template to compile code in multiple subdirs:
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += mbl_utils \
mbl_usb \
mbl_encoder \
mbl_renderer \
nanoGUI
For each .pro file in the libraries subdirectory we will have to add on a debug:win32 entry the following code:
debug:win32 {
# Hack to get pdb files generated with proper name
QMAKE_CXXFLAGS += -Fd$${TARGET}.pdb
# Hack to get pdb files copied in Bin folder from where the binary is run
pdbtarget.files = $${TARGET}.pdb
pdbtarget.path = $${BINDIR}
pdbtarget.command = copy /y $${TARGET}.pdb $${BINDIR}
INSTALLS += pdbtarget
}
Where TARGET is defined as the library name and BINDIR is where the executable file is copied after compilation. This should create proper debug information files where the project executable is being run.
No comments:
Post a Comment