Page MenuHomePhabricator

External libs need to have a special folder structure.
Closed, WontfixPublic

Description

Hi, ;)
I want to build MITK with some already compiled external libs (ANN, DCMTK, GDCM, ITK, VTK, tinyxml). Each one has its own folder structure that is specified in a seperate config.cmake file.

During MITK build system generation CMake will find it when specifying the location of the config.cmake file of that external lib as

set (EXTERNAL_ITK_DIR "C:/repo_cache/stable/win64-vc12/3rd_party/itk/4.5.1/cmake" CACHE PATH "")

But when starting the compiled mitkWorkbench with the batch scripts "startMitkWorkbench_release.bat" the application doesn't start but lists errors that the libs can't be found "Pre-loading library "liborg_mitk_gui_qt_ext" failed: "Cannot load library liborg_mitk_gui_qt_ext"
This is similar to http://thread.gmane.org/gmane.comp.lib.mitk.user/4481 and caused by a false extended path in the batch scripts. Here C:/repo_cache/stable/win64-vc12/3rd_party/itk/4.5.1/cmake/bin instead of C:/repo_cache/stable/win64-vc12/3rd_party/itk/4.5.1/bin is defined (additional "cmake").

So the build system founds everything needed and the compiler generated the application but the batch scripts can't be used as they are.

I found the cause in a Todo in mitkFunctionGetLibrarySearchPaths.cmake:

  1. The code below is sub-optimal. It makes assumptions about
  2. the structure of the build directories, pointed to by
  3. the *_DIR variables. Instead, we should rely on package
  4. specific "LIBRARY_DIRS" variables, if they exist.

I will fix the bug according to my current requirements in my Github fork and update this bug once ready.

Event Timeline

Changes made to satify external libs that provide cmake targets and commited in branch of fork: https://github.com/iwegner/MITK/tree/bug-18540-FixExternalLibsAssumptions

Only minor changes done, no refactoring!

kislinsk claimed this task.
kislinsk added a subscriber: kislinsk.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.