Page MenuHomePhabricator

No OneTemporary

This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/Applications/PluginGenerator/CMakeLists.txt b/Applications/PluginGenerator/CMakeLists.txt
index 0106f4fdcb..9dcb1ba2a4 100644
--- a/Applications/PluginGenerator/CMakeLists.txt
+++ b/Applications/PluginGenerator/CMakeLists.txt
@@ -1,70 +1,76 @@
cmake_minimum_required(VERSION 2.8.4)
project(MITKPluginGenerator)
set(VERSION_MAJOR 1)
-set(VERSION_MINOR 0)
-set(VERSION_PATCH 0)
+set(VERSION_MINOR 1)
+set(VERSION_PATCH 1)
+
+set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(standalone_build 1)
else()
set(standalone_build 0)
endif()
#-----------------------------------------------------------------------------
# Prerequesites
#-----------------------------------------------------------------------------
set(QT_DONT_USE_QTGUI 1)
find_package(Qt 4.6.2 REQUIRED)
include(${QT_USE_FILE})
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PluginGeneratorConfig.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/PluginGeneratorConfig.h" @ONLY)
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+
#-----------------------------------------------------------------------------
# Executable
#-----------------------------------------------------------------------------
set(src_files
PluginGenerator.cpp
ctkCommandLineParser.cpp
)
qt4_wrap_cpp(src_files ctkCommandLineParser.h)
qt4_add_resources(src_files plugin_template.qrc project_template.qrc)
set(exec_target ${PROJECT_NAME})
add_executable(${exec_target} ${src_files})
target_link_libraries(${exec_target} ${QT_LIBRARIES})
if(NOT standalone_build)
# subproject support
add_dependencies(MITK-CoreUI ${exec_target})
endif()
#-----------------------------------------------------------------------------
# Win32 Convenience
#-----------------------------------------------------------------------------
if(WIN32 AND NOT standalone_build)
file(TO_NATIVE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" native_runtime_dir)
add_custom_target(NewPlugin start "MITK PluginGenerator" /D "${native_runtime_dir}" cmd /K ${exec_target}.exe -h
DEPENDS ${exec_target})
endif()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(NOT standalone_build)
# Test the plugin generator
include(mitkTestPluginGenerator)
endif()
#-----------------------------------------------------------------------------
# Packaging support
#-----------------------------------------------------------------------------
if(standalone_build)
include(SetupPackaging.cmake)
endif()
diff --git a/Applications/PluginGenerator/Changelog.txt b/Applications/PluginGenerator/Changelog.txt
new file mode 100644
index 0000000000..383b22c38e
--- /dev/null
+++ b/Applications/PluginGenerator/Changelog.txt
@@ -0,0 +1,18 @@
+This is the change log for the MITK Plugin Generator
+
+
+Changes since version 1.0.0
+======================================================================
+
+Changes in the MITKPluginGenerator executable
+----------------------------------------------------------------------
+
+- Added printing the version number to the console.
+- Added hint how to get more help if something went wrong.
+
+Changes in the generated files
+----------------------------------------------------------------------
+
+- Fixed user manual for the generated plugin.
+- Added comments in the generated project's CMakeLists.txt file about
+ how to set-up the MITK module system.
diff --git a/Applications/PluginGenerator/PluginGenerator.cpp b/Applications/PluginGenerator/PluginGenerator.cpp
index 7663f9b7d1..326f548ecb 100644
--- a/Applications/PluginGenerator/PluginGenerator.cpp
+++ b/Applications/PluginGenerator/PluginGenerator.cpp
@@ -1,402 +1,407 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/ for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "ctkCommandLineParser.h"
+#include <PluginGeneratorConfig.h>
#include <QCoreApplication>
#include <QTextStream>
#include <QDebug>
#include <QFile>
#include <QDir>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <cctype>
bool readAnswer(char defaultAnswer)
{
std::string line;
std::cin >> std::noskipws >> line;
// consume the new line character
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
char answer = defaultAnswer;
if (!line.empty() && line[0] != '\n')
{
answer = std::tolower(line[0]);
}
if (answer == 'y') return true;
if (answer == 'n') return false;
if (defaultAnswer == 'y') return true;
return false;
}
void createFilePathMapping(const QString& templateName, const QString& baseInDir, const QString& baseOutDir, QHash<QString, QString>& fileNameMapping)
{
QFileInfo info(templateName);
if (info.isDir())
{
QStringList subEntries = QDir(templateName).entryList();
foreach(QString subEntry, subEntries)
{
createFilePathMapping(templateName + "/" + subEntry, baseInDir, baseOutDir, fileNameMapping);
}
return;
}
fileNameMapping[templateName] = QString(templateName).replace(baseInDir, baseOutDir);
}
QHash<QString,QString> createTemplateFileMapping(const QString& qrcBase, const QString& baseOutDir, const QHash<QString, QString>& fileNameMapping)
{
QHash<QString,QString> filePathMapping;
createFilePathMapping(qrcBase, qrcBase, baseOutDir, filePathMapping);
QMutableHashIterator<QString,QString> i(filePathMapping);
while(i.hasNext())
{
i.next();
QHashIterator<QString,QString> j(fileNameMapping);
while(j.hasNext())
{
j.next();
i.setValue(i.value().replace(j.key(), j.value()));
}
}
return filePathMapping;
}
bool generateFiles(const QHash<QString, QString>& parameters,
const QHash<QString, QString>& filePathMapping)
{
QHashIterator<QString,QString> paths(filePathMapping);
while(paths.hasNext())
{
paths.next();
QFile templ(paths.key());
templ.open(QIODevice::ReadOnly);
QByteArray templContent = templ.readAll();
QHashIterator<QString,QString> i(parameters);
while (i.hasNext())
{
i.next();
templContent.replace(i.key(), QByteArray(i.value().toLatin1()));
}
QFile outTempl(paths.value());
QDir dir(QFileInfo(outTempl).dir());
if (!dir.exists())
{
if (!dir.mkpath(dir.absolutePath()))
{
qCritical() << "Could not create directory" << dir.absolutePath();
return EXIT_FAILURE;
}
}
if (!outTempl.open(QIODevice::WriteOnly))
{
qCritical() << outTempl.errorString();
return false;
}
outTempl.write(templContent);
}
return true;
}
int main(int argc, char** argv)
{
+ QString appName("MITKPluginGenerator");
+
QCoreApplication app(argc, argv);
- app.setApplicationName("PluginGenerator");
+ app.setApplicationName(appName);
app.setOrganizationName("DKFZ");
ctkCommandLineParser parser;
// Use Unix-style argument names
parser.setArgumentPrefix("--", "-");
parser.setStrictModeEnabled(true);
// Add command line argument names
parser.addArgument("help", "h", QVariant::Bool, "Show this help text");
parser.addArgument("out-dir", "o", QVariant::String, "Output directory", QDir::tempPath());
parser.addArgument("license", "l", QVariant::String, "Path to a file containing license information", ":/MITKLicense.txt");
parser.addArgument("vendor", "v", QVariant::String, "The vendor of the generated code", "DKFZ, Medical and Biological Informatics");
parser.addArgument("quiet", "q", QVariant::Bool, "Do not print additional information");
parser.addArgument("confirm-all", "y", QVariant::Bool, "Answer all questions with 'yes'");
parser.beginGroup("Plug-in options");
parser.addArgument("plugin-symbolic-name", "ps", QVariant::String, "The plugin's symbolic name");
parser.setExactMatchRegularExpression("-ps", "^[a-zA-Z]+\\.[a-zA-Z0-9._]+[^\\.]$", "Symbolic name invalid");
parser.addArgument("plugin-name", "pn", QVariant::String, "The plug-in's human readable name");
parser.beginGroup("Plug-in View options");
parser.addArgument("view-class", "vc", QVariant::String, "The View's' class name");
parser.addArgument("view-name", "vn", QVariant::String, "The View's human readable name");
parser.beginGroup("Project options");
parser.addArgument("project-copyright", "", QVariant::String, "Path to a file containing copyright information", ":/MITKCopyright.txt");
parser.addArgument("project-name", "", QVariant::String, "The project name");
parser.setExactMatchRegularExpression("--project-name", "^[a-zA-Z_\\-]+$", "Project name invalid");
parser.addArgument("project-app-name", "", QVariant::String, "The application name");
parser.setExactMatchRegularExpression("--project-app-name", "^[a-zA-Z_\\-]+$", "Project application name invalid");
parser.endGroup();
// Parse the command line arguments
bool ok = false;
QHash<QString, QVariant> parsedArgs = parser.parseArguments(QCoreApplication::arguments(), &ok);
if (!ok)
{
QTextStream(stderr, QIODevice::WriteOnly) << "Error parsing arguments: "
- << parser.errorString() << "\n";
+ << parser.errorString() << "\nType '" << appName << " -h' for help\n";
return EXIT_FAILURE;
}
QTextStream out(stdout, QIODevice::WriteOnly);
// Show a help message
if (parsedArgs.contains("help"))
{
- out << "A CTK plug-in generator for MITK\n\n"
+ out << "A CTK plug-in generator for MITK (version " PLUGIN_GENERATOR_VERSION ")\n\n"
<< parser.helpText();
return EXIT_SUCCESS;
}
// Check arguments
// Project options
QString projectName = parsedArgs["project-name"].toString();
QString projectAppName = parsedArgs["project-app-name"].toString();
QString copyrightPath = QDir::fromNativeSeparators(parsedArgs["project-copyright"].toString());
bool createProject = !projectName.isEmpty();
if (createProject && projectAppName.isEmpty())
{
projectAppName = projectName;
}
QString pluginSymbolicName = parsedArgs["plugin-symbolic-name"].toString();
if (pluginSymbolicName.isEmpty())
{
qCritical() << "Required argument 'plugin-symbolic-name' missing.";
+ qCritical("%s%s%s", "Type '", qPrintable(appName), " -h' for help");
return EXIT_FAILURE;
}
QString pluginTarget(pluginSymbolicName);
pluginTarget.replace('.', '_');
QString outDir = QDir::fromNativeSeparators(parsedArgs["out-dir"].toString());
QString licensePath = QDir::fromNativeSeparators(parsedArgs["license"].toString());
QString pluginExportDirective = pluginSymbolicName.split('.').last().toUpper() + "_EXPORT";
QString pluginName = parsedArgs["plugin-name"].toString();
if (pluginName.isEmpty())
{
QStringList toks = pluginSymbolicName.split('.');
pluginName = toks.last();
pluginName[0] = pluginName[0].toUpper();
}
QString vendor = parsedArgs["vendor"].toString();
QString viewName = parsedArgs["view-name"].toString();
if (viewName.isEmpty())
{
qCritical() << "Required argument 'view-name' missing.";
+ qCritical("%s%s%s", "Type '", qPrintable(appName), " -h' for help");
return EXIT_FAILURE;
}
QStringList toks = viewName.split(QRegExp("\\s"), QString::SkipEmptyParts);
QString viewClass = parsedArgs["view-class"].toString();
if (viewClass.isEmpty())
{
foreach(QString tok, toks)
{
QString tmp = tok;
tmp[0] = tmp[0].toUpper();
viewClass += tmp;
}
}
QString viewId;
if (viewId.isEmpty())
{
viewId = "org.mitk.views.";
foreach(QString tok, toks)
{
viewId += tok.toLower();
}
}
bool quiet = parsedArgs.contains("quiet");
bool autoConfirm = parsedArgs.contains("confirm-all");
if (!outDir.endsWith('/'))
outDir += '/';
if (createProject)
outDir += projectName;
else
outDir += pluginSymbolicName;
// Print the collected information
if(!quiet)
{
if (createProject)
{
out << "Using the following information to create a project:\n\n"
<< " Project Name: " << projectName << '\n'
<< " Application Name: " << projectAppName << '\n'
<< " Copyright File: " << QDir::toNativeSeparators(copyrightPath) << '\n';
}
else
{
out << "Using the following information to create a plug-in:\n\n";
}
out << " License File: " << QDir::toNativeSeparators(licensePath) << '\n'
<< " Plugin-SymbolicName: " << pluginSymbolicName << '\n'
<< " Plugin-Name: " << pluginName << '\n'
<< " Plugin-Vendor: " << vendor << '\n'
<< " View Name: " << viewName << '\n'
<< " View Id: " << viewId << '\n'
<< " View Class: " << viewClass << '\n' << '\n'
<< "Create in: " << outDir << '\n' << '\n';
if (!autoConfirm)
out << "Continue [Y/n]? ";
out.flush();
if(!autoConfirm && !readAnswer('y'))
{
out << "Aborting.\n";
return EXIT_SUCCESS;
}
}
// Check the output directory
if (!QDir(outDir).exists())
{
if (!autoConfirm)
{
out << "Directory '" << outDir << "' does not exist. Create it [Y/n]? ";
out.flush();
}
if (autoConfirm || readAnswer('y'))
{
if (!QDir().mkpath(outDir))
{
qCritical() << "Could not create directory:" << outDir;
return EXIT_FAILURE;
}
}
else
{
out << "Aborting.\n";
return EXIT_SUCCESS;
}
}
if (!QDir(outDir).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty())
{
if (!autoConfirm)
{
out << "Directory '" << outDir << "' is not empty. Continue [y/N]? ";
out.flush();
}
if (!autoConfirm && !readAnswer('n'))
{
out << "Aborting.\n";
return EXIT_SUCCESS;
}
}
// Extract the license text
QFile licenseFile(licensePath);
if (!licenseFile.open(QIODevice::ReadOnly))
{
qCritical() << "Cannot open file" << licenseFile.fileName();
return EXIT_FAILURE;
}
QString licenseText = licenseFile.readAll();
licenseFile.close();
QHash<QString,QString> parameters;
if (createProject)
{
// Extract the copyright
QFile copyrightFile(copyrightPath);
if (!copyrightFile.open(QIODevice::ReadOnly))
{
qCritical() << "Cannot open file" << copyrightFile.fileName();
return EXIT_FAILURE;
}
QString copyrighText = copyrightFile.readAll();
copyrightFile.close();
parameters["$(copyright)"] = copyrighText;
parameters["$(project-name)"] = projectName;
parameters["$(project-app-name)"] = projectAppName;
parameters["$(project-plugins)"] = QString("Plugins/") + pluginSymbolicName + ":ON";
QStringList toks = pluginTarget.split("_");
QString projectPluginBase = toks[0] + "_" + toks[1];
parameters["$(project-plugin-base)"] = projectPluginBase;
}
parameters["$(license)"] = licenseText;
parameters["$(plugin-name)"] = pluginName;
parameters["$(plugin-symbolic-name)"] = pluginSymbolicName;
parameters["$(vendor)"] = vendor;
parameters["$(plugin-target)"] = pluginTarget;
parameters["$(plugin-export-directive)"] = pluginExportDirective;
parameters["$(view-id)"] = viewId;
parameters["$(view-name)"] = viewName;
parameters["$(view-file-name)"] = viewClass;
parameters["$(view-class-name)"] = viewClass;
if (createProject)
{
QHash<QString,QString> projectFileNameMapping;
projectFileNameMapping["TemplateApp"] = projectAppName;
QHash<QString,QString> filePathMapping = createTemplateFileMapping(":/ProjectTemplate", outDir, projectFileNameMapping);
generateFiles(parameters, filePathMapping);
}
QHash<QString,QString> pluginFileNameMapping;
pluginFileNameMapping["QmitkTemplateView"] = viewClass;
if (createProject)
{
if (!outDir.endsWith('/'))
outDir += '/';
outDir += "Plugins/" + pluginSymbolicName;
}
QHash<QString,QString> filePathMapping = createTemplateFileMapping(":/PluginTemplate", outDir, pluginFileNameMapping);
generateFiles(parameters, filePathMapping);
return EXIT_SUCCESS;
}
diff --git a/Applications/PluginGenerator/PluginGeneratorConfig.h.in b/Applications/PluginGenerator/PluginGeneratorConfig.h.in
new file mode 100644
index 0000000000..2a1c287859
--- /dev/null
+++ b/Applications/PluginGenerator/PluginGeneratorConfig.h.in
@@ -0,0 +1,23 @@
+/*=========================================================================
+
+Program: Medical Imaging & Interaction Toolkit
+Language: C++
+Date: $Date$
+Version: $Revision$
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/ for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+#ifndef PLUGINGENERATORCONFIG_H
+#define PLUGINGENERATORCONFIG_H
+
+#define PLUGIN_GENERATOR_VERSION "@VERSION_STRING@"
+
+#endif
diff --git a/Applications/PluginGenerator/PluginTemplate/documentation/Manual/icon.png b/Applications/PluginGenerator/PluginTemplate/documentation/Manual/icon.png
deleted file mode 100644
index 7a51d8cb11..0000000000
--- a/Applications/PluginGenerator/PluginTemplate/documentation/Manual/icon.png
+++ /dev/null
@@ -1,26 +0,0 @@
-‰PNG
-
-
-•|€©$¦Š@IQIaSR•TRPyUÀ/­dKÁ6ے‘eëe=VÒJûÞyõtߓÝ=ÓÓ;+Ù Nü©ÚšÙîž{ï9÷œÿ9çîÀ¯_¿~½ª_?ûÙÏ^ÑñåW=`î¾jŸèlºæ}~n‹ 7ˆÊZT‡Œh7*í¨"h‘9QpÐs®Øþvç‘gß=:bÓc<òÈ#ìÙ³çÕ©
-#EuÎ}ºà؇þzû±oýöö”Óó=úè£Üy睯8÷ ïíˆqßÂzU>%»DµSQƒÅ€Ò×fXÓe*ݞЩ€Zh™¯*WŠ–ñù™Rˆ0‚5¨¨v:á¿oé]øÒ÷>rý"¯ 0”°/DÜ¿àd-èçP½GròºeБ[‡\npèkT›'‰>‹D˜ó•ç.×xê‚ϱ‰šVj*µPUzrÁC¯˜¿o÷ÐÜS¿ÿŽ'æE>
-À°Ö222òÊ+@î/¢ñŽËýÅë>Šê'èõ`]·£;V¸²}¹KޅPÁ*¨*o_]p
-H®׀çÀ‚¯<9îóø™ªž› d¦’Â5…êßÝÚWü篼ó±'éýêÈ4
-ÀÁƒÙ½{÷¯Puዮ ßWÕ7·­ÏéÎ.9â]‹?4 ±H-¬ÁÈb|hVŽb¢i¨–GN”õ[O/ˆç ËÛkÿõ‘›ÆÿüÎóß²óîé—6¯­€/”àc¸¿ÔŽðª[;r»7zzû #ª &<R£‘MÖÔS×ëÂk›¬ ~¶I=}Oyþ²¯_98+Õ@Y‘¯=óñ­g?½¦à?1::rñ¥*aiÜWÇF¡؉ʏQÝÙ㉾ïOnpðÃxAdv±•Ég>g­d‘ÅÈÕ¬DG„““>ÿòجN­\W¨>óÉÛÎ~fu§ÿؔßvá7ïÚÍ¡C‡ð}Éa–ð±ðV
-¨|«;{Û ¼±M^ÛïPKÚ¬F›¡=õk!Öltßs Ëƒ¾ `¨
-®2¯E°
-A¨¼yk+{s\*¹«÷÷¼eÁw¶#˓qüñ«(à åÄ÷W¢úρmCŽôy±ð*XR“Ó
-—‹p©“e¨…K[G¢„î6xMoMl‹h£¤7CXћ“mëòz¹d:žœè¸£šMª¬IÆ=tèP£”oü€w:;–åÄ5B`#ݦwÅjŒâqҒ$/6YMJ¨¹*œœ†‹ ʗjÑsm `ÛJXÑÙ#’`M7¼0©¦’¥d-iÌ9ÂÖµž;_áç—:¶ýÖºéC+:üÓcccGFFæwíÚÕÂóùT½åyÑë» ~H“é7™=)ßO]³qî^®ÁÃ'áëÏFïO^€gàJ ¦Ë‘<;ß==»F‰BèÕ,®áŠUX՗“ Ë<­ïà…®×;ÂZ`ÅÒ ø±<<P*
-üD6£8×w;ØHOÆ÷ÓæGc‡Zùi+ì°
-¾…U]°®§u¨L¬æâ|sHm…͘¥H«Úpå…éüÏè Â`†ÀÞ½{›¢ÀZ”•
-С‚'´9ˆÆhºÈücM‡×ÐÌÎ.Š ™1Bj„·lŒB\@fRã§'¢ÈÑï3•Í l¬¸Á#hhŜšm[™3Ú£ªûöíË&B:€Ò×ëI¼pi65myuPÊ,¨é+"+ïÂ;n„›VÑJø‰"ì;í~2V¨-\¡Ed
--t\Œˆ Êø‚7àºE¤ÓÄ5rʤlwG.šÉ&¦¤©Ê+ÅèÔÍ?6E£ÍæŸv‹º+ÅBåspÏXۓ2ÛLÁ$ >|õp#é²)’5Ô¨@ۘ7Læ«_¾Pð 3>2Su»Œh§ªv¨ªl]F5oi3 $šý8Ê&B¦h­0QBê;Mø'H>>»ë%J_6
-¥MìRj\kã I¯%‹Ñ¼‚µÐî(ÕL»@ȋH³¨ª àˆÔ‰ˆ¹4ÃÓ©¶XP, \å¾kà]7GyýRi/DdÈwŽE™¢#`M›ÚEŠÐFyî:Q8,9 '"^B¸ÉEUµ ÐÒDG3¶0ñ¥îÇ߯†ð–õ°y¨µðɵssðÍ£è¹&Us¤ mme¶Nž¦Ö'l¢`¢àSUטh‹
-@k
-|õHôϓ ¥æëJ¯ÛµÀ"(í®EµÎꈪ¦]@Š A%P×jJ“×P6’8}ßƶ—°8¡Â꘻ôíc0UŽwÞ6*Á¦¹¤a‹Ö•YK̅r5ª¹»<Zƒ‘ªŠHCFìŒ*³Åš„4£kS‹K»¶¦Ò÷“d*´ÐíET×RLÕ(Þ{i³×Œk%}„Ôçì¼MkA¨øà×,F` _óCÈꄷI¹
-Ûü¼M‘"M|‚f®i‹’ܶ(Ém\#¤X©Ë3UJå@E`Ûʅ™š•i`(íÝ»w1+<ñG}.”“3AœnjƒŠ¶
-<!$ìb¢$¹–°H* ÚîD­±v'ª Úݨ0rœÆXš¢¿Cm¦Ä[­ES
- “Ï—&+,”C¹eYÙvæìe«2)"SªZJºÇn—?XûÆLÍÝzz®&7ôåÄÄH¥éŒ, F™L0 F‚'ð¡­ù‘
-°gϞ†8p
-³ Jƒ`lÂKž<“殏f‘VN¶3”¥àj5ˉ³s„Ê]¯™«xŽž΋ÈxŒWï þñ¦S_l3vz¶jå̜¯ ªÚĈÕÅDH؂H¹V3ޑ¥Q½•5´ŠV£¨uîb‘K“U¹y°Â¦þÊ%#zô,p~dd¤’îšìqT€ßÛ|bü֞…ÏZ gg}™)‡1Òj=üeim›ª¼Òi¢®Ñtd1Ël[)¶`„R½ÁJ%àȱiÍç`çêbiyGí pxQU/%ó%=Â&ìÙ³‡ýû÷#ëï±÷¬ºðÍe^õÀ‚rjºŠ¨*B˜tˆS´vØ"¤i)›Ê—T€ÓºšØfоѓˆ6&´Ê“G®Z+¯*Û«.Xå¸*'EäÔèèhñšíñä áGo¸xñ ˦>ßéÚKç檜­Öµ¬hK0²KðtFççáôÌâ¿ssQhiAr.Jp·Â”ˆù9z|š©™
-C…·n˜™î̅Ï[•€"r> öK7GcW›÷„OúñÁ3Åö/ý|ºûS'&+y× k{ÛŪÔOfd‰p‰b©\ƒ|:s™SI-`R¬oúûM,šj(¼X…3gç8{~^syû¦éò¦ÊñrÍ=&"ÏWðƒÔÁþª
-HŽ–m½ã'³Ÿ®æþõ“G6^ÿËùÂRkaÝ@;֦θ]ƒ(‘¸U5]Y|f0Ý6©Z>!ZÉtMº ×hî³ãsœ|qF«È‡·N¿±jád%# ¿‘_ŠÈ€žžž—qJ ùKní?÷W·{ð†ŽÒ÷ §§Êzâr9&&‘·•©fk„ô¹ô)¥D–¥úiWh
diff --git a/Applications/PluginGenerator/PluginTemplate/documentation/Manual/Manual.dox b/Applications/PluginGenerator/PluginTemplate/documentation/UserManual/Manual.dox
similarity index 87%
rename from Applications/PluginGenerator/PluginTemplate/documentation/Manual/Manual.dox
rename to Applications/PluginGenerator/PluginTemplate/documentation/UserManual/Manual.dox
index 84b8b5dd98..ae83208851 100755
--- a/Applications/PluginGenerator/PluginTemplate/documentation/Manual/Manual.dox
+++ b/Applications/PluginGenerator/PluginTemplate/documentation/UserManual/Manual.dox
@@ -1,19 +1,19 @@
/**
\bundlemainpage{$(plugin-symbolic-name)} $(plugin-name)
-\image html icon.png "Icon of $(plugin-name)"
+\image html icon.xpm "Icon of $(plugin-name)"
Available sections:
- \ref $(plugin-symbolic-name)Overview
\section $(plugin-symbolic-name)Overview
Describe the features of your awesome plugin here
<ul>
<li>Increases productivity
<li>Creates beautiful images
<li>Generates PhD thesis
<li>Brings world peace
</ul>
*/
diff --git a/Applications/PluginGenerator/PluginTemplate/documentation/UserManual/icon.xpm b/Applications/PluginGenerator/PluginTemplate/documentation/UserManual/icon.xpm
new file mode 100644
index 0000000000..9057c20bc6
--- /dev/null
+++ b/Applications/PluginGenerator/PluginTemplate/documentation/UserManual/icon.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static const char * icon_xpm[] = {
+"16 16 2 1",
+" c #FF0000",
+". c #000000",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
diff --git a/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt b/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt
index 1177f382ad..91522ee770 100644
--- a/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt
+++ b/Applications/PluginGenerator/ProjectTemplate/CMakeLists.txt
@@ -1,364 +1,378 @@
cmake_minimum_required(VERSION 2.8.4)
# Change project and application name to your own
set(MY_PROJECT_NAME $(project-name))
set(MY_APP_NAME $(project-app-name))
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#-----------------------------------------------------------------------------
# Superbuild Option - Enabled by default
#-----------------------------------------------------------------------------
option(${MY_PROJECT_NAME}_USE_SUPERBUILD "Build ${MY_PROJECT_NAME} and the projects it depends on via SuperBuild.cmake." ON)
if(${MY_PROJECT_NAME}_USE_SUPERBUILD)
project(${MY_PROJECT_NAME}-superbuild)
set(${MY_PROJECT_NAME}_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(${MY_PROJECT_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
else()
project(${MY_PROJECT_NAME})
endif()
#-----------------------------------------------------------------------------
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
set(project_policies
CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.
CMP0002 # NEW: Logical target names must be globally unique.
CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths.
CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace.
CMP0005 # NEW: Preprocessor definition values are now escaped automatically.
CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.
CMP0007 # NEW: List command no longer ignores empty elements.
CMP0008 # NEW: Libraries linked by full-path must have a valid library file name.
CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default.
CMP0010 # NEW: Bad variable reference syntax is an error.
CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP.
CMP0012 # NEW: if() recognizes numbers and boolean constants.
CMP0013 # NEW: Duplicate binary directories are not allowed.
CMP0014 # NEW: Input directories must have CMakeLists.txt
)
foreach(policy ${project_policies})
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
endforeach()
#-----------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${${MY_PROJECT_NAME}_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
include(MacroEmptyExternalProject)
#-----------------------------------------------------------------------------
# Output directories.
#-----------------------------------------------------------------------------
foreach(type LIBRARY RUNTIME ARCHIVE)
set(output_dir ${${MY_PROJECT_NAME}_BINARY_DIR}/bin)
set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.")
mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY)
endforeach()
#-----------------------------------------------------------------------------
# Additional Options (also shown during superbuild)
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build ${MY_PROJECT_NAME} with shared libraries" ON)
option(WITH_COVERAGE "Enable/Disable coverage" OFF)
option(BUILD_TESTING "Test the project" ON)
option(${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS "Build all ${MY_PROJECT_NAME} plugins" OFF)
mark_as_advanced(${MY_PROJECT_NAME}_INSTALL_RPATH_RELATIVE
${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS
)
#-----------------------------------------------------------------------------
# Additional CXX/C Flags
#-----------------------------------------------------------------------------
set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags")
mark_as_advanced(ADDITIONAL_C_FLAGS)
set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags")
mark_as_advanced(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
if(${MY_PROJECT_NAME}_USE_SUPERBUILD)
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake")
return()
endif()
#*****************************************************************************
#**************************** END OF SUPERBUILD ****************************
#*****************************************************************************
#-----------------------------------------------------------------------------
# Prerequesites
#-----------------------------------------------------------------------------
find_package(MITK REQUIRED)
link_directories(${MITK_LINK_DIRECTORIES})
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${MITK_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
include(mitkFunctionCheckCompilerFlags)
include(mitkFunctionGetGccVersion)
include(mitkFunctionGetVersion)
#-----------------------------------------------------------------------------
# Set project specific options and variables (NOT available during superbuild)
#-----------------------------------------------------------------------------
set(${PROJECT_NAME}_VERSION_MAJOR "0")
set(${PROJECT_NAME}_VERSION_MINOR "1")
set(${PROJECT_NAME}_VERSION_PATCH "1")
set(${PROJECT_NAME}_VERSION_STRING "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
# Ask the user if a console window should be shown with the applications
option(${PROJECT_NAME}_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting GUI Applications" ON)
mark_as_advanced(${PROJECT_NAME}_SHOW_CONSOLE_WINDOW)
if(NOT UNIX AND NOT MINGW)
set(MITK_WIN32_FORCE_STATIC "STATIC")
endif()
set(${PROJECT_NAME}_MODULES_PACKAGE_DEPENDS_DIR "${PROJECT_SOURCE_DIR}/CMake/PackageDepends")
list(APPEND MODULES_PACKAGE_DEPENDS_DIRS ${${PROJECT_NAME}_MODULES_PACKAGE_DEPENDS_DIR})
#-----------------------------------------------------------------------------
# Get project version info
#-----------------------------------------------------------------------------
mitkFunctionGetVersion(${PROJECT_SOURCE_DIR} ${PROJECT_NAME})
#-----------------------------------------------------------------------------
# Installation preparation
#
# These should be set before any MITK install macros are used
#-----------------------------------------------------------------------------
# on Mac OSX all CTK plugins get copied into every
# application bundle (.app directory) specified here
set(MACOSX_BUNDLE_NAMES)
if(APPLE)
list(APPEND MACOSX_BUNDLE_NAMES ${MY_APP_NAME})
endif(APPLE)
#-----------------------------------------------------------------------------
# Set symbol visibility Flags
#-----------------------------------------------------------------------------
# MinGW does not export all symbols automatically, so no need to set flags
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
# The MITK module build system does not yet support default hidden visibility
set(VISIBILITY_CXX_FLAGS ) # "-fvisibility=hidden -fvisibility-inlines-hidden")
endif()
#-----------------------------------------------------------------------------
# Set coverage Flags
#-----------------------------------------------------------------------------
if(WITH_COVERAGE)
if(CMAKE_COMPILER_IS_GNUCXX)
set(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG")
set(COVERAGE_CXX_FLAGS ${coverage_flags})
set(COVERAGE_C_FLAGS ${coverage_flags})
endif()
endif()
#-----------------------------------------------------------------------------
# Project C/CXX Flags
#-----------------------------------------------------------------------------
set(${PROJECT_NAME}_C_FLAGS "${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}")
set(${PROJECT_NAME}_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}")
if(CMAKE_COMPILER_IS_GNUCXX)
set(cflags "-Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2")
mitkFunctionCheckCompilerFlags("-fdiagnostics-show-option" cflags)
mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" cflags)
mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
# With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so
# is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag.
# Doing so should allow to build package made for distribution using older linux distro.
if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
mitkFunctionCheckCompilerFlags("-fstack-protector-all" cflags)
endif()
if(MINGW)
# suppress warnings about auto imported symbols
set(${PROJECT_NAME}_CXX_FLAGS "-Wl,--enable-auto-import ${${PROJECT_NAME}_CXX_FLAGS}")
# we need to define a Windows version
set(${PROJECT_NAME}_CXX_FLAGS "-D_WIN32_WINNT=0x0500 ${${PROJECT_NAME}_CXX_FLAGS}")
endif()
set(${PROJECT_NAME}_C_FLAGS "${cflags} ${${PROJECT_NAME}_C_FLAGS}")
set(${PROJECT_NAME}_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wstrict-null-sentinel -Wsign-promo ${${PROJECT_NAME}_CXX_FLAGS}")
# The following line produces a lot of warnings in MITK header files...
#set(${PROJECT_NAME}_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${${PROJECT_NAME}_CXX_FLAGS}")
endif()
#-----------------------------------------------------------------------------
# Set C/CXX Flags
#-----------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PROJECT_NAME}_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${PROJECT_NAME}_C_FLAGS}")
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(BUILD_TESTING)
enable_testing()
include(CTest)
mark_as_advanced(TCL_TCLSH DART_ROOT)
# Setup file for setting custom ctest vars
configure_file(
CMake/CTestCustom.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
# Configuration for the CMake-generated test driver
set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include <stdexcept>")
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "
try
{")
set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " }
catch( std::exception & excp )
{
fprintf(stderr,\"%s\\n\",excp.what());
return EXIT_FAILURE;
}
catch( ... )
{
printf(\"Exception caught in the test driver\\n\");
return EXIT_FAILURE;
}
")
endif()
#-----------------------------------------------------------------------------
# ${MY_PROJECT_NAME}_SUPERBUILD_BINARY_DIR
#-----------------------------------------------------------------------------
# If ${MY_PROJECT_NAME}_SUPERBUILD_BINARY_DIR isn't defined, it means this project is
# *NOT* build using Superbuild. In that specific case, ${MY_PROJECT_NAME}_SUPERBUILD_BINARY_DIR
# should default to PROJECT_BINARY_DIR
if(NOT DEFINED ${PROJECT_NAME}_SUPERBUILD_BINARY_DIR)
set(${PROJECT_NAME}_SUPERBUILD_BINARY_DIR ${PROJECT_BINARY_DIR})
endif()
#-----------------------------------------------------------------------------
# Qt support
#-----------------------------------------------------------------------------
if(MITK_USE_QT)
set(QT_QMAKE_EXECUTABLE ${MITK_QMAKE_EXECUTABLE})
add_definitions(-DQWT_DLL)
endif()
#-----------------------------------------------------------------------------
# MITK modules
#-----------------------------------------------------------------------------
+# This project's directory holding module config files
+#set(${PROJECT_NAME}_MODULES_CONF_DIR "${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}")
+
+# Append this projects's module config directory to the global list
+# (This is used to get include directories for the <module_name>Exports.h files right)
+#list(APPEND MODULES_CONF_DIRS ${${PROJECT_NAME}_MODULES_CONF_DIR})
+
+# Clean the modulesConf directory. This ensures that modules are sorted
+# according to their dependencies in the Modules/CMakeLists.txt file
+#file(GLOB _modules_conf_files ${${PROJECT_NAME}_MODULES_CONF_DIR}/*.cmake)
+#if(_modules_conf_files)
+# file(REMOVE ${_modules_conf_files})
+#endif()
+
#add_subdirectory(Modules)
#-----------------------------------------------------------------------------
# CTK plugins
#-----------------------------------------------------------------------------
# The CMake code in this section *must* be in the top-level CMakeLists.txt file
macro(GetMyTargetLibraries all_target_libraries varname)
set(re_ctkplugin "^$(project-plugin-base)_[a-zA-Z0-9_]+$")
set(_tmp_list)
list(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin OUTPUT_VARIABLE ${varname})
endmacro()
include(${CMAKE_CURRENT_SOURCE_DIR}/Plugins/Plugins.cmake)
ctkMacroSetupExternalPlugins(${PROJECT_PLUGINS}
BUILD_OPTION_PREFIX ${MY_PROJECT_NAME}_
BUILD_ALL ${${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS})
#-----------------------------------------------------------------------------
# Add subdirectories
#-----------------------------------------------------------------------------
add_subdirectory(Apps/$(project-app-name))
#-----------------------------------------------------------------------------
# Installation
#-----------------------------------------------------------------------------
# set MITK cpack variables
include(mitkSetupCPack)
# Customize CPack variables for this project
include(CPackSetup)
list(APPEND CPACK_CREATE_DESKTOP_LINKS "${MY_APP_NAME}")
configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}CPackOptions.cmake @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}CPackOptions.cmake")
# include CPack model once all variables are set
include(CPack)
# Additional installation rules
include(mitkInstallRules)
#-----------------------------------------------------------------------------
# Last configuration steps
#-----------------------------------------------------------------------------
# If we are under Windows, create two batch files which correctly
# set up the environment for the application and for Visual Studio
if(WIN32)
include(mitkFunctionCreateWindowsBatchScript)
set(VS_SOLUTION_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.sln")
foreach(VS_BUILD_TYPE debug release)
mitkFunctionCreateWindowsBatchScript("${PROJECT_SOURCE_DIR}/CMake/StartVS.bat.in"
${PROJECT_BINARY_DIR}/StartVS_${VS_BUILD_TYPE}.bat
${VS_BUILD_TYPE})
endforeach()
endif(WIN32)
diff --git a/Applications/PluginGenerator/SetupPackaging.cmake b/Applications/PluginGenerator/SetupPackaging.cmake
index 48cbf89818..bdebf58d77 100644
--- a/Applications/PluginGenerator/SetupPackaging.cmake
+++ b/Applications/PluginGenerator/SetupPackaging.cmake
@@ -1,50 +1,52 @@
#-----------------------------------------------------------------------------
# Installation
#-----------------------------------------------------------------------------
install(TARGETS ${exec_target} DESTINATION .)
+install(FILES "${PROJECT_SOURCE_DIR}/Changelog.txt" DESTINATION .)
+
install(CODE "
set(DIRS
${QT_LIBRARY_DIR}
${QT_LIBRARY_DIR}/../bin
${CTK_LIBRARY_DIRS}
)
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${exec_target}${CMAKE_EXECUTABLE_SUFFIX}\" \"\" \"\${DIRS}\")
")
#-----------------------------------------------------------------------------
# Packaging
#-----------------------------------------------------------------------------
#
# First, set the generator variable
#
if(WIN32)
set(CPACK_GENERATOR ZIP)
elseif(APPLE)
set(CPACK_GENERATOR DragNDrop)
else()
set(CPACK_GENERATOR TGZ)
endif()
# include required mfc libraries
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "MITKPluginGenerator")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK PluginGenerator bootstraps MITK-based projects")
set(CPACK_PACKAGE_VENDOR "German Cancer Research Center (DKFZ)")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/MITKCopyright.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/MITKCopyright.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
# tell cpack to strip all debug symbols from all files
set(CPACK_STRIP_FILES ON)
include(CPack)
diff --git a/Applications/PluginGenerator/plugin_template.qrc b/Applications/PluginGenerator/plugin_template.qrc
index 6a59da691f..b205118c45 100644
--- a/Applications/PluginGenerator/plugin_template.qrc
+++ b/Applications/PluginGenerator/plugin_template.qrc
@@ -1,18 +1,18 @@
<RCC>
<qresource prefix="/">
<file>PluginTemplate/CMakeLists.txt</file>
<file>PluginTemplate/files.cmake</file>
<file>PluginTemplate/manifest_headers.cmake</file>
<file>PluginTemplate/plugin.xml</file>
<file>PluginTemplate/documentation/doxygen/modules.dox</file>
- <file>PluginTemplate/documentation/Manual/icon.png</file>
- <file>PluginTemplate/documentation/Manual/Manual.dox</file>
+ <file>PluginTemplate/documentation/UserManual/icon.xpm</file>
+ <file>PluginTemplate/documentation/UserManual/Manual.dox</file>
<file>PluginTemplate/resources/icon.xpm</file>
<file>PluginTemplate/src/internal/mitkPluginActivator.cpp</file>
<file>PluginTemplate/src/internal/mitkPluginActivator.h</file>
<file>PluginTemplate/src/internal/QmitkTemplateView.cpp</file>
<file>PluginTemplate/src/internal/QmitkTemplateView.h</file>
<file>PluginTemplate/src/internal/QmitkTemplateViewControls.ui</file>
<file>MITKLicense.txt</file>
</qresource>
</RCC>

File Metadata

Mime Type
application/octet-stream
Expires
Mon, Sep 30, 1:17 PM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2291789
Default Alt Text
(41 KB)

Event Timeline