BUG: Fixed update problem on selecting different Tensor Property in TractographyDisplay module

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21941 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Add DCMTK library paths to build settings

Allows dlls to be found on windows in a build tree.  This is needed
after commit 21914 was committed to address bug 3040.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21942 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix startup crash due to improper dynamic linking of python dll

This problem affect the a windows build tree of Slicer.

On windows, as explained in [1], system path are searched before path
appended to PATH variable.

[1] Title: Search Path Used by Windows to Locate a DLL
    Link:  http://msdn.microsoft.com/en-us/library/7d83bc18(v=vs.90).aspx

Following the introduction of CMake'ified python (r21863), python 2.7.3 is
now used. Since developer also have a similar version installed on their
system, this is causing Slicer to crash due to binary incompatibility
between the patched version build by Slicer (r21848) and the one
installed on the system.

While this commit address the immediate issue specific to python, the same
problem would occur with VTK, Qt, ITK or any other Slicer external projects
is already installed in the system. The solution implemented by this commit
will have to be revisited.

See http://www.na-mic.org/Bug/view.php?id=1180
Fixes #1180

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21943 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Include DCMTK shared libraries in packages

Now that DCMTK is built as shared rather than static, the
dlls need to be copied into the install tree for packaging.

See also commit 21914 and bug #3040.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21944 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Simplify CMake code re-using already set variable

As of r16822, the variable PYTHON_LIBRARY_PATH is set in the top-level
CMakeLists.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21945 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix hook error specific Git bash/GUI using an old version of BASH.

Thanks Sankhesk for his help.

See http://www.na-mic.org/Bug/view.php?id=3086
Fixes #3086

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21946 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Tweak installation of DCMTK libraries for MacOSX packaging

Following commit r21914, DCMTK libraries are build as shared
library. Commit r21944 ensured that they were installed. Since on MacOSX
the fixup process takes care of copying the library associated with
external projects, this commit exclude the systematic installation
of DCMTK libraries and teach the fixup script where these libraries
are located.

See issue #3040

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21947 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Fix config error introduced in r21943 by using PYTHON_LIBRARY_PATH

See issue #1180 - http://www.na-mic.org/Bug/view.php?id=1180

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21948 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: On MacOSX, do not create duplicate of MRMLIDIOPlugin and MGHIOPlugin

This fix MacOSX warning "/path/to/plugin is already loaded"

Both MRMLIDIOPlugin and MGHIOPlugin were copied so that it exists both
a "dylib" and a "so" version of the file. This was initially committed
on the 2007-09-27 to work around a limitation of ITK preventing it from
loading plugin having ".dylib" extension. See Slicer3 r4454 [1]

Then 2 months later, on the 2007-11-19, a fix has been pushed in ITK so
that plugin having extension "dylib" are considered. See ITK commit 28b4a6ba [2]

This commit account for the ITK fix by removing the code in charge of
copying the plugin.

Lessons learned: When implementing a hack, it is a good practice to report
a bug upstream to track the limitation and also reference the bug in a
comment starting with either "# HACK" for CMake file or "// HACK" for
c/cpp files. It would give a hint to developer re-factoring the code.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer3?view=revision&revision=4454
[2] https://github.com/Kitware/ITK/commit/28b4a6ba
ENH: Move MacOSX configuration code for CLI factory to a better place.

As a slight improvement, the path is also appended only if it exists.
ENH: Simplify logic by appending path to CLI factory only if they exist.
STYLE: Do not check for version of CMake before including "BundleUtilities"

Since minimum required CMake version for Slicer is 2.8.9, this message
is not needed anymore.
COMP: Ensure Python library directory is considered when fixing up package

When the expression "@SLICER_PYTHON_LIB_DIR@" has been introduced
in commit r21252 [1], it was already resolving to an empty
string because since r15463 [2] the file SlicerBlockCTKAppLauncherSettings is
included in the Applications/SlicerApp/CMakeLists.txt.

Both the fixup script and the launcher settings have been updated to
use the variable "PYTHON_LIBRARY_PATH" introduced in the top-level
CMakeLists.txt by commit r16822 [3]

To prevent such error from happening again, a convenient macro named
"_fixup_paths_append" has been introduced. It basically check if the path
passed as parameter exists and append it to the list of paths. If not,
it throw an error.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21252
[2] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=15463
[3] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=16822
COMP: Ensure library paths used for BundleFixup are valid

The helper macro "_fixup_paths_append" is now used consistently to append
path to the "libs_path" variable.

Let's also note the following updates:

 - CMAKE_RUNTIME_OUTPUT_DIRECTORY is not used anymore, instead
${Slicer_BUILD_DIR}/@Slicer_BIN_DIR@ is used.

 - Path "@Slicer_BINARY_DIR@/@Slicer_QtPlugins_DIR@" is not considered
anymore since it didn't exist in the build tree. Instead, the plugin path
are composed using "${Slicer_BUILD_DIR}/@Slicer_BIN_DIR@"
COMP: Do now explicitly fixup CLI shared library

Considering that (1) CLI shared lirbary are dependency
of CLI executable and (2) CLI executable are already discovered by the
fixup mechanism. There are no need to use canidate pattern for CLI
shared library.
COMP: Simplify expression used in gp_item_default_embedded_path_override.
COMP: Remove hack forcing CMAKE_INSTALL_NAME_TOOL to be empty

In commit r21242 [1], CMAKE_INSTALL_NAME_TOOL has been disabled to ensure
the "gp_item_default_embedded_path_override" function could match
library that are expected to go in specific folders like "cli-modules",
"qt-loadable-modules", [...]. By disabling CMAKE_INSTALL_NAME_TOOL,
the match was possible using full path to each one of the
direct dependencies of a given library.

This approach saw its limitation when trying to have CLI executable
installed in "path/to/Contents/cli-modules" and the shared library copied
into "path/to/Contents/lib/Slicer-4.2/cli-modules". Indeed, the shared
library were systematically copied along side the executable in addition
to the the one existing in the "path/to/Contents/lib/Slicer-4.2/cli-modules"
directory.

This commit doesn't do the match based on the full path embedded in the
library, instead it globs for the expected library in the build tree and
then check if a given item name match the list of library "globed" in the
associated directory.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21242
BUG: Ensure library can be loaded from different place using @rpath/@loader