[CMake] [Help] Build Qt Plugin with CMake

clinton at elemtech.com clinton at elemtech.com
Mon Feb 4 16:13:12 EST 2008


On Sunday 03 February 2008 12:18:12 pm Yang, Y. wrote:
> Hi All,
>
> when I try to build a plugin with my qt application on windows, I found
> that the dll build successfully, but when I launch my application it failed
> with a message that myplugin.dll is not a valid Qt plugin.
>
>
> The following file is my CMakeLists.txt. Is there anything wrong?
> **************************************************
> project(myplugin)
>
> set(myplugin_SRCS
>     myplugin.cpp
> )
>
> set(myplugin_MOC_HDRS
>     myplugin.h
> 	)
>
>
> include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}
> ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../core)
>
> add_definitions(${QT_DEFINITIONS})
> add_definitions(-DQT_PLUGIN)
> add_definitions(-DQT_SHARED)
> add_definitions(-DQT_NO_DEBUG)

-DQT_NO_DEBUG all the time means your plugin won't work with debug builds on 
Windows.

Clint


More information about the CMake mailing list