diff --git a/include/osgQt/GraphicsWindowQt b/include/osgQt/GraphicsWindowQt index 30924675c..09bbac9f6 100644 --- a/include/osgQt/GraphicsWindowQt +++ b/include/osgQt/GraphicsWindowQt @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/include/osgQt/QFontImplementation b/include/osgQt/QFontImplementation index 4bc45dc7e..36942c22e 100644 --- a/include/osgQt/QFontImplementation +++ b/include/osgQt/QFontImplementation @@ -15,6 +15,7 @@ #include #include +#include #include diff --git a/include/osgQt/QGraphicsViewAdapter b/include/osgQt/QGraphicsViewAdapter index 8a8a483c3..62fd46496 100644 --- a/include/osgQt/QGraphicsViewAdapter +++ b/include/osgQt/QGraphicsViewAdapter @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/include/osgQt/QWebViewImage b/include/osgQt/QWebViewImage index de9e383aa..24d48c7e0 100644 --- a/include/osgQt/QWebViewImage +++ b/include/osgQt/QWebViewImage @@ -26,6 +26,7 @@ #include #include +#include namespace osgQt { diff --git a/include/osgQt/QWidgetImage b/include/osgQt/QWidgetImage index 89e4b2a4a..a64948de8 100644 --- a/include/osgQt/QWidgetImage +++ b/include/osgQt/QWidgetImage @@ -15,6 +15,7 @@ #define QWIDGETIMAGE #include +#include #include namespace osgQt diff --git a/src/osgQt/CMakeLists.txt b/src/osgQt/CMakeLists.txt index d631dccbf..e3b80aca1 100644 --- a/src/osgQt/CMakeLists.txt +++ b/src/osgQt/CMakeLists.txt @@ -15,10 +15,15 @@ SET(SOURCES_H IF ( Qt5Widgets_FOUND ) QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-fosgQt/QGraphicsViewAdapter" ) + set(OSGQT_QT_VERSION 5) ELSE() QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" ) + set(OSGQT_QT_VERSION 4) ENDIF() +SET(OSGQT_VERSION_HEADER "${PROJECT_BINARY_DIR}/include/osgQt/Version") +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Version.in" ${OSGQT_VERSION_HEADER}) + SET(TARGET_H ${HEADER_PATH}/Export ${HEADER_PATH}/GraphicsWindowQt @@ -26,6 +31,7 @@ SET(TARGET_H ${HEADER_PATH}/QGraphicsViewAdapter ${HEADER_PATH}/QWidgetImage ${HEADER_PATH}/QWebViewImage + ${OSGQT_VERSION_HEADER} ) diff --git a/src/osgQt/Version.in b/src/osgQt/Version.in new file mode 100644 index 000000000..dc1a673e2 --- /dev/null +++ b/src/osgQt/Version.in @@ -0,0 +1,12 @@ +#ifndef OSGQT_VERSION +#define OSGQT_VERSION + +#define OSGQT_QT_VERSION @OSGQT_QT_VERSION@ + +#include +#if (QT_VERSION < QT_VERSION_CHECK(OSGQT_QT_VERSION,0,0)) +#error "Qt version mismatch detected! Make sure to compile applications using osgQt with the same major Qt version that osgQt has been compiled against." +#endif + + +#endif