Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
MitkWorkbench.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include <mitkBaseApplication.h>
14 #include <QVariant>
15 
16 #if defined __GNUC__ && !defined __clang__
17 # include <QDir>
18 # include <QFileInfo>
19 # include <QString>
20 # include <QStringList>
21 #endif
22 
23 int main(int argc, char **argv)
24 {
25  mitk::BaseApplication app(argc, argv);
26 
27  app.setSingleMode(true);
28  app.setApplicationName("MITK Workbench");
29  app.setOrganizationName("DKFZ");
30 
31  // Preload the org.blueberry.core.expressions plugin to work around a bug in
32  // GCC that leads to undefined symbols while loading certain libraries even though
33  // the symbols are actually defined.
34 #if defined __GNUC__ && !defined __clang__
35  auto library = QFileInfo(argv[0]).dir().path() + "/../lib/plugins/liborg_blueberry_core_expressions.so";
36 
37  if (!QFileInfo(library).exists())
38  library = "liborg_blueberry_core_expressions";
39 
40  app.setPreloadLibraries(QStringList() << library);
41 #endif
42 
43  app.setProperty(mitk::BaseApplication::PROP_PRODUCT, "org.mitk.gui.qt.extapplication.workbench");
44 
45  // Run the workbench.
46  return app.run();
47 }
void setPreloadLibraries(const QStringList &libraryBaseNames)
void setProperty(const QString &property, const QVariant &value)
void setOrganizationName(const QString &name)
void setSingleMode(bool singleMode)
int main(int argc, char **argv)
static const QString PROP_PRODUCT
void setApplicationName(const QString &name)