Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Special build requirements for a project
Forum Updated to NodeBB v4.3 + New Features

Special build requirements for a project

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 3 Posters 3.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    theCyclist
    wrote on last edited by
    #1

    Sorry for the newbie question, I am building a Qt app that needs to interface with an Oracle database. This interface is implemented using Oracle's procC, where SQL statements can be embedded directly into the C/C++. At the moment the system works but the build process has two stages; one to compile the proc files and then the normal build process for a qt app. Could someone point me in the right direction so that I could incorporate the pro*c build commands into the .pro file? Obviously if I put these statements into the makefile then they can get removed if the makefile is rebuilt.

    Thanks in advance.

    John T,

    Be open minded but don't lean forward or your brain my fall out.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You need to look into qmake variables reference. There are quite a few to choose from, that would help you with your task, depending on the exact circumstances. Here's a "link":http://developer.qt.nokia.com/doc/qt-4.8/qmake-variable-reference.html to reference, and a few example vars that might come in handy:

      • "QMAKE_PRE_LINK":http://developer.qt.nokia.com/doc/qt-4.8/qmake-variable-reference.html#qmake-pre-link
      • "QMAKE_POST_LINK":http://developer.qt.nokia.com/doc/qt-4.8/qmake-variable-reference.html#qmake-post-link

      OF course, I assume here that you do use qmake and not other tools like scons, cmake etc.

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        theCyclist
        wrote on last edited by
        #3

        Thanks for the quick response. I am half way to the solution by doing the following.

        adding the QMAKE_PRE_LINK :
        QMAKE_PRE_LINK=proc iname=myprocfile.pc;
        gcc -c myprocfile.c

        and then:
        adding myprocfile.o to the LIBS list.

        This does make the system build with one 'make' command however the dependencies do not work; if I update the myprocfile.pc file then the make command thinks there is nothing to do and I have to delete the executable file for a successful build. This is because what I really need is a PRE_BUILD var rather than a PRE_LINK; the proc command takes a .pc file, that contains a mixture of standard C/C++ and SQL and compiles this file into a .c file that gcc can compile.

        Thanks

        John T.

        Be open minded but don't lean forward or your brain my fall out.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          That's what I suspected. I'm not an expert on qmake, though. Any possibility of switching to cmake or scons? Or maybe, creating a shell script that would fire the "SQL" build first, and then proceed with qmake one?

          (Z(:^

          1 Reply Last reply
          0
          • T Offline
            T Offline
            theCyclist
            wrote on last edited by
            #5

            [quote author="sierdzio" date="1327582767"]Or maybe, creating a shell script that would fire the "SQL" build first, and then proceed with qmake one?[/quote]

            That is of course the obvious answer but I was not going to give in so quickly ;-)

            John T.

            Be open minded but don't lean forward or your brain my fall out.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sptrakesh
              wrote on last edited by
              #6

              Maybe a simple makefile with a .c rule that works off the .pc file?

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                QMake would overwrite it.

                (Z(:^

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  theCyclist
                  wrote on last edited by
                  #8

                  I have done this for the moment:

                  As suggested I have a simple make file that builds the .c file from the oracle pro*c .pc file (oracle.mak). I have then added a new bash function called rmake which looks like this:

                  function rmake() { /usr/bin/make -f oracle.mak $@;/usr/bin/make $@;}

                  This way the dependencies are preserved and also the make clean works as well.

                  I chose the command 'rmake' as the software I am working on is modelling a radio system.

                  Thanks for your time Professor Sierdzio, it is very much appreciated.

                  John T

                  PS I should also add that I have removed the QMAKE_PRE_LINK stuff from my .pro file.

                  Be open minded but don't lean forward or your brain my fall out.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved