CMake macros

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

Get the macro.
1 # Tells pkg-config to read qtversion and cmake_plugin from pkg config file.
2 LIST(APPEND PKG_CONFIG_ADDITIONAL_VARIABLES qtversion cmake_plugin)
3 
4 ADD_REQUIRED_DEPENDENCY("gepetto-viewer-corba")
5 
6 # Variable GEPETTO_VIEWER_CORBA_QTVERSION contains something like 4.8.1 or 5.2.1
7 
8 # Include macro GEPETTO_GUI_PLUGIN
9 INCLUDE(${GEPETTO_VIEWER_CORBA_PREFIX}/${GEPETTO_VIEWER_CORBA_CMAKE_PLUGIN})
Declare a C++ plugin:
1 GEPETTO_GUI_PLUGIN(pluginskeleton
2  # Use this option only if you write a plugin within
3  # gepetto-viewer-corba package
4  # INSIDE_GEPETTO_VIEWER_CORBA
5 
6  # Whether to use Qt4 or Qt5
7  ${QT4}
8 
9  # List of headers that need not to be moced.
10  HEADERS_NO_MOC
11 
12  # List of headers to be moced
13  HEADERS
14  plugin.hh
15 
16  # List of Qt forms
17  FORMS
18 
19  # List of Qt resources
20  RESOURCES
21 
22  # List of source files
23  SOURCES
24  plugin.cc
25 
26  # List of dependencies to be given to TARGET_LINK_LIBRARIES
27  LINK_DEPENDENCIES
28 
29  # List of dependencies to be given to PKG_CONFIG_USE_DEPENDENCY
30  PKG_CONFIG_DEPENDENCIES
31  )
Declare a Python plugin:
1 # pythonfile refers to the path to .py file from a
2 # path of PYTHONPATH
3 GEPETTO_GUI_PYPLUGIN (pythonfile)