|
From: <and...@us...> - 2014-03-15 21:06:56
|
Revision: 13062
http://sourceforge.net/p/plplot/code/13062
Author: andrewross
Date: 2014-03-15 21:06:52 +0000 (Sat, 15 Mar 2014)
Log Message:
-----------
Changes to qt_example so it works (in the build tree) with Qt5. Still need to fix the install tree case.
Modified Paths:
--------------
trunk/examples/c++/CMakeLists.txt
trunk/examples/c++/qt_PlotWindow.h
Modified: trunk/examples/c++/CMakeLists.txt
===================================================================
--- trunk/examples/c++/CMakeLists.txt 2014-03-15 20:23:02 UTC (rev 13061)
+++ trunk/examples/c++/CMakeLists.txt 2014-03-15 21:06:52 UTC (rev 13062)
@@ -142,14 +142,17 @@
target_link_libraries(wxPLplotDemo plplotwxwidgets${LIB_TAG} plplotcxx${LIB_TAG} ${wxwidgets_LINK_FLAGS} ${MATH_LIB})
endif(ENABLE_wxwidgets)
-## FIXME for the case when PLPLOT_USE_QT5 is ON.
- if(ENABLE_qt AND NOT PLPLOT_USE_QT5)
+ if(ENABLE_qt)
if(CORE_BUILD)
set(BUILD_qt_example ON)
- if(NOT QT_LIBRARIES)
+ if(NOT PLPLOT_USE_QT5 AND NOT QT_LIBRARIES)
message(FATAL_ERROR "include(${QT_USE_FILE}) failed in core build examples/c++ subdirectory.")
- endif(NOT QT_LIBRARIES)
+ endif(NOT PLPLOT_USE_QT5 AND NOT QT_LIBRARIES)
else(CORE_BUILD)
+ if(PLPLOT_USE_QT5)
+ message(STATUS "WARNING: Not currently checking for Qt5 in install tree. qt_example not built")
+ set(BUILD_qt_example OFF)
+ else(PLPLOT_USE_QT5)
# Must find Qt4 all over again here rather than simply copying variables
# from the core build to this installed examples build so that we can
# access the qt4_wrap_cpp macro here.
@@ -166,8 +169,22 @@
message(STATUS "WARNING: Qt4 not found or wrong version. qt_example not built")
set(BUILD_qt_example OFF)
endif(QT4_FOUND AND QT_VERSION_MAJOR STREQUAL "${CORE_QT_VERSION_MAJOR}" AND QT_VERSION_MINOR STREQUAL "${CORE_QT_VERSION_MINOR}" AND QT_VERSION_PATCH STREQUAL "${CORE_QT_VERSION_PATCH}")
+ endif(PLPLOT_USE_QT5)
endif(CORE_BUILD)
if(BUILD_qt_example)
+ if(PLPLOT_USE_QT5)
+ qt5_wrap_cpp(
+ QT_MOC_OUTFILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/qt_PlotWindow.h
+ )
+ set_source_files_properties(
+ ${QT_MOC_OUTFILES}
+ PROPERTIES GENERATED "ON"
+ )
+ add_executable(qt_example qt_example.cpp qt_PlotWindow.cpp ${QT_MOC_OUTFILES})
+ qt5_use_modules(qt_example Svg Gui PrintSupport)
+ target_link_libraries(qt_example ${QT_LIBRARIES} plplotqt${LIB_TAG} plplot${LIB_TAG} ${qt_example_TARGETS})
+ else(PLPLOT_USE_QT5)
qt4_wrap_cpp(
QT_MOC_OUTFILES
${CMAKE_CURRENT_SOURCE_DIR}/qt_PlotWindow.h
@@ -181,6 +198,7 @@
target_link_libraries(qt_example ${QT_LIBRARIES} plplotqt${LIB_TAG} plplot${LIB_TAG})
# Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES
set_qt_target_properties(qt_example)
+ endif(PLPLOT_USE_QT5)
endif(BUILD_qt_example)
- endif(ENABLE_qt AND NOT PLPLOT_USE_QT5)
+ endif(ENABLE_qt)
endif(BUILD_TEST)
Modified: trunk/examples/c++/qt_PlotWindow.h
===================================================================
--- trunk/examples/c++/qt_PlotWindow.h 2014-03-15 20:23:02 UTC (rev 13061)
+++ trunk/examples/c++/qt_PlotWindow.h 2014-03-15 21:06:52 UTC (rev 13062)
@@ -28,14 +28,14 @@
#define PLD_qtwidget
-#include <QtGui/QApplication>
-#include <QtGui/QMainWindow>
-#include <QtGui/QAction>
-#include <QtGui/QMenuBar>
-#include <QtGui/QFileDialog>
-#include <QtGui/QPrintDialog>
-#include <QtGui/QPrinter>
-#include <QtGui/QMessageBox>
+#include <QApplication>
+#include <QMainWindow>
+#include <QAction>
+#include <QMenuBar>
+#include <QFileDialog>
+#include <QPrintDialog>
+#include <QPrinter>
+#include <QMessageBox>
#include "qt.h"
class PlotWindow : public QMainWindow
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|