[Development] Qt4.8.x, qdoc3 not available Qt env variables from *.qdocconf file

Denis Shienkov scapig2 at yandex.ru
Fri Nov 30 14:32:58 CET 2012


Oswald,

I do not understand how qtPrepareTool() can help me?  (We are talking about and not Qt4.8.x Qt5.0.x)

This function only sets the variable QDOC to the \bin\ qdoc3.exe but me needed 
set another variable QTDOC to environment!

I'm create nev file my.prf and copy to qtAddToolEnv function, taket 1:1 from Qt5 features:

my.prf
~~~~~
...
defineTest(qtAddToolEnv) {
    for(env, 2) {
        value = $$eval($${env}.value)
        !isEmpty(value) {
            name = $$eval($${env}.name)
            equals(QMAKE_DIR_SEP, /) {
                contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
                else: infix =
                val = "$$name=$$join(value, :)$$infix"
            } else {
                # Escape closing parens when expanding the variable, otherwise cmd confuses itself.
                contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
                else: infix =
                val = "(set $$name=$$join(value, ;)$$infix) &"
            }
            contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
            else: val ~= s,\\\$,\$\$,g
            $$1 = "$$val $$eval($$1)"
        }
    }
    export($$1)
}
...

doc.pri
~~~~~
...
QTDOC = $$[QT_INSTALL_DOCS]
QTDOC = $$replace(QTDOC, \\\\, /)

QDOCCONF = <path/to/my/qcod>/my.qdocconf

include($$<path/to/my/prf>/my.prf) 

qtPrepareTool(QDOC, qdoc3)

#!!! Here I assume that this function should be exported to environment the path to Qt doc.
# i.e. equal: set G:/Qt/Qt4.8.3/doc !!!
qtAddToolEnv(QTDOC, $$QTDOC)

docs_target.target = docs
docs_target.commands = "cd $$[QT_INSTALL_PREFIX] && $$QDOC $$QDOCCONF"

QMAKE_EXTRA_TARGETS = docs_target
...

my.qdocconf:
~~~~~~~~~~
...
indexes = $QTDOC/html/qt.index
...


Then Makefile will generate:
...
docs:
	cd G:\Qt\Qt4.8.3 && .\bin\qdoc3.exe G:/git/ng/qtserialport/doc/serialport.qdocconf
...


Now, when I try do: $mingw32-make docs, then I receive error: 

"
<path/to/my/qdocconf>/my.qdocconf:11: error: Environment variable '
QTDOC' undefined
Environment variable 'QTDOC' undefined
"

I still do not understand how to set the desired environment variable QTDOC during the assembly of 
the documentation?






30.11.2012, 14:27, "Oswald Buddenhagen" <oswald.buddenhagen at digia.com>:
> On Fri, Nov 30, 2012 at 11:50:17AM +0400, Denis Shienkov wrote:
>
>>  30.11.2012, 02:31, "Lincoln Ramsay" <a1291762 at gmail.com>:
>>> docs_target.commands = "$$set QTDOC=$$QTDOC && $$QDOC3 $$QDOCCONF"
>>  Also this solution on Windows does not work either. I already checked... When is this solution, Makefile contains a target:
>>
>>  ...
>>  docs:
>>          set QTDOC=G:/Qt/Qt4.8.3/doc && G:\Qt\Qt4.8.3\bin\qdoc3.exe <path/to/my/qdocconf>my.qdocconf
>>  ...
>>
>>  But linking qt.index file does not happens.
>
> of course it doesn't. the whole line is a single set statement as far as
> nmake is concerned.
>
> see what qmake does nowadays. qtPrepareTool() and called functions - all
> in qtbase/mkspecs/features/qt_functions.prf.
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list