Hi Robert,
the patch I sent to src/osgQt/CMakeModules.txt did not do the work on
windows. I have fixed that, and also made it more generic so there is no
special handling of qt5.2, but all qt5 are the same.
I have tested this on:
mac/qt5.2
linux/qt5.2
windows/qt5.2, and
mac/qt5.1
All platforms perform as expected.
The previous fix removed the -f flag to the moc-pre-processor, but on
windows, it turned out that -f "osgQt/QGraphicsViewer" was needed.
This becomes an include-statement in the file generated by moc which is
needed for compiling it. I ask you consider this patch for the trunk and
the 3.2 branch.
Secondly, I wonder if it would be possible to apply my patch for
FindRSVG.cmake from 22nd November in the 3.2 branch.
In short, the version of librsvg must be equal or higher to 2.35:
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
Sincerely,
Kristofer Tingdahl
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
)
IF ( Qt5Widgets_FOUND )
QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS
"-fosgQt/QGraphicsViewAdapter" )
ELSE()
QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" )
ENDIF()
SET(TARGET_H
${HEADER_PATH}/Export
${HEADER_PATH}/GraphicsWindowQt
${HEADER_PATH}/QFontImplementation
${HEADER_PATH}/QGraphicsViewAdapter
${HEADER_PATH}/QWidgetImage
${HEADER_PATH}/QWebViewImage
)
# FIXME: For OS X, need flag for Framework or dylib
SET(TARGET_SRC
GraphicsWindowQt.cpp
QFontImplementation.cpp
QGraphicsViewAdapter.cpp
QWidgetImage.cpp
${SOURCES_H_MOC}
${OPENSCENEGRAPH_VERSIONINFO_RC}
)
SET(TARGET_LIBRARIES
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()
# FIXME: This should work but something with the LINK_WITH_VARIABLES macro is
not working
#SET(TARGET_LIBRARIES_VARS
# QT_QTCORE_LIBRARY
# QT_QTGUI_LIBRARY
# QT_QTOPENGL_LIBRARY
#)
IF( QT4_FOUND )
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTOPENGL_INCLUDE_DIR} )
SET(TARGET_LIBRARIES
${TARGET_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY}
)
ENDIF( QT4_FOUND )
SETUP_LIBRARY(${LIB_NAME})
IF ( Qt5Widgets_FOUND )
qt5_use_modules( ${LIB_NAME} Widgets OpenGL )
ENDIF ( Qt5Widgets_FOUND )
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org