Author Topic: SlickEdit project & Qt/moc  (Read 5866 times)

bduncan

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
SlickEdit project & Qt/moc
« on: August 24, 2006, 06:09:03 pm »
Is there a way to set up custom build commands and file dependencies.
I want to run a .h file through Qt's moc pre-processor, which generates a .cpp file that gets compiled into the project.
In VC++, I'd set a custom build command on the .h, add the generated .cpp, and set a custom dependency between the .h and the .cpp.
Is this possible with SlickEdit's auto-maintained build, or do I need to set up a Makefile.
I'm on Linux by the way.

Thanks.

Exolon

  • Community Member
  • Posts: 29
  • Hero Points: 3
Re: SlickEdit project & Qt/moc
« Reply #1 on: August 25, 2006, 06:33:43 am »
Hi,

we work with SlickEdit under Windows and Mac on a large Qt Project. For windows you can create a vs solution via Qt's qmake (sln file) from your PRO File.
(e.g. qmake -tp vc "MyTool.pro" -recursive QMAKE_INCDIR_QT=$(QTDIR)\include QMAKE_LIBDIR_QT=  QMAKE_LIBDIR=$(QTDIR)\lib QMAKE_UIC=$(QTDIR)\bin\uic.exe QMAKE_MOC=$(QTDIR)\bin\moc.exe QMAKE_RCC=$(QTDIR)\bin\rcc.exe QMAKE_QMAKE=$(QTDIR)\bin\qmake.exe)

and open this SLN File within Slickedit. All UICs and MOCs are included.

Unfortunately SlickEdit is not able to work with XCode Projects correctly. Therefor you best create a makefile from your pro (qmake -spec macx-g++) and use the GCC Project feature of Slickedit.

Cheers

Mike

bduncan

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: SlickEdit project & Qt/moc
« Reply #2 on: August 25, 2006, 04:41:38 pm »
Thanks Mike.

I did figure out a reasonably good solution yesterday that lets you use slickedit auto-maintained makefiles.

Under Project Settings, select the Build tab and choose
"Build with an auto-generated, auto-maintained makefile"
This will add a Makefile to your project.

In the Tools tab, select the Build tool, and in the "Command line",
add "all" to the end of the make command:
gmake -f "%rp%rn.mak" CFG=%b all

This is important because we'll be adding makefile targets that come before the 'all' target, so we need to tell
'make' to specifically build the 'all' target.

Now you just have to edit the Makefile to add the rules/dependencies for using 'moc'.  You do this
in the 'user-editable' area so SlickEdit keeps your changes to the file.

# -----Begin user-editable area-----
src/moc_myWindow.cpp : src/myWindow.h
   moc -o src/moc_myWindow.cpp src/myWindow.h
# -----End user-editable area-----


You'll want to make a src/moc_myWindow.cpp file and add it to your project so SlickEdit builds it with the regular build process.


Seems to be a reasonable workaround for not being able to do it directly in slickedit.