In Qt Creator, when I create a new Unit Test project, it will not be successfully created if the full path to the project contains a space.
I tracked the error to the make file created by qmake. The make file contains a line near the top, for example:
DEFINES = -DUNICODE -DWIN32 -DSRCDIR=\"C:/Users/Smith/Qt Projects/Unit_Tests/\" -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR=\"C:/Users/Smith/Qt Projects/Debug_Unit_Tests\"
The quotes for SRCDIR and QT_TESTCASE_BUILDDIR reset with QT_TESTCASE_BUILDDIR . If I remove the backslash with Makefile.Debug , the project will succeed.
Obviously, I don't want to manually remove the backslash every time. I would also like to avoid a custom build step that removes the backslash. Since qmake has so many options, I was hoping there was something that I could just put in a .pro file that would fix this.
I tried something like DEFINES -= QT_TESTCASE_BUILDDIR . However, this does not work as QT_TESTCASE_BUILDDIR is not yet defined. testlib seems to add its own definitions later.
I use:
- Visual Studio 2010 SP 1
- Qt 5.0.2
- Qt Creator 2.7.0
- Windows 7
What is the easiest way to get rid of backslashes?
Edit: This also happens with OSX.
mjk99 source share