Re: [CMake] Problems with CMake and static Qt plugins

2012-10-29 Thread dcrespol
Stephen Kelly-2 wrote
> Use 
> 
>  add_definitions(-DQT_STATICPLUGIN)
> 
> when building your plugin

Perfect. Now it works. For some reason I was using that line in the
application build that links to the plugin. Thanks a lot!

-Daniel



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Problems-with-CMake-and-static-Qt-plugins-tp7336619p7582210.html
Sent from the CMake mailing list archive at Nabble.com.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with CMake and static Qt plugins

2012-10-29 Thread Stephen Kelly
dcrespol wrote:

> Hi, norulez.
> With "@Thiago: QT_STATICPLUGIN does the trick ", what do you mean? How and
> where did you use this?
> If possible, can you please include both your final plugin and application
> CMakeLists.txt files?

It was probably a response to Thiago on the Qt mailing list. 

Use 

 add_definitions(-DQT_STATICPLUGIN)

when building your plugin or 

 set_property(TARGET theplugin APPEND 
   PROPERTY COMPILE_DEFINITIONS QT_STATICPLUGIN
 )


Thanks,

Steve.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with CMake and static Qt plugins

2012-10-29 Thread dcrespol
Hi, norulez.
With "@Thiago: QT_STATICPLUGIN does the trick ", what do you mean? How and
where did you use this?
If possible, can you please include both your final plugin and application
CMakeLists.txt files?

Thanks a lot,
-Daniel



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Problems-with-CMake-and-static-Qt-plugins-tp7336619p7582208.html
Sent from the CMake mailing list archive at Nabble.com.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with CMake and static Qt plugins

2012-03-04 Thread norulez
@Michael: This was a copy/paste failure

@Thiago: QT_STATICPLUGIN does the trick

Another mistake from me was to use a different name for Q_IMPORT_PLUGIN and for 
Q_EXPORT_PLUGIN2.

One more hint, if someone would make a static plugin is to use the 
QPluginLoader::staticInstances() function.

Thanks to all

Best Regards
NoRulez

Am 04.03.2012 um 00:07 schrieb Michael Hertling :

> On 03/02/2012 02:48 PM, NoRulez wrote:
>> Hello,
>> 
>> I use Qt 4.8.0 from the QtSDK and Iwant to generate a static qt plugin.
>> In my main.cpp I have the following:
>> 
>> 
>> #include
>> #include
>> 
>> Q_IMPORT_PLUGIN(Local)
>> 
>> intmain(intargc,char*argv[]){
>> QApplicationapp(argc,argv);
>> 
>> .
>> .
>> .
>>return  app.exec();
>> 
>> }
>> 
>> The corresponding CMakeLists.txt for the LocalPlugin looks like the 
>> following:
>> 
>> SET(LOCALPLUGIN_HEADERS
>> 
>> LocalPlugin.h
>> 
>> )
>> 
>> SET(LOCALPLUGIN_SOURCES
>> 
>> LocalPlugin.cpp
>> 
>> )
>> 
>> 
>> SET(QT_USE_QTGUITRUE)
>> SET(QT_USE_QTPLUGINTRUE)
>> 
>> QT4_AUTOMOC(${LOCALPLUGIN_SOURCES})
>> QT4_WRAP_CPP(LOCALPLUGIN_MOC${LOCALPLUGIN_HEADERS})
>> 
>> ADD_LIBRARY(Local  STATIC  ${LOCALPLUGIN_HEADERS}  ${LOCALPLUGIN_SOURCES}  
>> ${LOCALPLUGIN_MOC})
>> 
>> TARGET_LINK_LIBRARIES(Local  ${QT_LIBRARIES})
>> 
>> 
>> The corresponding CMakeLists.txt for the main app looks like the following:
>> 
>> SET(QT_USE_QTMAINTRUE)
>> 
>> SET(QT_USE_QTGUI  TRUE)
>> 
>> ADD_EXECUTABLE(MyApp WIN32  ${APP_SOURCES}  ${APP_RCC}  MyApp.rc)
>> TARGET_LINK_LIBRARIES(MyAppLocal  ${QT_LIBRARIES})
>> 
>> When I compile it I get the following error:
>> In function `StaticLocalPluginInstance': undefined reference to 
>> `qt_plugin_instance_Local()'
>> 
>> Please, could anybody help me to get it working?
> 
> Did you INCLUDE(${QT_USE_FILE}) in the correct place, i.e. after
> setting the QT_USE_QT* variables? QT_LIBRARIES is populated in
> that file.
> 
> Moreover, the lines
> 
> SET(QT_USE_QTGUITRUE)
> SET(QT_USE_QTMAINTRUE)
> SET(QT_USE_QTPLUGINTRUE)
> QT4_WRAP_CPP(LOCALPLUGIN_MOC${LOCALPLUGIN_HEADERS})
> 
> are obviously missing blanks - just typos in your report?
> 
> Regards,
> 
> Michael
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with CMake and static Qt plugins

