3
votes

How do I get qmake to include the stxxl.mk file into the generated makefiles?

I have a Qt project, which deals with large files (>RAM) and therefore want to employ STXXL. The STXXL documentation says:

Building an Application

After compiling the library, some Makefile variables are written to stxxl.mk [...] in your STXXL_ROOT directory. This file should be included from your application's Makefile.

Of course I can edit the makefile by hand to add the line include /path/to/stxxl.mk but it is very tedious to do this everytime the .pro file and hence the makefiles change.

I already searched for some solutions with qmake commands in the .pro file, but to no avail. In one forum they suggested to edit the qmake source and recompile it, but this is no choice if the program will be distributed to others, who do not have this "fix" in their qmake.

Maybe I am thinking to complicated and there is a simple solution. I hope there are some people here who did solve this problem, when working with this combination (Qt + STXXL).

Note This question Prepend/Append Makefile to a Qt generated Makefile was asking for quite the same but the solution does not fit to my problem.

1

1 Answers

2
votes

For now I have settled with the following solution:

As the stxxl.mk file contains "valid qmake code" (it assigns to variables), I use include(stxxl.mk) to import these variables. So my resulting project file contains:

include(/path/to/stxxl.mk)
QMAKE_CXXFLAGS += $$STXXL_CPPFLAGS_STXXL
LIBS += $$STXXL_LDLIBS_STXXL

These were the only variables of stxxl.mk that were used in the documentation so I used them and it works.