PDA

View Full Version : [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk



paulocarvalho_br_2009
19th May 2009, 19:21
Greetings.

I want qmake to generate the Makefile with the following line preceding all other commands:

include $(ORACLE_HOME)/precomp/env_precomp.mk
This is needed so the program can access Oracle databases. Every time I run qmake, I have to edit the generated Makefile to include that line.

Is there a way to atomatically include that line for every qmake run?

talk2amulya
20th May 2009, 13:55
make changes to the qmake code to include your line at the end

paulocarvalho_br_2009
20th May 2009, 15:44
make changes to the qmake code to include your line at the end

What changes? By far I don't know any function or variable in the qmake documentation that seems to make a direct output to the generated Makefile. I want something that does the same thing as message() but instead of printing to console it prints to the Makefile.

faldzip
20th May 2009, 16:36
talk2amulya said about changing qmake source code. you can add your own function, or modify message() to print to make file instead of console or something like this...

I don't know where exactly in your makefile your addidtional line should be but maybe modifying writeHeader() method in makefile.cpp in qmake sources (QTDIR/qmake/qmake.pro) can be enough.

P.S. or try Win32MakefileGenerator::writeStandardParts() or something like this :]

paulocarvalho_br_2009
20th May 2009, 18:02
talk2amulya said about changing qmake source code. you can add your own function, or modify message() to print to make file instead of console or something like this...

I don't know where exactly in your makefile your addidtional line should be but maybe modifying writeHeader() method in makefile.cpp in qmake sources (QTDIR/qmake/qmake.pro) can be enough.

P.S. or try Win32MakefileGenerator::writeStandardParts() or something like this :]
Oh yes, it's open source, I forgot... That's somewhat extreme, but if it solves the problem, that's good. I'll try it right now and share the results here...

paulocarvalho_br_2009
20th May 2009, 22:54
1) Donwloaded source code = OK;
2) Renamed Makefile.unix -> Makefile = OK;
3) ran make. Got error: g++: cannot specify -o with -c or -S and multiple compilations.
Command line:

g++ -c -o project.o @QMAKE_CXXFLAGS@ -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -I@BUILD_PATH@/include
-I@BUILD_PATH@/include/QtCore -I@BUILD_PATH@/src/corelib/global -I@SOURCE_PATH@/src/script -DQT_NO_PCRE -DQT_BUILD_QMAKE
-DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT
-DQT_NO_GEOM_VARIANT project.cpp

How am I supposed to compile and build qmake?

faldzip
21st May 2009, 00:51
I guess you already have Qt with qmake, so just go to the qmake project dir (where qmake.pro is) and run qmake, then make :]

paulocarvalho_br_2009
21st May 2009, 14:56
Ok, I deleted the Makefile copied from Makefile.unix and some .o files generated, so I have an original source folder of qmake.

Changed current directory to ~/qt-x11-opensource-src-4.5.1/qmake/.

ran qmake on qmake.pro, got errors:


WARNING: Failure to find: qbitarray.cpp
WARNING: Failure to find: qbuffer.cpp
WARNING: Failure to find: qbytearray.cpp
...
+30 messages like that and aborts


The qmake used is installed somewhere else and belongs to Qt version 4.5.0.

The required files are under ~/qt-x11-opensource-src-4.5.1/src/corelib .

How can I make my installed qmake see those files?

faldzip
21st May 2009, 16:08
quite weird because I cded into qmake dir, typed qmake and it worked :]
Maybe there is something wrong with your QT_SOURCE_TREE variable, because as I see all the paths starts with this variable?

And I think that all you need is to modify qmake.pro where some paths to corelib directory are.

paulocarvalho_br_2009
21st May 2009, 16:21
By reading qmake.pro, one realizes that QT_SOURCE_TREE is supposed to be initialized somewhere else.

Of course when I try to qmake qmake.pro, QT_SOURCE_TREE is empty, thus qmake fails.

Questions:
1) Should I build the entire Qt and/or run the configure script?
2) Should I run some other script? I didn't find any shell scripts in qmake source directory.
3) Is it enough to export QT_SOURCE_TREE=<qt source parth>?

paulocarvalho_br_2009
21st May 2009, 17:52
Reading the INSTALL text file I realized I had to run the configure file in order to prepare the sources for building, even if I just want to build qmake. Please, forgive my "newbieness". qmake was succesfully built according to your instructions. Thanks. Now I will work on the source code and, if I get something useful, I'll share it with the community.