Skip to content
Snippets Groups Projects
Commit 4c81f2fc authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add skeleton for C++ plugin

parent d9ec4018
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,9 @@ FILE_PATTERNS = *.idl *.hh ...@@ -2,10 +2,9 @@ FILE_PATTERNS = *.idl *.hh
INPUT = @CMAKE_SOURCE_DIR@/include \ INPUT = @CMAKE_SOURCE_DIR@/include \
@CMAKE_SOURCE_DIR@/idl \ @CMAKE_SOURCE_DIR@/idl \
@CMAKE_SOURCE_DIR@/plugins \
@CMAKE_SOURCE_DIR@/doc @CMAKE_SOURCE_DIR@/doc
TAGFILES = @GEPETTO_VIEWER_DOXYGENDOCDIR@/gepetto-viewer.doxytag=@GEPETTO_VIEWER_DOXYGENDOCDIR@
GENERATE_TREEVIEW = NO GENERATE_TREEVIEW = NO
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/ EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/
# Copyright (c) 2018 CNRS
# Authors: Joseph Mirabel
#
#
# This file is part of gepetto-viewer-corba
# gepetto-viewer-corba is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# gepetto-viewer-corba is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# gepetto-viewer-corba If not, see
# <http://www.gnu.org/licenses/>.
SET(PLUGIN_NAME pluginskeleton)
SET(${PLUGIN_NAME}_HEADERS_NO_MOC
)
SET(${PLUGIN_NAME}_HEADERS
plugin.hh
)
SET(${PLUGIN_NAME}_FORMS
)
SET(${PLUGIN_NAME}_RESOURCES
)
# If you build this plugin outside gepetto-viewer-corba package,
# you must pass the following extra option.
QT4_WRAP_CPP(${PLUGIN_NAME}_HEADERS_MOC ${${PLUGIN_NAME}_HEADERS} OPTIONS -I${GEPETTO_VIEWER_CORBA_INCLUDEDIR})
# QT4_WRAP_CPP(${PLUGIN_NAME}_HEADERS_MOC ${${PLUGIN_NAME}_HEADERS})
QT4_WRAP_UI(${PLUGIN_NAME}_FORMS_HEADERS ${${PLUGIN_NAME}_FORMS})
QT4_ADD_RESOURCES(${PLUGIN_NAME}_RESOURCES_RCC ${${PLUGIN_NAME}_RESOURCES})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)
SET (${PLUGIN_NAME}_SOURCES
plugin.cc
)
ADD_LIBRARY(${PLUGIN_NAME} SHARED ${${PLUGIN_NAME}_SOURCES}
${${PLUGIN_NAME}_HEADERS_NO_MOC}
${${PLUGIN_NAME}_HEADERS_MOC}
${${PLUGIN_NAME}_FORMS_HEADERS}
${${PLUGIN_NAME}_RESOURCES_RCC}
)
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} ${QT_LIBRARIES})
# Uncomment to install
INSTALL(TARGETS ${PLUGIN_NAME} DESTINATION lib/gepetto-gui-plugins)
// Copyright (c) 2018 CNRS
// Authors: Joseph Mirabel
//
//
// This file is part of gepetto-viewer-corba
// gepetto-viewer-corba is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// gepetto-viewer-corba is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// gepetto-viewer-corba If not, see
// <http://www.gnu.org/licenses/>.
#include <plugin.hh>
void PluginSkeleton::init() {
qDebug() << "PluginSkeleton::init";
}
Q_EXPORT_PLUGIN2 (pluginskeleton, PluginSkeleton)
// Copyright (c) 2018 CNRS
// Authors: Joseph Mirabel
//
//
// This file is part of gepetto-viewer-corba
// gepetto-viewer-corba is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// gepetto-viewer-corba is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// gepetto-viewer-corba If not, see
// <http://www.gnu.org/licenses/>.
#include <QObject>
#include <gepetto/gui/plugin-interface.hh>
/// C++ skeleton plugin.
/// To add your own plugin, copy paste code in directory plugins/pluginskeleton.
class PluginSkeleton : public QObject, public gepetto::gui::PluginInterface {
Q_OBJECT
Q_INTERFACES (gepetto::gui::PluginInterface)
public:
QString name () const { return QString("PluginSkeleton"); }
protected:
void init();
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment