From 3eddec871a91d958c90155195d3545a201d1c039 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Dec 2013 17:13:23 +0000 Subject: [PATCH] From Kristofer Tingdahl, "the syntax of the moc executable has changed between 5.1.1 and 5.2.0 versions of qt (see below). The difference is that the argument has become mandatory after the -f option. Hence, moc will complain when osg throws in a -f without anything after it. Hence I propose removing the -f on Qt5 builds. I have tested building without -f on both qt520 and qt511, and that works well. The attached src/osgQt/CMakeLists.txt that can be patched into 3.2 safely. For the trunk, I would consider dropping the check on the version, and simply remove the option on qt5. I have tested that on qt5.1.1, and that worked fine. Question is however if it works on qt5.0. Probably it does, so the question is simplicity of CMakeList.txt vs safety." --- src/osgQt/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osgQt/CMakeLists.txt b/src/osgQt/CMakeLists.txt index 43afffeeb..e069bc46b 100644 --- a/src/osgQt/CMakeLists.txt +++ b/src/osgQt/CMakeLists.txt @@ -13,7 +13,11 @@ SET(SOURCES_H ) IF ( Qt5Widgets_FOUND ) - QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" ) + if (Qt5Widgets_VERSION VERSION_LESS 5.2.0) + QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" ) + else() + QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} ) + endif() ELSE() QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" ) ENDIF()