[CMake] QT Plugin with cmake

Patrick Noffke Patrick.Noffke at adpro.com.au
Wed Jun 7 21:53:22 EDT 2006


> > Hi,
> > 
> > In qmake .pro files exists a switch for compiling QT 
> Plugins (CONFIG +=
> > plugin). Is there any way to replicate this using cmake? I tried
> > manually setting -DQT_PLUGIN using ADD_DEFINITIONS which 
> didn't help.
> > 
> > Thanks in advance.
> > 
> > Chris
> 
> Do you have QT_NO_DEBUG defined?
> You'll need that if you want your plugin to show up in a 
> release build of the designer, regardless of platform.
> 
> Is there an easy way in CMake to add per configuration defines?
> All projects that link with the release Qt libraries should 
> have QT_NO_DEBUG defined.
> 
> Clint

I've done the following to build a QT plugin:

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

...

ADD_LIBRARY(foo SHARED ${foo_SRCS})

Regards,
Patrick


More information about the CMake mailing list