Results 1 to 11 of 11

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

  1. #1
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    Greetings.

    I want qmake to generate the Makefile with the following line preceding all other commands:
    Qt Code:
    1. include $(ORACLE_HOME)/precomp/env_precomp.mk
    To copy to clipboard, switch view to plain text mode 
    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?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    make changes to the qmake code to include your line at the end

  3. #3
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    Quote Originally Posted by talk2amulya View Post
    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.

  4. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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 :]
    Last edited by faldzip; 20th May 2009 at 15:47.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  5. #5
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    Quote Originally Posted by faldżip View Post
    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...

  6. #6
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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:
    Qt Code:
    1. g++ -c -o project.o @QMAKE_CXXFLAGS@ -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -I@BUILD_PATH@/include
    2. -I@BUILD_PATH@/include/QtCore -I@BUILD_PATH@/src/corelib/global -I@SOURCE_PATH@/src/script -DQT_NO_PCRE -DQT_BUILD_QMAKE
    3. -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
    4. -DQT_NO_GEOM_VARIANT project.cpp
    To copy to clipboard, switch view to plain text mode 

    How am I supposed to compile and build qmake?

  7. #7
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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 :]
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  8. #8
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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:

    Qt Code:
    1. WARNING: Failure to find: qbitarray.cpp
    2. WARNING: Failure to find: qbuffer.cpp
    3. WARNING: Failure to find: qbytearray.cpp
    4. ...
    5. +30 messages like that and aborts
    To copy to clipboard, switch view to plain text mode 

    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?
    Last edited by paulocarvalho_br_2009; 21st May 2009 at 14:07.

  9. #9
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  10. The following user says thank you to faldzip for this useful post:

    paulocarvalho_br_2009 (21st May 2009)

  11. #10
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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>?

  12. #11
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qmake] Generate Makefile with include $(ORACLE_HOME)/precomp/env_precomp.mk

    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.

Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  2. Replies: 3
    Last Post: 6th February 2008, 12:53
  3. Error: Using Multiple files
    By 3nc31 in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 09:23
  4. Generate a correct makefile
    By SteM in forum Installation and Deployment
    Replies: 13
    Last Post: 22nd October 2007, 08:58
  5. use button from another Window
    By raphaelf in forum Qt Programming
    Replies: 11
    Last Post: 2nd March 2006, 20:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.