Slicer: 2145-support-for-installing-extension-from-file 9fd742e6

Author Committer Branch Timestamp Parent
jcfr jcfr 2145-support-for-installing-extension-from-file 2013-05-30 01:34:17 2145-support-for-installing-extension-from-file 5036d0a4
Changeset

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

mod - CMake/LastConfigureStep/CMakeLists.txt Diff File
mod - CMake/SlicerConfig.cmake.in Diff File
mod - CMake/SlicerExtensionCPack.cmake Diff File
mod - CMake/SlicerGenerateSlicerConfig.cmake Diff File
mod - CMake/UseSlicer.cmake.in Diff File
mod - CMakeLists.txt Diff File