Adding possibility to dynamically change the layout of the dicomTableManager
ctkDicomBrowser uses dynamic table layout now
COMP: FindDCMTK - Exclude -D from DCMTK_DEFINITIONS for easier re-use

Since target properties like COMPILE_DEFINITIONS
or INTERFACE_COMPILE_DEFINITIONS do not expect definition to include "-D",
this commit exclude it from definition list associated
with DCMTK_DEFINITIONS.
Merge branch '382-fix-find-dcmtk-issue'

* 382-fix-find-dcmtk-issue:
  COMP: FindDCMTK - Exclude -D from DCMTK_DEFINITIONS for easier re-use
Associate DCMTK_DEFINITIONS to CTKDICOMCore

Following commit 12c052ff1, FindDCMTK.cmake has been updated to
detect if HAVE_CONFIG_H should be passed when compiling against
older version of DCMTK packaged on Debian.

To keep build system of project depending on CTK simple, instead of
manually adding the definition for all target depending
on CTKDCMTKCore, the definition is added as a target
property INTERFACE_COMPILE_DEFINITIONS to CTKDCMTKCore in CTKConfig.cmake.

That way, all target depending on the imported target CTKDCMTKCore
will automatically specify the -DHAVE_CONFIG_H flag.

Since the property INTERFACE_COMPILE_DEFINITIONS has been added
in CMake 2.8.11, it will still be required to specify the definition
manually in project using older version of CMake.

See #413
Merge branch '413-associated-dcmtk-definitions-to-ctkdicomcore'

* 413-associated-dcmtk-definitions-to-ctkdicomcore:
  Associate DCMTK_DEFINITIONS to CTKDICOMCore

Fixes #413
Put all tags for a given instance into a list for a single batch insert

Addresses #414 by using the execBatch feature of QSQLQuery.

Might still be improved if we can do other operations as batch inserts
as well.
Active window flag transferred on RequestSoftwareInputPanel event

The widgets on a ctkPopupWidget could not get the keyboard focus
because the window of the popup widget was not active. Since only
one window can be active at a time, the 'active' flag should always
be transfered to the window that requests the keyboard input.

Fixes #409
Merge pull request #410 from NifTK/409-widgets-on-ctkPopupWidget-do-not-get-keyboard-focus

Active window flag transferred on RequestSoftwareInputPanel event
Add DCMTK 3.6.0 support to CTK application.

Since the ctkDICOMUtil method have been updated in commit 12c052f to work
with DCMTK 3.6.0, this commit update the application code to use it.

See #405
Merge branch '405-support-dcmtk-360'

* 405-support-dcmtk-360:
  Add DCMTK 3.6.0 support to CTK application.
Merge pull request #415 from pieper/414-batch-insert-tags

Put all tags for a given instance into a list for a single batch insert

Thanks for the reviews @nolden and @jcfr - I'm going to go ahead and do the merge (same tests fail as before ;( so no harm from this pull.
Fix configuration of CTKConfig based on DCMTK_HAVE_CONFIG_H_OPTIONAL value

This fixes the logic introduced by commit a32f524. Since the variable
is set to TRUE or FALSE only when DCMTK is looked up without using
DCMTKConfig, in case CTK is build against a version of DCMTK providing
DCMTKConfig, we need to also check if it is defined.

See #413
Merge branch '413-associated-dcmtk-definitions-to-ctkdicomcore'

* 413-associated-dcmtk-definitions-to-ctkdicomcore:
  Fix configuration of CTKConfig based on DCMTK_HAVE_CONFIG_H_OPTIONAL value
Add convenience function "ctk_list_to_string"

In the mean time, work to integrate this feature directly
into CMake has also been started.
See http://www.cmake.org/Bug/view.php?id=14583

See #418
Automatically reformat list passed to "CTK" inner build.

See #418
COMP: Add support for CTK_USE_SYSTEM_* options

This commit update CTK build system to support configuring CTK
passing CTK_USE_SYSTEM_* CMake variables.

To do so it introduces a new macro allowing to recursively traverse the
external projects dependency tree.

The traversal is done in two passes. The first pass traverses the complete
tree to set the value of CTK_USE_SYSTEM_*.

The second pass invokes the "ExternalProject_Add" function and displays
informative messages.

