1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
cmake_minimum_required(VERSION 2.8.8)
project(ParticlesViewer)
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
if (NOT PARAVIEW_BUILD_QT_GUI)
message(FATAL_ERROR
"ParticlesViewer example requires PARAVIEW_BUILD_QT_GUI to be enabled. "
"Please rebuild ParaView (or point to a different build of ParaView) "
"with PARAVIEW_BUILD_QT_GUI set to TRUE")
endif()
# Set a consistent MACOSX_RPATH default across all CMake versions.
# When CMake 2.8.12 is required, change this default to 1.
# When CMake 3.0.0 is required, remove this block (see CMP0042).
if(NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH 0)
endif()
include(ParaViewBranding)
include(ParaViewPlugins)
# This application demostrates following concepts:
# * Building user interface through a plugin
# * Loading startup plugins
# * Changing default ParaView behavior for creating representations
SET (SOURCE_FILES
ParticlesViewerStarter.cxx
ParticlesViewerDisplayPolicy.cxx
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
QT5_WRAP_CPP(MOC_SRCS
ParticlesViewerStarter.h
ParticlesViewerDisplayPolicy.h
)
QT5_WRAP_UI(UI_BUILT_SOURCES
ParticlesViewerMainWindow.ui
)
else ()
QT4_WRAP_CPP(MOC_SRCS
ParticlesViewerStarter.h
ParticlesViewerDisplayPolicy.h
)
QT4_WRAP_UI(UI_BUILT_SOURCES
ParticlesViewerMainWindow.ui
)
endif ()
ADD_PARAVIEW_AUTO_START(IFACES IFACE_SRCS
CLASS_NAME ParticlesViewerStarter
STARTUP startApplication
SHUTDOWN stopApplication)
ADD_PARAVIEW_PLUGIN(ParticlesViewerPlugin "1.0"
GUI_INTERFACES ${IFACES}
GUI_SOURCES ${IFACE_SRCS} ${SOURCE_FILES} ${MOC_SRCS} ${UI_BUILT_SOURCES})
target_link_libraries(ParticlesViewerPlugin
LINK_PRIVATE pqApplicationComponents)
#------------------------------------------------------------------------------
# Build the client
build_paraview_client(particles_viewer
TITLE "Particles Viewer (ParaView-based Example Application)"
ORGANIZATION "Particles Viewer Coorporation"
VERSION_MAJOR 1
VERSION_MINOR 0
VERSION_PATCH 0
REQUIRED_PLUGINS ParticlesViewerPlugin
PointSprite_Plugin
GUI_CONFIGURATION_XMLS
${CMAKE_CURRENT_SOURCE_DIR}/SupportedReader.xml
)
|