Slicer: 2145-support-for-installing-extension-from-file 3bcf451e

Author Committer Branch Timestamp Parent
jcfr jcfr 2145-support-for-installing-extension-from-file 2013-02-24 00:16:35 2145-support-for-installing-extension-from-file 20be5b5a
Affected Issues 0002883: Fix FindDCMTK.cmake provided by ITKv4
Changeset

COMP: Update ITKv4 tag to ensure Slicer DCMTK libraries are used.

Warning: Since the ITK version will now be 4.4 instead of 4.3. It is
recommended that developers should make sure to remove "4.3" related
library from their build tree.
On macosx/linux, one way of removing the libraries would be:
cd /path/to/Slicer-Superbuild/ITK-build
rm -rf lib/4.3

This commit intend to fix issue detailed in both Slicer
issue 2883 and issue 2978.

In a nutshell, a link error like the following was occurring:

Linking CXX executable ../../../lib/Slicer-4.2/cli-modules/DTIimport
/path/to/Slicer-build/ITKv4-build/lib/libITKIODCMTK-4.4.so.1: undefined reference to OFFilename::OFFilename(char const*, bool)' /path/to/Slicer-build/ITKv4-build/lib/libITKIODCMTK-4.4.so.1: undefined reference toOFFilename::~OFFilename()'
collect2: error: ld returned 1 exit status
make[5]: *** [lib/Slicer-4.2/cli-modules/DTIexport] Error 1

In that specific case, the CMakeCache of ITK build was referencing
the wrong dcmdata library:
DCMTK_dcmdata_LIBRARY:FILEPATH=/usr/lib/libdcmdata.so

... whereas it should have been:
DCMTK_dcmdata_LIBRARY:FILEPATH=/path/to/Slicer-build/DCMTK-install/lib/libdcmdata.a

ITK commit 31bc608a [1] updated Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake
so that default path are explicitly ignored when looking for DCMTK libraries.
This will ensure that the DCMTK library built by Slicer will be used.

The option NO_DEFAULT_PATH associated with the command "find_library" [2] is
now used.

Let's also note that the other "FindDCMTK.cmake" modules available in ITKv4
haven't been fixed and could lead to similar similar issue [3][4]. As of today,
this is probably not an issue within Slicer. Indeed, ITK is not built with
GDCM support and DCMTK seems not be used within VNL. (It means the associated
DCMTK cmake files should probably be removed.)

See http://www.na-mic.org/Bug/view.php?id=2883 and http://www.na-mic.org/Bug/view.php?id=2978
Fixes 0002883 and 0002978

[1] https://github.com/Kitware/ITK/commit/b9c473e241d46bc79d6750ffae73a112b0dcae7c
[2] http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:find_library
[3] ./Modules/ThirdParty/VNL/src/vxl/config/cmake/Modules/NewCMake/FindDCMTK.cmake
[4] ./Modules/ThirdParty/GDCM/src/gdcm/CMake/FindDCMTK.cmake

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21772 3bd1e089-480b-0410-8dfb-8563597acbee

mod - SuperBuild/External_ITKv4.cmake Diff File