[Interest] Defining a string in qmake command line

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Thu Jan 23 17:49:53 CET 2014


Hi,

This works for me in the .pro

DEFINES += SERIAL=\\\"f9a/z\\\"

produces:

g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
-DQT_LARGEFILE_SUPPORT -DSERIAL=\"f9a/z\" -DQT_DLL -DQT_NO_DEBUG
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT
-DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"d:\Qt\Desktop\Qt\4.8.1\mingw32\include\QtCore"
-I"d:\Qt\Desktop\Qt\4.8.1\mingw32\include\QtGui"
-I"d:\Qt\Desktop\Qt\4.8.1\mingw32\include" -I"d:\Qt\mingw\include\OpenEXR"
-I"source" -I"d:\Qt\Desktop\Qt\4.8.1\mingw32\include\ActiveQt" -I"release"
-I"." -I"..\CrashTest" -I"."
-I"d:\Qt\Desktop\Qt\4.8.1\mingw32\mkspecs\win32-g++" -o
release\moc_backgroundfileworker.o release\moc_backgroundfileworker.cpp

Etienne


2014/1/23 Soroush Rabiei <soroush.rabiei at gmail.com>

> I need to pass a string as a definition to my source code which is a
> base64 encoded string (so may contain / and "). I'm using qmake and g++.
> I've tried so many combinations, but neither works:
>
> qmake DEFINES+=SERIAL=\\\"f9a/z\\\"
> qmake DEFINES+=SERIAL=\"f9a/z\"
> qmake DEFINES+="SERIAL=\\"f9a/z\\\""
>
> G++ should get the serial like this:
>
> g++ -DSERIAL=\"f9a/z\"
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140123/d8d29a40/attachment.html>


More information about the Interest mailing list