codelite and QT

General questions regarding the usage of CodeLite
sawerset
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2008 10:18 pm
Contact:

codelite and QT

Post by sawerset »

How to compile and execute QT project in Codelite?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: codelite and QT

Post by eranif »

Hi,

Are you using qmake?

Eran
Make sure you have read the HOW TO POST thread
sawerset
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2008 10:18 pm
Contact:

Re: codelite and QT

Post by sawerset »

Yes I am using qmake.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: codelite and QT

Post 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
Make sure you have read the HOW TO POST thread
sawerset
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2008 10:18 pm
Contact:

Re: codelite and QT

Post by sawerset »

thanks.
aaulia
CodeLite Enthusiast
Posts: 23
Joined: Wed Aug 20, 2008 10:45 pm
Contact:

Re: codelite and QT

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: codelite and QT

Post 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
Make sure you have read the HOW TO POST thread
aaulia
CodeLite Enthusiast
Posts: 23
Joined: Wed Aug 20, 2008 10:45 pm
Contact:

Re: codelite and QT

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: codelite and QT

Post 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
Make sure you have read the HOW TO POST thread
Post Reply