COMP: Simplify extension template by using default value for EXTENSION_DEPENDS

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19845 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Prevent confusion by removing unused CMake variable

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19846 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Easier understanding of Editor extension template by making CMakeLists.txt  consistent.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19847 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Ensure that failing python unit tests are reported as failing test

* This regression was introduced following r19581 [1]

* To prevent this issue from occurring again, a regression test
is also added.

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

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19848 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Extension can reference Slicer_LAUNCH* variables even if BUILD_TESTING OFF

Slicer doesn't have to be build with Testing enabled to allow
extension to be build and tested.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19849 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Fix doxygen comment of qSlicerCoreCommandOptions::isTestingEnabled function

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19850 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: List of command line option is now consistent with build option

* disable-scripted-loadable-modules is added only if build with Python support

* disable-cli-modules is added only if build with CLI support

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19851 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Ensure generic Python module tests pass when build as extension

After commit r19844 that ensure that python unittest will fail if it applies,
a problem associated with generic python module tests has been discovered.

The following error message was displayed:

   AttributeError: 'module' object has no attribute 'scriptedloadableextensiontemplate'


This was explained by the fact the path where the module was located
wasn't considered by the module factory manager.

To address that problem, a new command line option named

  --additional-module-paths

has been added.


The given list of path will added to the factory module manager.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19852 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Ensure environment is set when running "out-of-source" scripted modules tests.

This is a follow up to r19827 [1] where it was mentioned that

   "PYTHONPATH is updated so that python module associated with
   a module could be imported. For example, the scripted module."

It resumes that at the time of that commit, this was an incorrect statement.
Indeed, the python macro defined in SlicerMacroPythonTesting where
relying on "Slicer_LAUNCHER_EXECUTABLE" whereas the variable updated
with '--launcher-additional-settings' was "Slicer_LAUNCH_COMMAND".

This commit set the command line option specific to launcher additional settings
into a variable that could be re-used:

    Slicer_ADDITIONAL_LAUNCHER_SETTINGS

The macro SLICER_ADD_PYTHON_TEST and SLICER_ADD_PYTHON_UNITTEST have been
updated to consider that variable.

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

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19853 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Ease usage of "Slicer_USE_FILE" by documenting and modularizing

* The file has been commented

* The "behavior" of the file can be customized using Slicer_SKIP_* variables

* Convenient functions/macros has also been introduced:
  slicer_check_variable
  slicer_setting_variable_message
  _slicer_skip_message

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19854 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Reduce the overhead involved creating extension bundling exactly ONE module

The idea is to facilitate the process involved to convert a slicer module
into an extension.

In case the extension contain one module, all metadata associated with
an extension can be described using the "MODULE_*" variables.

In other word, assuming a module named "Foo" is already defined
in Slicer using the following:

// ----------------------
...
set(MODULE_NAME Foo)
set(MODULE_CATEGORY "Examples")
set(MODULE_STATUS "Beta")
set(MODULE_CONTRIBUTORS "Jean-Christophe Fillion-Robin (Kitware)")
set(MODULE_DESCRIPTION "This is an example of Qt loadable module built as an extension")

...

slicerMacroBuildQtModule(...)

...
// ----------------------

it could be converted into an extension by adding 9 lines.


// ----------------------
cmake_minimum_required(VERSION 2.8.7)
...
set(MODULE_NAME Foo)
set(MODULE_CATEGORY "Examples")
set(MODULE_STATUS "Beta")
set(MODULE_CONTRIBUTORS "Jean-Christophe Fillion-Robin (Kitware)")
set(MODULE_DESCRIPTION "This is an example of Qt loadable module built as an extension")

...
if(NOT Slicer_SOURCE_DIR)
  find_package(Slicer REQUIRED)
  include(${Slicer_USE_FILE})

  include(SlicerEnableExtensionTesting)
endif()
...

slicerMacroBuildQtModule(...)

...

if(NOT Slicer_SOURCE_DIR)
  include(${Slicer_EXTENSION_CPACK})
endif()
// ----------------------

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19855 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Prevent a same author warning from being duplicated when configuring extension.

This is achieved by internally setting a variable <VARANME>_AUTHOR_WARN.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19856 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Modularize extension build system by creating "SlicerBlockAdditionalLauncherSettings"

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19857 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: More consistency by setting all extension default values in UseSlicer.cmake

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19858 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Simplify extension template using MODULE_* variables

This is a follow up of r19855 [1]

The idea is to facilitate the process involved to convert a slicer module
into an extension.

In case the extension contain one module, all metadata associated with
an extension can be described using the "MODULE_*" variables.


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

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19859 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Remove extra comment in extension templates

Since the location of the project() call may change, it's preferable not
to indicate the current location.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19860 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Prevent confusion by removing extra code from Superbuild extension template.

Since by default a superbuild extension can't be dropped in a Slicer
source tree, let's remove the "if(Slicer_SOURCE_DIR)"

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19861 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Simplify organization - Testing macros are now included in UseSlicer.cmake

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19862 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Move AdditionalLauncherSettings into a more meaningful location.

Its new home is the UseSlicer.cmake where the environment of an extension is
setup.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19863 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Remove extra comment.

This a follow up of r19860

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=19860

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