Commit 4a2038a9 authored by hjohnson's avatar hjohnson
Browse files

ENH: Encapsulated the SlicerExecutionModel requirements so that it is easier...

ENH: Encapsulated the SlicerExecutionModel requirements so that it is easier to develop compliant applications without the burden of building all of Slicer.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@12514 3bd1e089-480b-0410-8dfb-8563597acbee
parent 10ffdbc4
......@@ -663,6 +663,7 @@ set( Slicer3_EXE ${Slicer3_BINARY_DIR}/Slicer3 )
###################
##BRAINSDemonWarp
SET(cli_modules
MRIBiasFieldCorrection
SparseFieldLevelSetContour
......
......@@ -386,12 +386,12 @@ ENDIF (Slicer3_USE_KWWIDGETS)
#-----------------------------------------------------------------------------
# These packages may exist within the Slicer3 source tree
#
set(GenerateCLP_DIR ${Slicer3_BINARY_DIR}/Libs/GenerateCLP)
set(TCLAP_DIR ${Slicer3_BINARY_DIR}/Libs/SlicerExecutionModel/tclap)
set(ModuleDescriptionParser_DIR ${Slicer3_BINARY_DIR}/Libs/SlicerExecutionModel/ModuleDescriptionParser)
set(GenerateCLP_DIR ${Slicer3_BINARY_DIR}/Libs/SlicerExecutionModel/GenerateCLP)
set(GenerateLM_DIR ${Slicer3_BINARY_DIR}/Libs/GenerateLM)
set(ModuleDescriptionParser_DIR ${Slicer3_BINARY_DIR}/Libs/ModuleDescriptionParser)
set(LoadableModule_DIR ${Slicer3_BINARY_DIR}/Libs/LoadableModule)
set(vtkITK_DIR ${Slicer3_BINARY_DIR}/Libs/vtkITK)
set(TCLAP_DIR ${Slicer3_BINARY_DIR}/Libs/tclap)
#-----------------------------------------------------------------------------
# Qt Loadable Modules
......
......@@ -18,11 +18,11 @@
#
#
SET(TCLAP_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/SlicerExecutionModel/tclap)
SET(ModuleDescriptionParser_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/SlicerExecutionModel/ModuleDescriptionParser)
SET(GenerateCLP_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/SlicerExecutionModel/GenerateCLP)
SET(Slicer3_USE_FILE_CONFIG ${Slicer3_BINARY_DIR}/UseSlicer3.cmake)
SET(TCLAP_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/tclap)
SET(ModuleDescriptionParser_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/ModuleDescriptionParser)
SET(LoadableModule_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/LoadableModule)
SET(GenerateCLP_DIR_CONFIG ${Slicer3_BINARY_DIR}/Libs/GenerateCLP)
SET(Slicer3_Libs_INCLUDE_DIRS_CONFIG ${Slicer3_Libs_INCLUDE_DIRS})
SET(Slicer3_Libs_LIBRARY_DIRS_CONFIG ${Slicer3_BINARY_DIR}/bin ${Slicer3_BINARY_DIR}/lib)
......
project(SlicerLibs)
## Delegate the building of the SlicerExecutionModel to
## a bundled subdirectory that can easily be included in
## other packages.
set(ModuleDescriptionParser_USE_PYTHON ${Slicer3_USE_PYTHON})
ADD_SUBDIRECTORY(SlicerExecutionModel)
set(dirs
tclap
ModuleDescriptionParser
GenerateCLP
# FileWatcher
)
......@@ -78,7 +81,6 @@ ENDIF(CUDA_SUPPORT_ENABLED)
set(include_dirs)
set(libs)
set(ModuleDescriptionParser_USE_PYTHON ${Slicer3_USE_PYTHON})
set(LoadableModule_USE_PYTHON ${Slicer3_USE_PYTHON})
set(IGT_USE_IGSTK ${Slicer3_USE_IGSTK})
......@@ -113,7 +115,7 @@ string(REPLACE MRMLIDImageIO MRMLIDIO libs "${libs}")
# Those are not libs
list(REMOVE_ITEM libs tclap GenerateCLP GenerateLM slicerio)
list(REMOVE_ITEM libs GenerateLM slicerio)
slicer3_get_persistent_property(Slicer3_Libs_LIBRARIES tmp)
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES ${tmp} ${libs})
......
......@@ -7,7 +7,6 @@ ENDIF(COMMAND CMAKE_POLICY)
MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
find_package(GenerateCLP REQUIRED)
if(GenerateCLP_FOUND)
include(${GenerateCLP_USE_FILE})
......@@ -31,7 +30,7 @@ endif(VTK_FOUND)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build with shared libraries." ON)
endif(NOT DEFINED BUILD_SHARED_LIBS)
set(GENERATELM_SOURCE GenerateLM.cxx)
generateclp(GENERATELM_SOURCE GenerateLM.xml)
add_executable(GenerateLM ${GENERATELM_SOURCE})
......@@ -47,7 +46,7 @@ endif(BUILD_TESTING)
include(GenerateGenerateLMConfig.cmake)
install(TARGETS GenerateLM RUNTIME
install(TARGETS GenerateLM RUNTIME
DESTINATION bin COMPONENT Development
)
install(FILES ${GenerateLM_BINARY_DIR}/GenerateLMConfig.cmake_install
......@@ -70,11 +69,11 @@ install(FILES ${GenerateLM_BINARY_DIR}/UseGenerateLM.cmake_install
set(GenerateLM_FORWARD_DIR_BUILD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
set(GenerateLM_FORWARD_DIR_INSTALL ".")
if(WIN32)
set(GenerateLM_FORWARD_PATH_BUILD
set(GenerateLM_FORWARD_PATH_BUILD
"\"${GenerateLM_FORWARD_DIR_BUILD}\" CONFIG_DIR_POST,\"${VTK_DIR}/bin\" CONFIG_DIR_POST,\"${ITK_DIR}/bin\" CONFIG_DIR_POST")
set(GenerateLM_FORWARD_PATH_INSTALL "\"\"")
else(WIN32)
set(GenerateLM_FORWARD_PATH_BUILD
set(GenerateLM_FORWARD_PATH_BUILD
"\"${GenerateLM_FORWARD_DIR_BUILD}\",\"${VTK_DIR}/bin\",\"${ITK_DIR}/bin\"")
set(GenerateLM_FORWARD_PATH_INSTALL
"\"../lib/GenerateLM\",\"../lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}\",\"../lib/InsightToolkit\",\"../lib/LoadableModule\"")
......@@ -89,8 +88,8 @@ if(NOT WIN32)
add_executable(GenerateLMLauncher
${CMAKE_CURRENT_BINARY_DIR}/GenerateLMLauncher.c)
add_dependencies(GenerateLMLauncher GenerateLM)
install(TARGETS GenerateLMLauncher RUNTIME
install(TARGETS GenerateLMLauncher RUNTIME
DESTINATION bin COMPONENT Development
)
endif(NOT WIN32)
......
PROJECT( SlicerExecutionModel )
set(LOCAL_PROJECT_NAME SlicerExecutionModel)
cmake_minimum_required(VERSION 2.6)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
cmake_policy(VERSION 2.8)
endif("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
##NOTE: Only build these items if they have not already been identified.
## This allows for these items to be skipped if building against Slicer versions
if(NOT ITK_FOUND)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
endif(NOT ITK_FOUND)
## A simple macro to set variables ONLY if it has not been set
## This is needed when stand-alone packages are combined into
## a larger package, and the desired behavior is that all the
## binary results end up in the combined directory.
## The signature has the same signature as the set, it just checks if the value is already set before executing.
if(NOT SETIFEMPTY)
macro(SETIFEMPTY)
set(KEY ${ARGV0})
set(VALUE ${ARGV1})
if(NOT ${KEY})
set(${ARGV})
endif(NOT ${KEY})
endmacro(SETIFEMPTY KEY VALUE)
endif(NOT SETIFEMPTY)
###
SETIFEMPTY(TCLAP_DIR ${CMAKE_CURRENT_BINARY_DIR}/tclap CACHE PATH "Location of TCLAPConfig.cmake" FORCE)
ADD_SUBDIRECTORY(tclap)
SETIFEMPTY(ModuleDescriptionParser_DIR ${CMAKE_CURRENT_BINARY_DIR}/ModuleDescriptionParser CACHE PATH "Location of ModuleDescriptionParserConfig.cmake" FORCE)
ADD_SUBDIRECTORY(ModuleDescriptionParser)
SETIFEMPTY(GenerateCLP_DIR ${CMAKE_CURRENT_BINARY_DIR}/GenerateCLP CACHE PATH "Location of GenerateCLPConfig.cmake" FORCE)
ADD_SUBDIRECTORY(GenerateCLP)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment