From 45b6f9ae1f3de787306bad195841efb7ef88aa02 Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Sun, 2 Sep 2018 19:40:19 -0400 Subject: [PATCH] ENH: Allow the developer to pass ITK build options Using CACHE variable: Slicer_ITK_EXTRA_CMAKE_ARGS:STRING This allow to build modules that might be needed for Modules, or custom apps. Example: -DSlicer_ITK_EXTRA_CMAKE_ARGS:STRING=-DModule_XXX:BOOL=ON; --- CMakeLists.txt | 4 ++++ SuperBuild/External_ITKv4.cmake | 1 + 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0c3ec7ad91..681c6e39210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,6 +299,10 @@ CMAKE_DEPENDENT_OPTION( "Slicer_BUILD_ITKPython" OFF) mark_as_superbuild(Slicer_INSTALL_ITKPython) +set(Slicer_ITK_EXTRA_CMAKE_ARGS "" CACHE STRING "List with extra options to build ITK, i.e -DModule_XXX:BOOL=ON") +mark_as_advanced(Slicer_ITK_EXTRA_CMAKE_ARGS) +mark_as_superbuild(Slicer_ITK_EXTRA_CMAKE_ARGS) + option(Slicer_BUILD_PARAMETERSERIALIZER_SUPPORT "Build Slicer with parameter serializer support" ON) mark_as_superbuild(Slicer_BUILD_PARAMETERSERIALIZER_SUPPORT) diff --git a/SuperBuild/External_ITKv4.cmake b/SuperBuild/External_ITKv4.cmake index c5c0ce52c7c..ea2b93b6742 100644 --- a/SuperBuild/External_ITKv4.cmake +++ b/SuperBuild/External_ITKv4.cmake @@ -123,6 +123,7 @@ if(NOT DEFINED ITK_DIR AND NOT Slicer_USE_SYSTEM_${proj}) -DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR} -DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY} ${EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS} + ${Slicer_ITK_EXTRA_CMAKE_ARGS} INSTALL_COMMAND "" DEPENDS ${${proj}_DEPENDENCIES}