[CMake] My dammed problem with OSX and Qt
Leopold Palomo-Avellaneda
leo at alaxarxa.net
Wed Jan 16 14:10:15 EST 2008
A Dimecres 16 Gener 2008, clinton at elemtech.com va escriure:
> On Wednesday 16 January 2008 11:05:04 am Leopold Palomo-Avellaneda wrote:
> > Linking CXX shared library libpluginregistrodeiva.dylib
> > Undefined symbols:
>
> [snip]
>
> > "FichaBc::qt_metacall(QMetaObject::Call, int, void**)", referenced
> > from: vtable for RegistroIvain registroiva.o
> > RegistroIvaView::qt_metacall(QMetaObject::Call, int, void**)in
> > moc_registroivaview.o
>
> Unresolved vtables in Qt code usually means you forgot to run moc on the
> header file and include it in the build. If that's it, it can be done by
> the QT4_WRAP_CPP macro. On Linux, you might see that problem at run time
> with a crash.
I fill the moc files by a glob. I thought it, but I didn't find any crash .
The complete CMakeList is:
###########################################
# Plugin for bulmacont #
###########################################
#pluginregistrodeiva
set (plugin pluginregistrodeiva)
file(GLOB plugin_SRC *.c *.cpp *.cxx)
file(GLOB plugin_MOCS *.hpp *.h)
file(GLOB plugin_UIS *.ui)
set(QT_USE_QTASSISTANT true)
set(QT_USE_QTXML true)
INCLUDE( ${QT_USE_FILE} )
include_directories(
${QT_INCLUDE_DIR}
${PGSQL_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR}
${QT_QTASSISTANT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/bulmalib/src/
${CMAKE_SOURCE_DIR}/bulmalib/src/
${CMAKE_BINARY_DIR}/bulmacont/src/
${CMAKE_SOURCE_DIR}/bulmacont/src/)
# generate rules for building source files that moc generates
QT4_WRAP_UI(plugin_UIS_H ${plugin_UIS})
QT4_WRAP_CPP(plugin_MOC_SRCS ${plugin_MOCS})
#ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_SHARED)
# build sources, moc'd sources, and rcc'd sources
add_library(${plugin} SHARED ${plugin_SRC} ${plugin_MOC_SRCS}
${plugin_UIS_H} ${plugin_SRCS} ${plugin_MOCS})
set_target_properties( ${plugin} PROPERTIES
SOVERSION "${BULMAGES_VERSION_MAJOR}.${BULMAGES_VERSION_MINOR}"
VERSION "${BULMAGES_VERSION}")
target_link_libraries(${plugin} bulmalib ${QT_LIBRARIES} ${PGSQL_LIBRARIES})
install_targets(/lib/bulmacont/plugins ${plugin})
add_dependencies(${plugin} bulmacont bulmalib)
More information about the CMake
mailing list