[...]
-- Generating done
-- Build files have been written to: /home/jchris/Projects/CTK-Debug/ExternalProjectsContrib-proj
[...]
[100%] Built target ExternalProjectsContrib
-- SuperBuild - First pass
-- SuperBuild - First pass - done
-- SuperBuild - Log4Qt[OPTIONAL]
-- SuperBuild - ZMQ[OPTIONAL]
-- SuperBuild - OpenIGTLink[OPTIONAL]
-- SuperBuild - XIP[OPTIONAL]
-- SuperBuild - ITK[OPTIONAL]
-- SuperBuild - CTK => Requires VTK, PythonQt, DCMTK, QtSOAP, qxmlrpc, CTKData, QuaZip, qRestAPI,
-- SuperBuild -   VTK[OK]
-- SuperBuild -   PythonQt[OK]
-- SuperBuild -   DCMTK[OK] (SYSTEM)
[...]
-- SuperBuild -   QtSOAP[OK]
-- SuperBuild -   qxmlrpc[OK]
-- SuperBuild -   CTKData[OK]
-- SuperBuild -   QuaZip[OK]
-- SuperBuild -   qRestAPI[OK]
-- SuperBuild - CTK[OK]
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jchris/Projects/CTK-Debug

An external project could be either:

 - Optional: The project is not required considering the current
             CTK options.

 - Ok: The project has just been included. If the suffix "(SYSTEM)" is
       displayed, it means the libraries (and headers) installed on the
       system will be used.

 - Included: The project has already been included because of prior
             requirement.

Support for the following options has been added:

  -DCTK_USE_SYSTEM_ITK:BOOL=ON
  -DCTK_USE_SYSTEM_DCMTK:BOOL=ON
  -DCTK_USE_SYSTEM_OpenIGTLink:BOOL=ON
  -DCTK_USE_SYSTEM_VTK:BOOL=ON
  -DCTK_USE_SYSTEM_KWStyle:BOOL=ON

In case you have some external project files living in your
fork of ExternalProjectsContrib, a small migration guide as been
written to help you transition.

See http://www.commontk.org/index.php/Documentation/MigrationGuide/ExternalProject#Transitioning_to_ExternalProject_following_0c423189d


Remarks:

Removed the variable "CTK_POSSIBLE_DEPENDENCIES". CTK_DEPENDENCIES
variable is now set in the main CMakeLists.txt and then updated based on
the configure option and libraries/apps/plugins requirements. The update
happens within the "ctkMacroCheckExternalProjectDependency".

See #418
Merge branch '418-support-use-system-option'

* 418-support-use-system-option:
  COMP: Add support for CTK_USE_SYSTEM_* options
  Automatically reformat list passed to "CTK" inner build.
  Add convenience function "ctk_list_to_string"
FindDCMTK - Do not explicitly set DCMTK_DEFINITIONS

Following commit commontk/CTK@12c052 fixing a packaging Debian bug,
the DCMTK_DEFINITIONS was set directly inside the FindDCMTK.cmake
module using "add_definitions".

When used outside of this project, setting automatically the definition
could have some unintended effects. For example, by globally adding
DCMTK_DEFINITIONS (and more specifically HAVE_CONFIG_H), it prevented from
compiling successfully program against the "tclap" library. Compile errors
like the following occurred:

// ------------------
In file included from <DIR>/SlicerExecutionModel/tclap/include/tclap/CmdLine.h:27:0,
                 from <DIR>/Slicer-build/Modules/CLI/CheckerBoardFilter/CheckerBoardFilterCLP.h:13,
                 from <SRC>/Modules/CLI/CheckerBoardFilter/CheckerBoardFilter.cxx:23:
<DIR>/SlicerExecutionModel/tclap/include/tclap/MultiSwitchArg.h:44:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
<DIR>/SlicerExecutionModel/tclap/include/tclap/MultiSwitchArg.h:171:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
In file included from <DIR>/SlicerExecutionModel/tclap/include/tclap/UnlabeledValueArg.h:30:0,
                 from <DIR>/SlicerExecutionModel/tclap/include/tclap/CmdLine.h:28,
                 from <DIR>/Slicer-build/Modules/CLI/CheckerBoardFilter/CheckerBoardFilterCLP.h:13,
                 from <SRC>/Modules/CLI/CheckerBoardFilter/CheckerBoardFilter.cxx:23:
<DIR>/SlicerExecutionModel/tclap/include/tclap/ValueArg.h:43:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
<DIR>/SlicerExecutionModel/tclap/include/tclap/ValueArg.h:97:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
// ------------------

See #382
FindDCMTK - Clean white spaces