CMake macros

Here are some details on how to build and install plugins with CMake.

Get the macro.
# Tells pkg-config to read qtversion and cmake_plugin from pkg config file.
LIST(APPEND PKG_CONFIG_ADDITIONAL_VARIABLES qtversion cmake_plugin)
ADD_REQUIRED_DEPENDENCY("gepetto-viewer-corba")
# Variable GEPETTO_VIEWER_CORBA_QTVERSION contains something like 4.8.1 or 5.2.1
# Include macro GEPETTO_GUI_PLUGIN
INCLUDE(${GEPETTO_VIEWER_CORBA_PREFIX}/${GEPETTO_VIEWER_CORBA_CMAKE_PLUGIN})
Declare a C++ plugin:
GEPETTO_GUI_PLUGIN(pluginskeleton
# Use this option only if you write a plugin within
# gepetto-viewer-corba package
# INSIDE_GEPETTO_VIEWER_CORBA
# Whether to use Qt4 or Qt5
${QT4}
# List of headers that need not to be moced.
HEADERS_NO_MOC
# List of headers to be moced
HEADERS
plugin.hh
# List of Qt forms
FORMS
# List of Qt resources
RESOURCES
# List of source files
SOURCES
plugin.cc
# List of dependencies to be given to TARGET_LINK_LIBRARIES
LINK_DEPENDENCIES
# List of dependencies to be given to PKG_CONFIG_USE_DEPENDENCY
PKG_CONFIG_DEPENDENCIES
)
Declare a Python plugin:
# pythonfile refers to the path to .py file from a
# path of PYTHONPATH
GEPETTO_GUI_PYPLUGIN (pythonfile)