I have the following code code specify various output dir and the dest dir
BUILD_ROOT = $${PWD}/build/$$TARGET-$$TEMPLATE
DIST_ROOT = $${PWD}/dist
CONFIG(debug, debug|release) {
BUILD_ROOT = $${BUILD_ROOT}/debug
DIST_ROOT = $${DIST_ROOT}/debug
} else {
BUILD_ROOT = $${BUILD_ROOT}/release
DIST_ROOT = $${DIST_ROOT}/release
}
DESTDIR = $${DIST_ROOT}
OBJECTS_DIR = $${BUILD_ROOT}/obj
MOC_DIR = $${BUILD_ROOT}/moc
RCC_DIR = $${BUILD_ROOT}/rcc
UI_DIR = $${BUILD_ROOT}/ui
BUILD_ROOT = $${PWD}/build/$$TARGET-$$TEMPLATE
DIST_ROOT = $${PWD}/dist
CONFIG(debug, debug|release) {
BUILD_ROOT = $${BUILD_ROOT}/debug
DIST_ROOT = $${DIST_ROOT}/debug
} else {
BUILD_ROOT = $${BUILD_ROOT}/release
DIST_ROOT = $${DIST_ROOT}/release
}
DESTDIR = $${DIST_ROOT}
OBJECTS_DIR = $${BUILD_ROOT}/obj
MOC_DIR = $${BUILD_ROOT}/moc
RCC_DIR = $${BUILD_ROOT}/rcc
UI_DIR = $${BUILD_ROOT}/ui
To copy to clipboard, switch view to plain text mode
However when the PWD is expanded to a path that contains spaces, the final makefile will fail when build.
This is the compile output:
Running build steps for project logging...
Configuration unchanged, skipping qmake step.
Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
c:\qtsdk\desktop\qt\4.7.4\mingw\bin\qmake.exe -spec c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++ CONFIG+=release -o Makefile logging.pro
C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/Grayfox/Desktop/root/projects/logging/trunk/src/logging'
g++ -Wl,-s -mthreads -shared -Wl,--out-implib,c:\Documents and Settings\Grayfox\Desktop\root\projects\logging\trunk\dist\release\liblogging.a -o ..\..\dist\release\logging.dll ../../build/logging-lib/release/obj/Logging.o -L"c:\QtSDK\Desktop\Qt\4.7.4\mingw\lib"
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Grayfox/Desktop/root/projects/logging/trunk/src/logging'
g++: and: No such file or directory
g++: Settings\Grayfox\Desktop\root\projects\logging\trunk\dist\release\liblogging.a: No such file or directory
mingw32-make[1]: *** [..\..\dist\release\logging.dll] Error 1
mingw32-make: *** [release] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project logging (target: Desktop)
When executing build step 'Make'
Running build steps for project logging...
Configuration unchanged, skipping qmake step.
Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
c:\qtsdk\desktop\qt\4.7.4\mingw\bin\qmake.exe -spec c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++ CONFIG+=release -o Makefile logging.pro
C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/Grayfox/Desktop/root/projects/logging/trunk/src/logging'
g++ -Wl,-s -mthreads -shared -Wl,--out-implib,c:\Documents and Settings\Grayfox\Desktop\root\projects\logging\trunk\dist\release\liblogging.a -o ..\..\dist\release\logging.dll ../../build/logging-lib/release/obj/Logging.o -L"c:\QtSDK\Desktop\Qt\4.7.4\mingw\lib"
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Grayfox/Desktop/root/projects/logging/trunk/src/logging'
g++: and: No such file or directory
g++: Settings\Grayfox\Desktop\root\projects\logging\trunk\dist\release\liblogging.a: No such file or directory
mingw32-make[1]: *** [..\..\dist\release\logging.dll] Error 1
mingw32-make: *** [release] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project logging (target: Desktop)
When executing build step 'Make'
To copy to clipboard, switch view to plain text mode
Notice the line:
g++ -Wl,-s -mthreads -shared -Wl,--out-implib,c:\Documents and Settings\Grayfox\Desktop\root\projects\logging\tru nk\dist\release\liblogging.a -o
The path is not quoted, which cause this error:
g++: Settings\Grayfox\Desktop\root\projects\logging\tru nk\dist\release\liblogging.a: No such file or directory
Normally, if I do not explicitly set a DESTDIR, the path above would have quotes around them.
Is this a known issue?
Bookmarks