BUG: Fix compile error related to "WrapValue" unit methods

Following commit r22055 [1], three new methods have been introduced:
- WrapValueWithPrefix
- WrapValueWithSuffix
- WrapValueWithPrefixAndSuffix

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

This was causing a build error on linux:

 In member function ‘std::string vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix(std::string&)’:
 ../vtkMRMLUnitNode.cxx:183: error: no matching function for call to ‘vtkMRMLUnitNode::WrapValueWithPrefix(std::string)’
 ../vtkMRMLUnitNode.cxx:159: note: candidates are: std::string vtkMRMLUnitNode::WrapValueWithPrefix(std::string&)

Making the method const correct fixed the problem.

More details about the error are reported here: http://stackoverflow.com/questions/1565600/how-come-a-non-const-reference-cannot-bind-to-a-temporary-object

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22060 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: vtkMRMLUnitNodeTest1 use size_t instead of int

This fixes the warnings for linux brought by r22053

  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx: In function ‘bool TestScenesUnitNodeID(vtkMRMLScene*)’:
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx:86: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx:92: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx: In function ‘bool TestUnitNodeAttribute(vtkMRMLScene*)’:
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx:121: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

And the same kind of warning in the logic test.

See Issue #1694

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22061 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix annotation logic build error

Two things here:
1 - Unused variable warning:
  Slicer4/Modules/Loadable/Annotations/Logic/vtkSlicerAnnotationModuleLogic.cxx:1998: warning: unused variable 'lengthUnit' [-Wunused-variable]

This is fixed by deleting the unused pointer

2 - ostringstream error:
  /Slicer4/Modules/Loadable/Annotations/Logic/vtkSlicerAnnotationModuleLogic.cxx:2018: error: no matching function for call to 'std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(double)'
  /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/sstream:433: note: candidates are: std::basic_ostringstream<_CharT, _Traits, _Alloc>::basic_ostringstream(const std::basic_string<_CharT, _Traits, _Alloc>&, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
  /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/sstream:412: note:                 std::basic_ostringstream<_CharT, _Traits, _Alloc>::basic_ostringstream(std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
  /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/iosfwd:79: note:                 std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(const std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&)
  /Slicer4/Modules/Loadable/Annotations/Logic/vtkSlicerAnnotationModuleLogic.cxx:2107: error: no matching function for call to 'vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix(std::string)'
  /Slicer4/Libs/MRML/Core/vtkMRMLUnitNode.h:73: note: candidates are: std::string vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix(std::string&)
  /Slicer4/Modules/Loadable/Annotations/Logic/vtkSlicerAnnotationModuleLogic.cxx:2128: error: no matching function for call to 'vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix(std::string)'
  /Slicer4/Libs/MRML/Core/vtkMRMLUnitNode.h:73: note: candidates are: std::string vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix(std::string&)

This is fized by using the ostringstream more properly.

See Issue #1694

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22062 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Do not require "if(NOT Slicer_SOURCE_DIR)" in extension

Before this commit, to allow extension or module to be bundled
directly within Slicer by setting the variable
Slicer_EXTENSION_SOURCE_DIRS, it was required to explicitly exclude
the call to:
 find_package(Slicer ...)
 include(${Slicer_USE_FILE})
 include(${Slicer_EXTENSION_CPACK})
by check if Slicer_SOURCE_DIR was set .

This commit improves the build system so that making this
call is a no-op when bundling modules or extensions.

This will allow extension developer to write simpler CMakeLists.txt



Before:

cmake_minimum_required(VERSION 2.8.9)

if(NOT Slicer_SOURCE_DIR)
  find_package(Slicer COMPONENTS ConfigurePrerequisites)
endif()

if(NOT Slicer_SOURCE_DIR)
  set(EXTENSION_NAME EmptyExtensionTemplate)
  set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/EmptyExtensionTemplate")
  set(EXTENSION_CATEGORY "Examples")
  set(EXTENSION_CONTRIBUTORS "Jean-Christophe Fillion-Robin (Kitware)")
  set(EXTENSION_DESCRIPTION "This is an example of extension bundling N module(s)")
  set(EXTENSION_ICONURL "http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Extensions/Testing/EmptyExtensionTemplate/EmptyExtensionTemplate.png?revision=21746&view=co")
  set(EXTENSION_SCREENSHOTURLS "http://wiki.slicer.org/slicerWiki/images/4/42/Slicer-r19441-EmptyExtensionTemplate-screenshot.png")
endif()

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


add_subdirectory(ModuleA)

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




After:

cmake_minimum_required(VERSION 2.8.9)

find_package(Slicer COMPONENTS ConfigurePrerequisites)

project(EmptyExtensionTemplate)

set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/EmptyExtensionTemplate")
set(EXTENSION_CATEGORY "Examples")
set(EXTENSION_CONTRIBUTORS "Jean-Christophe Fillion-Robin (Kitware)")
set(EXTENSION_DESCRIPTION "This is an example of empty extension")
set(EXTENSION_ICONURL "http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Extensions/Testing/EmptyExtensionTemplate/EmptyExtensionTemplate.png?revision=21746&view=co")
set(EXTENSION_SCREENSHOTURLS "http://wiki.slicer.org/slicerWiki/images/4/42/Slicer-r19441-EmptyExtensionTemplate-screenshot.png")

find_package(Slicer REQUIRED)
include(${Slicer_USE_FILE})

add_subdirectory(ModuleA)

include(${Slicer_EXTENSION_CPACK})

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22063 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: UseSlicer - Check variable only if required

Before this commit all three variables
 - EXTENSION_NAME
 - MODULE_NAME
 - PROJECT_NAME
where checked even if EXTENSION_NAME was already set. In case
no "project()" call was done in the extension/module CMakeLists.txt,
the associated output was confusing.

For example:

[...]
-- Checking EXTENSION_NAME variable
-- Checking EXTENSION_NAME variable - SkullStripper
-- Checking MODULE_NAME variable
-- Checking MODULE_NAME variable - SkullStripper
-- Checking PROJECT_NAME variable
-- Checking PROJECT_NAME variable - Project
[...]

This commit change the logic so that the "checking" message is
displayed only if the associated variable is either empty or not
defined.

For example, the output is now:

[...]
-- Checking EXTENSION_NAME variable
-- Checking EXTENSION_NAME variable - SkullStripper
[...]

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22064 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Accept trailing "/" for path passed using extension source dirs

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22065 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Easier distinction of bundled extension configure step

Simply display a separator between configured extension.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22066 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify extension template

Based on commit r22063[1] message, this commit remove code explicitly
excluding extension specific CMake call.

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

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