2012-03-03 Thread Michael Hertling
On 03/02/2012 02:48 PM, NoRulez wrote:
> Hello,
> 
> I use Qt 4.8.0 from the QtSDK and Iwant to generate a static qt plugin.
> In my main.cpp I have the following:
> 
> 
> #include
> #include
> 
> Q_IMPORT_PLUGIN(Local)
> 
> intmain(intargc,char*argv[]){
> QApplicationapp(argc,argv);
> 
>  .
>  .
>  .
> return  app.exec();
> 
> }
> 
> The corresponding CMakeLists.txt for the LocalPlugin looks like the following:
> 
> SET(LOCALPLUGIN_HEADERS
> 
>  LocalPlugin.h
> 
> )
> 
> SET(LOCALPLUGIN_SOURCES
> 
>  LocalPlugin.cpp
> 
> )
> 
> 
> SET(QT_USE_QTGUITRUE)
> SET(QT_USE_QTPLUGINTRUE)
> 
> QT4_AUTOMOC(${LOCALPLUGIN_SOURCES})
> QT4_WRAP_CPP(LOCALPLUGIN_MOC${LOCALPLUGIN_HEADERS})
> 
> ADD_LIBRARY(Local  STATIC  ${LOCALPLUGIN_HEADERS}  ${LOCALPLUGIN_SOURCES}  
> ${LOCALPLUGIN_MOC})
> 
> TARGET_LINK_LIBRARIES(Local  ${QT_LIBRARIES})
> 
> 
> The corresponding CMakeLists.txt for the main app looks like the following:
> 
> SET(QT_USE_QTMAINTRUE)
> 
> SET(QT_USE_QTGUI  TRUE)
> 
> ADD_EXECUTABLE(MyApp WIN32  ${APP_SOURCES}  ${APP_RCC}  MyApp.rc)
> TARGET_LINK_LIBRARIES(MyAppLocal  ${QT_LIBRARIES})
> 
> When I compile it I get the following error:
> In function `StaticLocalPluginInstance': undefined reference to 
> `qt_plugin_instance_Local()'
> 
> Please, could anybody help me to get it working?

Did you INCLUDE(${QT_USE_FILE}) in the correct place, i.e. after
setting the QT_USE_QT* variables? QT_LIBRARIES is populated in
that file.

Moreover, the lines

SET(QT_USE_QTGUITRUE)
SET(QT_USE_QTMAINTRUE)
SET(QT_USE_QTPLUGINTRUE)
QT4_WRAP_CPP(LOCALPLUGIN_MOC${LOCALPLUGIN_HEADERS})

are obviously missing blanks - just typos in your report?

Regards,

Michael
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Problems with CMake and static Qt plugins

2012-03-02 Thread NoRulez
Hello,I use Qt 4.8.0 from the QtSDK and I want to generate a static qt plugin.In my main.cpp I have the following:#include #include 

Q_IMPORT_PLUGIN(Local)int main(int argc, char* argv[]) {    QApplication app(argc, argv);
...
    return app.exec();}The corresponding CMakeLists.txt for the LocalPlugin looks like the following:SET(LOCALPLUGIN_HEADERS

LocalPlugin.h

)

SET(LOCALPLUGIN_SOURCES

LocalPlugin.cpp

)SET(QT_USE_QTGUI TRUE)SET(QT_USE_QTPLUGIN TRUE)QT4_AUTOMOC(${LOCALPLUGIN_SOURCES})QT4_WRAP_CPP(LOCALPLUGIN_MOC ${LOCALPLUGIN_HEADERS})

ADD_LIBRARY(Local STATIC ${LOCALPLUGIN_HEADERS} ${LOCALPLUGIN_SOURCES} ${LOCALPLUGIN_MOC})
TARGET_LINK_LIBRARIES(Local ${QT_LIBRARIES})The corresponding CMakeLists.txt for the main app looks like the following:SET(QT_USE_QTMAIN TRUE)
SET(QT_USE_QTGUI TRUE)ADD_EXECUTABLE(MyApp WIN32 ${APP_SOURCES} ${APP_RCC} MyApp.rc)TARGET_LINK_LIBRARIES(MyApp Local ${QT_LIBRARIES})When I compile it I get the following error:In function `StaticLocalPluginInstance': undefined reference to `qt_plugin_instance_Local()'Please, could anybody help me to get it working?Thanks in advanceBest RegardsNoRulez--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake