Difference between revisions of "Fixing external projects"

From mitk.org
Jump to navigation Jump to search
Line 32: Line 32:
 
</nowiki></pre>
 
</nowiki></pre>
  
* which must be changed to
+
 
 +
which must be changed to<<BR>>
 +
 
 
   
 
   
 
<pre><nowiki>
 
<pre><nowiki>
Line 40: Line 42:
  
 
* Further, your executables .cpp file  must now create a QApplication instance. So add the include directive  "#include <QApplication>" and add the following lines at the  beginning of your main method:
 
* Further, your executables .cpp file  must now create a QApplication instance. So add the include directive  "#include <QApplication>" and add the following lines at the  beginning of your main method:
 +
 
   
 
   
 
<pre><nowiki>
 
<pre><nowiki>
Line 48: Line 51:
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
 +
* On Windows, you have to fix the batch files used for starting Visual Studio or the application itself. The files are called start<project-name>.bat.in and startVS2008.bat.in and are located in your projects source directory. In both files, the line which sets the PATH variable should look like:
 +
 +
 +
<pre><nowiki>
 +
PATH=@CTK_RUNTIME_LIBRARY_DIRS@\@APP_BUILD_TYPE@;@MITK_LIBRARY_DIRS_WITH_BUILD_TYPE@;@MITK_VTK_LIBRARY_DIRS@\@APP_BUILD_TYPE@;@MITK_ITK_LIBRARY_DIRS@\@APP_BUILD_TYPE@;@GDCM_BIN_DIR@;@OpenCV_BIN_DIR@;@QT_LIBRARY_DIR@\..\bin;%PATH%
 +
</nowiki></pre>
 +
 +
      Don't forget to re-run CMake after editing the files.
  
 
* Usually, your external project contains also [[BlueBerry]] bundles. You must fix them by following the instructions provided [[Fixing legacy BlueBerry bundles|here]].
 
* Usually, your external project contains also [[BlueBerry]] bundles. You must fix them by following the instructions provided [[Fixing legacy BlueBerry bundles|here]].

Revision as of 11:16, 2 June 2011

If you generated a MITK project using the BundleGenerator, your projects build system probably needs a couple of tweaks to work with the new CTK-based BlueBerry.

  • Your custom executable needs a different set of include directories. The new variables to use are:
INCLUDE_DIRECTORIES(
  ${org_blueberry_osgi_INCLUDE_DIRS}
  ${Poco_INCLUDE_DIRS}
  ${mbilog_INCLUDE_DIRS}
)
  • The TARGET_LINK_LIBRARIES command for your executable should now look like
TARGET_LINK_LIBRARIES(<executable-target> org_blueberry_osgi)


  • Your applications .ini file needs an additional entry:
BlueBerry.provisioning=@MITK_PLUGIN_PROVISIONING_FILE@


  • Your executables .cpp file usually contains a statement like
#include <org.blueberry.osgi/src/application/berryStarter.h>


which must be changed to<
>


#include <berryStarter.h>


  • Further, your executables .cpp file must now create a QApplication instance. So add the include directive "#include <QApplication>" and add the following lines at the beginning of your main method:


// Create a QApplication instance first
QApplication myApp(argc, argv);
myApp.setApplicationName("MyApp");
myApp.setOrganizationName("My Organization");


  • On Windows, you have to fix the batch files used for starting Visual Studio or the application itself. The files are called start<project-name>.bat.in and startVS2008.bat.in and are located in your projects source directory. In both files, the line which sets the PATH variable should look like:


PATH=@CTK_RUNTIME_LIBRARY_DIRS@\@APP_BUILD_TYPE@;@MITK_LIBRARY_DIRS_WITH_BUILD_TYPE@;@MITK_VTK_LIBRARY_DIRS@\@APP_BUILD_TYPE@;@MITK_ITK_LIBRARY_DIRS@\@APP_BUILD_TYPE@;@GDCM_BIN_DIR@;@OpenCV_BIN_DIR@;@QT_LIBRARY_DIR@\..\bin;%PATH%
     Don't forget to re-run CMake after editing the files.
  • Usually, your external project contains also BlueBerry bundles. You must fix them by following the instructions provided here.