On Friday 18 Jun 2010 20:10:16 Maxim Gammer wrote: > error: > Scanning dependencies of target osgQt > [ 98%] Building CXX object > src/osgQt/CMakeFiles/osgQt.dir/QFontImplementation.o [ 98%] Building CXX > object src/osgQt/CMakeFiles/osgQt.dir/QGraphicsViewAdapter.o [ 98%] > Building CXX object src/osgQt/CMakeFiles/osgQt.dir/QWidgetImage.o [ 98%] > Building CXX object > src/osgQt/CMakeFiles/osgQt.dir/__/__/include/osgQt/moc_QGraphicsViewAdapter > .o > /home/maximum2000/DEVELOP/OpenSceneGraph-2.9.8/tempo/src/osgQt/__/__/inclu > de/osgQt/moc_QGraphicsViewAdapter.cxx:11:2: error: #error "The header file > 'QGraphicsViewAdapter' doesn't include <QObject>."
The attached file fixes the build error reported by Maxim Gammer. In out-of- source build moc has difficulties with header files that do not end in ".h". Force moc to include any files passed to it. Regards, Magnus
IF(DYNAMIC_OPENSCENEGRAPH) ADD_DEFINITIONS(-DOSGQT_LIBRARY) ELSE() ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ENDIF() SET(LIB_NAME osgQt) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(SOURCES_H ${HEADER_PATH}/QGraphicsViewAdapter ) QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" ) SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/Export ${HEADER_PATH}/QFontImplementation ${HEADER_PATH}/QGraphicsViewAdapter ${HEADER_PATH}/QWidgetImage ${HEADER_PATH}/QWebViewImage ) # FIXME: For OS X, need flag for Framework or dylib ADD_LIBRARY(${LIB_NAME} ${OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC} ${LIB_PUBLIC_HEADERS} QFontImplementation.cpp QGraphicsViewAdapter.cpp QWidgetImage.cpp ${SOURCES_H_MOC} ${OPENSCENEGRAPH_VERSIONINFO_RC} ) LINK_INTERNAL(${LIB_NAME} osgWidget osgDB osgUtil osg OpenThreads ) IF(CMAKE_COMPILER_IS_GNUCXX) # Remove -pedantic flag as it barfs on Qt headers STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ENDIF() TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY}) INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) LINK_CORELIB_DEFAULT(${LIB_NAME}) INCLUDE(ModuleInstall OPTIONAL)
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org