KitwareMedical/TubeTK — pull request #297 by jcfr (2014-06-03 23:13:39+00:00)
Title: COMP: Fix building of TubeTK application as standalone packages

This commit fixes the build error mentioning that the
"itkFactoryRegistration.h" header couldn't be found. See [1] and [2]

It basically reverts the original attempt done by commit b74d53f7ab and
references the correct directories using

${TubeTK_SLICER_(BINARY|SOURCE)_DIR}/Libs/ITKFactoryRegistration

instead of

${TubeTK_SLICER_(BINARY|SOURCE)_DIR}/Libs/itkFactoryRegistration

Note that only build machine having case sensitive file system were
failing. (This excludes Windows and some flavor of MacOSX)

Additionally, it also:

* re-organize the code to minimize duplication by using *_(BINARY|SOURCE)_DIR
variables

* set SlicerExecutionModel cache variables. These variables (listed below)
are used by the macro "SEMMacroBuildCLI" to customize the configuration
and build of CLIs.

* remove the uneeded call to "include_directories(...)" that became
unnecessary after setting the SlicerExecutionModel cache variables.

Let's also point out the inconsistency in usage of variable "TubeTK_USE_VTK"
are not fixed by this commit. For example, SlicerBaseCLI is in-conditionally
checked out but the associated directories are conditionally appended to the
list of additional SlicerExecutionModel directories.

Last but not least, the ideal solution would be update ITKv4 to avoid
the ITKFactoryRegistration hack [3] and also add the plugin watcher
directly to the SlicerExecutionModel [4][5]. This would avoid to depend
on Slicer internal libraries when building TubeTK as a standalone package.

[1] http://open.cdash.org/viewBuildError.php?buildid=3353524

[2] https://travis-ci.org/aylward/TubeTK/builds/26625681

[3] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21592

[4] http://massmail.spl.harvard.edu/public-archives/slicer-devel/2011/006829.html

[5] https://github.com/Slicer/SlicerExecutionModel/issues/13