Commit 53e57712 authored by jcfr's avatar jcfr

COMP: Ensure external module can directly find Slicer

Following commit r22063, extensions bundled using Slicer_EXTENSION_SOURCE_DIRS
didn't have to use the "if(NOT Slicer_SOURCE_DIR)" safeguard.

This commit move inclusion of external modules from the CLI, Loadable
and Scripted sub-directories into a single "Modules/Remote" folder
included after Slicer_DIR so that external module can also directly call
"find_package(Slicer)"

Thanks to Brad Lowekamp for reporting the issue.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22185 3bd1e089-480b-0410-8dfb-8563597acbee
parent 80e86b65
......@@ -998,6 +998,12 @@ set(Slicer_DIR "${Slicer_BINARY_DIR}/Extensions")
configure_file(
${Slicer_SOURCE_DIR}/CMake/SlicerConfig.cmake.in
${Slicer_DIR}/SlicerConfig.cmake @ONLY)
message(STATUS "--------------------------------------------------")
message(STATUS "Configuring remote modules")
message(STATUS "--------------------------------------------------")
add_subdirectory(Modules/Remote)
# List of extension source directories can be passed at configuration time
# using the following syntax:
# cmake -DSlicer_EXTENSION_SOURCE_DIRS:STRING=/path/to/ExtensionA;/path/to/ExtensionB /path/to/source/Slicer
......
......@@ -129,69 +129,4 @@ foreach(module ${cli_modules})
endif()
endforeach(module)
if(Slicer_BUILD_BRAINSTOOLS)
# NOTE: BRAINSTools source code is checkout using "External_BRAINSTools.cmake".
set(BRAINSTools_CLI_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${Slicer_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${Slicer_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${Slicer_CLIMODULES_BIN_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_INSTALL_LIBRARY_DESTINATION ${Slicer_INSTALL_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_INSTALL_ARCHIVE_DESTINATION ${Slicer_INSTALL_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_INSTALL_RUNTIME_DESTINATION ${Slicer_INSTALL_CLIMODULES_BIN_DIR} CACHE PATH "" FORCE)
if(BUILD_TESTING)
set(LAUNCH_EXE ${SEM_LAUNCH_COMMAND})
endif()
set(USE_BRAINSFit ON CACHE BOOL "Build BRAINSFit" )
set(USE_BRAINSROIAuto ON CACHE BOOL "Build BRAINSROIAuto" )
set(USE_BRAINSResample ON CACHE BOOL "Build BRAINSResample" )
set(USE_BRAINSDemonWarp ON CACHE BOOL "Build BRAINSDemonWarp ")
if("${ITK_VERSION_MAJOR}" GREATER 3)
set(USE_BRAINSTransformConvert ON CACHE BOOL "Build BRAINSTransformConvert ")
set(USE_DWIConvert ON CACHE BOOL "Build DWIConvert ") ## Need to figure out library linking
else()
set(USE_BRAINSTransformConvert OFF CACHE BOOL "Build BRAINSTransformConvert ")
set(USE_DWIConvert OFF CACHE BOOL "Build DWIConvert ")
endif()
## BRAINSTools comes with some extra tool
## options that should not be compiled by default.
set(USE_AutoWorkup OFF CACHE BOOL "" FORCE)
set(USE_ANTS OFF CACHE BOOL "Build with ANTS capabilities" )
set(USE_GTRACT OFF CACHE BOOL "" FORCE)
set(USE_BRAINSABC OFF CACHE BOOL "" FORCE)
set(USE_BRAINSTalairach OFF CACHE BOOL "" FORCE)
set(USE_BRAINSConstellationDetector OFF CACHE BOOL "" FORCE)
set(USE_BRAINSMush OFF CACHE BOOL "" FORCE)
set(USE_BRAINSInitializedControlPoints OFF CACHE BOOL "" FORCE)
set(USE_BRAINSMultiModeSegment OFF CACHE BOOL "" FORCE)
set(USE_BRAINSCut OFF CACHE BOOL "" FORCE)
set(USE_BRAINSLandmarkInitializer OFF CACHE BOOL "" FORCE)
set(USE_ImageCalculator OFF CACHE BOOL "" FORCE)
set(USE_BRAINSSurfaceTools OFF CACHE BOOL "" FORCE)
set(USE_BRAINSSnapShotWriter OFF CACHE BOOL "" FORCE)
set(USE_ConvertBetweenFileFormats OFF CACHE BOOL "" FORCE)
set(USE_BRAINSMultiSTAPLE OFF CACHE BOOL "" FORCE)
set(USE_BRAINSCreateLabelMapFromProbabilityMaps OFF OFF CACHE BOOL "" FORCE)
set(USE_BRAINSContinuousClass OFF CACHE BOOL "" FORCE)
set(USE_ICCDEF OFF CACHE BOOL "" FORCE)
set(USE_BRAINSPosteriorToContinuousClass OFF CACHE BOOL "" FORCE)
set(USE_DebugImageViewer OFF CACHE BOOL "" FORCE)
set(BRAINS_DEBUG_IMAGE_WRITE OFF CACHE BOOL "" FORCE)
# HACK - Ensure BRAINSTools uses the same ExternalData version as Slicer.
# See https://github.com/BRAINSia/BRAINSTools/issues/3
configure_file(
${CMAKE_SOURCE_DIR}/CMake/ExternalData.cmake
${BRAINSTools_SOURCE_DIR}/CMake/ExternalData.cmake
COPYONLY
)
set(ITK_VERSION_MAJOR ${ITK_VERSION_MAJOR} CACHE STRING "")
set(BRAINSTools_SUPERBUILD OFF CACHE BOOL "" FORCE)
add_subdirectory(
${BRAINSTools_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/BRAINSTools
)
endif()
# External modules have been moved to Modules/Remote/CMakeLists.txt
......@@ -42,28 +42,4 @@ foreach(module ${qtmodules})
endif()
endforeach(module)
if(Slicer_BUILD_CLI_SUPPORT AND Slicer_BUILD_EMSegment)
# NOTE: EMSegment source code is checkout from Slicer3 repository using
# "External_EMSegment.cmake".
add_subdirectory(
${EMSegment_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/EMSegment
)
endif()
if(Slicer_USE_OpenIGTLink AND Slicer_BUILD_OpenIGTLinkIF)
# NOTE: OpenIGTLinkIF source code is checkout from NAMICSandBox repository using
# "External_OpenIGTLinkIF.cmake".
add_subdirectory(
${OpenIGTLinkIF_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/OpenIGTLinkIF
)
endif()
if(Slicer_BUILD_MultiVolumeExplorer AND Slicer_BUILD_DICOM_SUPPORT)
# NOTE: MultiVolumeExplorer source code is checkout using "External_MultiVolumeExplorer.cmake".
add_subdirectory(
${MultiVolumeExplorer_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/MultiVolumeExplorer
)
endif()
# External modules have been moved to Modules/Remote/CMakeLists.txt
if(Slicer_BUILD_CLI_SUPPORT AND Slicer_BUILD_EMSegment)
# NOTE: EMSegment source code is checkout from Slicer3 repository using
# "External_EMSegment.cmake".
add_subdirectory(
${EMSegment_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/EMSegment
)
endif()
if(Slicer_USE_OpenIGTLink AND Slicer_BUILD_OpenIGTLinkIF)
# NOTE: OpenIGTLinkIF source code is checkout from NAMICSandBox repository using
# "External_OpenIGTLinkIF.cmake".
add_subdirectory(
${OpenIGTLinkIF_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/OpenIGTLinkIF
)
endif()
if(Slicer_BUILD_MultiVolumeExplorer AND Slicer_BUILD_DICOM_SUPPORT)
# NOTE: MultiVolumeExplorer source code is checkout using "External_MultiVolumeExplorer.cmake".
add_subdirectory(
${MultiVolumeExplorer_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/MultiVolumeExplorer
)
endif()
if(Slicer_BUILD_MultiVolumeImporter)
# NOTE: MultiVolumeImporter source code is checkout using "External_MultiVolumeImporter.cmake".
add_subdirectory(
${MultiVolumeImporter_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/MultiVolumeImporter
)
endif()
if(Slicer_BUILD_BRAINSTOOLS)
# NOTE: BRAINSTools source code is checkout using "External_BRAINSTools.cmake".
set(BRAINSTools_CLI_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${Slicer_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${Slicer_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${Slicer_CLIMODULES_BIN_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_INSTALL_LIBRARY_DESTINATION ${Slicer_INSTALL_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_INSTALL_ARCHIVE_DESTINATION ${Slicer_INSTALL_CLIMODULES_LIB_DIR} CACHE PATH "" FORCE)
set(BRAINSTools_CLI_INSTALL_RUNTIME_DESTINATION ${Slicer_INSTALL_CLIMODULES_BIN_DIR} CACHE PATH "" FORCE)
if(BUILD_TESTING)
set(LAUNCH_EXE ${SEM_LAUNCH_COMMAND})
endif()
set(USE_BRAINSFit ON CACHE BOOL "Build BRAINSFit" )
set(USE_BRAINSROIAuto ON CACHE BOOL "Build BRAINSROIAuto" )
set(USE_BRAINSResample ON CACHE BOOL "Build BRAINSResample" )
set(USE_BRAINSDemonWarp ON CACHE BOOL "Build BRAINSDemonWarp ")
if("${ITK_VERSION_MAJOR}" GREATER 3)
set(USE_BRAINSTransformConvert ON CACHE BOOL "Build BRAINSTransformConvert ")
set(USE_DWIConvert ON CACHE BOOL "Build DWIConvert ") ## Need to figure out library linking
else()
set(USE_BRAINSTransformConvert OFF CACHE BOOL "Build BRAINSTransformConvert ")
set(USE_DWIConvert OFF CACHE BOOL "Build DWIConvert ")
endif()
## BRAINSTools comes with some extra tool
## options that should not be compiled by default.
set(USE_AutoWorkup OFF CACHE BOOL "" FORCE)
set(USE_ANTS OFF CACHE BOOL "Build with ANTS capabilities" )
set(USE_GTRACT OFF CACHE BOOL "" FORCE)
set(USE_BRAINSABC OFF CACHE BOOL "" FORCE)
set(USE_BRAINSTalairach OFF CACHE BOOL "" FORCE)
set(USE_BRAINSConstellationDetector OFF CACHE BOOL "" FORCE)
set(USE_BRAINSMush OFF CACHE BOOL "" FORCE)
set(USE_BRAINSInitializedControlPoints OFF CACHE BOOL "" FORCE)
set(USE_BRAINSMultiModeSegment OFF CACHE BOOL "" FORCE)
set(USE_BRAINSCut OFF CACHE BOOL "" FORCE)
set(USE_BRAINSLandmarkInitializer OFF CACHE BOOL "" FORCE)
set(USE_ImageCalculator OFF CACHE BOOL "" FORCE)
set(USE_BRAINSSurfaceTools OFF CACHE BOOL "" FORCE)
set(USE_BRAINSSnapShotWriter OFF CACHE BOOL "" FORCE)
set(USE_ConvertBetweenFileFormats OFF CACHE BOOL "" FORCE)
set(USE_BRAINSMultiSTAPLE OFF CACHE BOOL "" FORCE)
set(USE_BRAINSCreateLabelMapFromProbabilityMaps OFF OFF CACHE BOOL "" FORCE)
set(USE_BRAINSContinuousClass OFF CACHE BOOL "" FORCE)
set(USE_ICCDEF OFF CACHE BOOL "" FORCE)
set(USE_BRAINSPosteriorToContinuousClass OFF CACHE BOOL "" FORCE)
set(USE_DebugImageViewer OFF CACHE BOOL "" FORCE)
set(BRAINS_DEBUG_IMAGE_WRITE OFF CACHE BOOL "" FORCE)
# HACK - Ensure BRAINSTools uses the same ExternalData version as Slicer.
# See https://github.com/BRAINSia/BRAINSTools/issues/3
configure_file(
${CMAKE_SOURCE_DIR}/CMake/ExternalData.cmake
${BRAINSTools_SOURCE_DIR}/CMake/ExternalData.cmake
COPYONLY
)
set(ITK_VERSION_MAJOR ${ITK_VERSION_MAJOR} CACHE STRING "")
set(BRAINSTools_SUPERBUILD OFF CACHE BOOL "" FORCE)
add_subdirectory(
${BRAINSTools_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/BRAINSTools
)
endif()
......@@ -36,10 +36,4 @@ foreach(module ${modules})
endif()
endforeach()
if(Slicer_BUILD_MultiVolumeImporter)
# NOTE: MultiVolumeImporter source code is checkout using "External_MultiVolumeImporter.cmake".
add_subdirectory(
${MultiVolumeImporter_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/MultiVolumeImporter
)
endif()
# External modules have been moved to Modules/Remote/CMakeLists.txt
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