Page 1 of 1

codelite and QT

Posted: Thu Jul 17, 2008 11:12 pm
by sawerset
How to compile and execute QT project in Codelite?

Re: codelite and QT

Posted: Thu Jul 17, 2008 11:45 pm
by eranif
Hi,

Are you using qmake?

Eran

Re: codelite and QT

Posted: Fri Jul 18, 2008 7:39 pm
by sawerset
Yes I am using qmake.

Re: codelite and QT

Posted: Fri Jul 18, 2008 7:49 pm
by eranif
In that case:

Note: I am assuming that your qmake generate a GNU makefile

- Right click on your project and select 'Settings'
- Select the 'Custom Build' tab
- Enable the checkbox that says: 'Enable custom build'
- In the 'Build Command' type: make
- In the 'Clean Command' type: make clean
- In 'Makefile Generators' select: QMake
- The 'Command to use for makfile generation' (which is now enabled) type the command for qmake: (e.g. qmake)
- Click 'OK'

Now, when right clicking in your project, you have a new option 'Run Qmake'
- Right click on your project and select the 'Run Qmake' - codelite will now run qmake to generate the makefile (this step can be done only once)
- Build your project using F7 or right click -> build

HTH,
Eran

Re: codelite and QT

Posted: Sat Jul 19, 2008 12:39 am
by sawerset
thanks.

Re: codelite and QT

Posted: Sun Sep 21, 2008 7:31 pm
by aaulia
Hi there eranif, sorry to bump old post, but recently I tried Qt and fall in love with it, In the past I have been wxWidgets user, but after seeing how simple Qt way is, I just couldn't help it :mrgreen: , anyway one of the obstacle for me (well for everybody I guess), is the qmake system, I have tested your guide from this thread, but I failed, it says:
Building:
qmake
----------Building project:[ FindDialog - ]----------
Failed to start build process, command: qmake, process terminated with exit code: 0
I have try entering QTDIR, QMAKESPEC, and PATH to Qt in the Environment Variable setting in CodeLite, but no luck, could you help, or should I modify the global environment variable in windows ?

EDIT:
Sorry, I have success building the project :D, it turns out, I enter the wrong path for Qt's bin dir in the PATH environment variable :D. Anyway it's allright now, but I still have question and request, the qmake is 2 step process, but the codelite only handle 1 step, typically in qmake is like this:

Code: Select all

C:\Foo\>qmake -project
C:\Foo\>qmake
C:\Foo\>mingw32-make
But codelite only allow, either just 'qmake -project' or 'qmake' only

Re: codelite and QT

Posted: Sun Sep 21, 2008 8:10 pm
by eranif
aaulia wrote:But codelite only allow, either just 'qmake -project' or 'qmake' only
There is already feature request for this:
http://sourceforge.net/tracker/index.ph ... tid=979963

Until this is supported, you can do this:
You can define an external tool for this (available in revision > 2060):

- From Plugins -> External Tools -> Configure External Tools...
- CLick 'New'
- Select a unique ID for the tool you want. (e.g. external_tool_0)
- Give the tool a name: 'Run qmake -project'
- Select the path to qmake
- In the working directory, set the path to the .pro file - TIP: You can use macros that will be expanded by CodeLite. Lets say that your .pro file is under the workspace directory, so you can set this:
$(WorkspacePath), click the 'Help..' button to see the list of macros available.
- in the arguments field, enter: -project
- check 'capture process output' --> this will display the output of qmake -project into the 'output' tab
- Optionally, you can set icons - if non provided, CL will set the default icons for you (grey cog)
- Click OK and close the dialogs.

Now in the toolbar, you have new gray cog, when u place the mouse over it, a tip will appear with the name provided earlier: 'Run qmake -project' - click it to perform the 'qmake -project command

HTH
Eran

Re: codelite and QT

Posted: Sun Sep 21, 2008 8:41 pm
by aaulia
Nice !! :mrgreen: .
CodeLite have been amazing for me in the last month, first it's 'lite', second the refactoring rocks, third custom build system stuff, FYI there are not many IDE for windows that support this stuff, sure CB can too, but still setting up for CL is still more simple. Wow. Thanks eranif

Re: codelite and QT

Posted: Sun Sep 21, 2008 9:00 pm
by eranif
aaulia wrote:Nice !! :mrgreen: .
CodeLite have been amazing for me in the last month, first it's 'lite', second the refactoring rocks, third custom build system stuff, FYI there are not many IDE for windows that support this stuff, sure CB can too, but still setting up for CL is still more simple. Wow. Thanks eranif
Thank you for the kind words :)

Eran