[Scons-users] Scons-Qt5 questions / How can I generate Qt5 files into custom directories? - How can I debug and influence file dependencies?

Marco Buczilowski marco.buczilowski at autodesk.com
Mon Jul 4 10:40:04 EDT 2016


Hello everyone,

 

three weeks ago I started evaluating Scons as build system for a medium
sized project. It all went well and I like the flexibility, which is
important, because I have to use an existing project structure. 
For the next step I have to create build scripts for the user interface
libraries, which are based upon QT version 5. This part seems to be tricky
and I'd appreciate to get some help and advice from you.

 

The project structure looks like this:

 

Static interface library

+ (Folder)header files

+ (Folder)private header files

+ (Folder)Forms (qt ui files)

+ (Folder)GeneratedFiles (moc files, ui header, processed resource files)

+ (Folder)Source

(File) qt translation file (.ts)

(File) qt resource file (.qrc)

 

What I want scons to do is:

* Search for ui files in Forms and generate headers into the GeneratedFiles
folder

* Search for translation files in project root and generate binary
translation file

* Search for qrc files in root and generate cpp files in GeneratedFiles
folder

* Use the automoc feature to moc Qt classes

* compile everything

 

I already got scons to complete single tasks, but for several reasons I
don't get it all together.

 

First important question: Is it possible and solid to generate Qt files into
a custom directory. I tried things like this:

 

> for qtUiSourceFile in qtUiSourceFiles:

>     destination_file =
File(os.path.join(os.path.join('.','GeneratedFiles'), 'ui_' +
qtUiSourceFile.name.replace('.ui', '.h')))

>     modCEnv.ExplicitUic5(destination_file, qtUiSourceFile)

 

And how would I specify the destination for moc, resource and translation
files?

 

The automoc feature seems to work fine, with the exception, that the moc
files are generated into the source directory at the moment. The same
applies to the resource files.

 

The main problem I'm struggeling with is, that SCons doesn't seem to find a
reference from the Qt widget's header file, to the generated ui header.
Maybe it has something to do with the fact, that the ui and the generated
header files are in different directories.

The reference would be:

  moc_FcQErrorLog.cc has to be compiled. it includes

  FcQErrorLog.h which includes the generated 

  ui_fby_problem_widget.h

 

SCons seems to know about the ui files, because they are part of the
dependency tree.

 

    | | | +-src_unique\L50\ Qt-Utilities\fby_qt_js.dev\Form

    | | | | +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\Form\fby_problem_widget.ui

    | | | +-src_unique\L50\ Qt-Utilities\fby_qt_js.dev\GeneratedFiles

    | | | | +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\GeneratedFiles\ui_fby_problem_widget.h

    | | | |   +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\Form\fby_problem_widget.ui

    | | | |   +-D:\dev\qt\qt_self_5.5.1_x64_msvc2013\qtbase\bin\uic.exe

 

But there's no connection between moc_FcQErrorLog.o and the generated
header. It all ends with FcQErrorLog.h

 

    | | | | +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\fby_qt_js\moc_FcQErrorLog.obj

    | | | | | +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\fby_qt_js\moc_FcQErrorLog.cc

    | | | | | | +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\fby_qt_js\FcQErrorLog.h

    | | | | | | +-D:\dev\qt\qt_self_5.5.1_x64_msvc2013\qtbase\bin\moc.exe

    | | | | | +-src_unique\L50\
Qt-Utilities\fby_qt_js.dev\fby_qt_js\FcQErrorLog.h

 

Thanks,

Marco Buczilowski

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160704/069dc742/attachment.html>


More information about the Scons-users mailing list