[CMake] dlopen()able library making

Craig Bradney cbradney at zip.com.au
Wed Apr 5 02:35:01 EDT 2006


On Wednesday 05 April 2006 02:30, you wrote:
> At 06:18 PM 4/4/2006, Craig Bradney wrote:
> >Hi,
> >
> >I'm making decent progress in the conversion of Scribus to cmake (main app
> >runs now with all dependencies found.. yay!).. but now I'm stuck up
> > against creating the dlopen()able plugins. The symbols exist but seem to
> > be marked undefined.. eg:
> >360: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZTV16ColorWheelPlugin
> >versus the autohell built one:
> >370: 000236a0   128 OBJECT  WEAK   DEFAULT   21 _ZTV16ColorWheelPlugin
>
> I would have to see the sources to give a better answer.
> But the symbol is the virtual table for the ColorWheelPlugin class:
>
> $ c++filt _ZTV16ColorWheelPlugin
> vtable for ColorWheelPlugin
>
> Can you post the CMakeLists.txt file for building this plugin?
>
> I would expect it to look something like this:
>
> SET(SRCS colorblind.cpp  colorwheelwidget.cpp  cwsetcolor.cpp
> colorwheel.cpp  cwdialog.cpp)
>
> ADD_LIBRARY(colorwheel MODULE  ${SRCS})
>
> (I looked at scribus-1.3.3.1cvs to get the sources.)
>
> -Bill

Hi Bill,

thanks for replying... yes, you guessed it pretty much:

INCLUDE_DIRECTORIES(
"${CMAKE_SOURCE_DIR}/scribus"
)
SET(COLORWHEEL_PLUGIN_MOC_CLASSES
colorblind.h
colorwheel.h
colorwheelwidget.h
cwdialog.h
cwsetcolor.h
)

SET(COLORWHEEL_PLUGIN_SOURCES
colorblind.cpp
colorwheel.cpp
colorwheelwidget.cpp
cwdialog.cpp
cwsetcolor.cpp
)

SET(SCRIBUS_COLORWHEEL_PLUGIN "colorwheel")
IF(QT_WRAP_CPP)
  SCRIBUS_QT_WRAP_CPP(${SCRIBUS_COLORWHEEL_PLUGIN} 
${COLORWHEEL_PLUGIN_MOC_CLASSES})
ENDIF(QT_WRAP_CPP)

ADD_LIBRARY(${SCRIBUS_COLORWHEEL_PLUGIN} MODULE ${COLORWHEEL_PLUGIN_SOURCES} 
${COLORWHEEL_PLUGIN_MOC_SOURCES})


So theres not much different.. apart from the moc setup which all seems to 
work fine (as it does in the main code). Perhaps the only surprise there is 
the SCRIBUS_QT_WRAP which gives me class.moc instead of moc_class.cxx files. 
This is the first plugin I've attempted to get working from all you will see 
in the plugins directory (aside from some STATIC ones not in this directory 
which work fine).

Craig


More information about the CMake mailing list