From c2082b3131a6072c18c12b1ec5d205b36c04ccd3 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath <rashad.kanavath@c-s.fr> Date: Tue, 22 Aug 2017 14:37:34 +0200 Subject: [PATCH] SuperBuild: itk: build testlib only with testing --- .../patches/ITK/itk-2-itktestlib-all.diff | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 SuperBuild/patches/ITK/itk-2-itktestlib-all.diff diff --git a/SuperBuild/patches/ITK/itk-2-itktestlib-all.diff b/SuperBuild/patches/ITK/itk-2-itktestlib-all.diff new file mode 100644 index 0000000000..dc0b0cbdbb --- /dev/null +++ b/SuperBuild/patches/ITK/itk-2-itktestlib-all.diff @@ -0,0 +1,35 @@ +diff -burN InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/CMakeLists.txt InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/CMakeLists.txt +--- InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/CMakeLists.txt 2017-08-22 11:53:55.960938649 +0200 ++++ InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/CMakeLists.txt 2017-08-22 11:56:07.289820954 +0200 +@@ -18,10 +18,14 @@ + # Retrive the variable type to CACHE. + set(BUILD_EXAMPLES ${BUILD_EXAMPLES} CACHE BOOL "Build the examples from the ITK Software Guide." FORCE) + +-foreach(lib itkvcl itkv3p_netlib itktestlib itkvnl itkvnl_algo itknetlib) ++foreach(lib itkvcl itkv3p_netlib itkvnl itkvnl_algo itknetlib) + itk_module_target(${lib} NO_INSTALL) + endforeach() + ++if(BUILD_TESTING) ++ itk_module_target(itktestlib NO_INSTALL) ++endif() ++ + foreach(exe + netlib_integral_test + netlib_lbfgs_example +diff -burN InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt +--- InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt 2017-08-22 11:53:55.960938649 +0200 ++++ InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt 2017-08-22 11:56:56.410150930 +0200 +@@ -131,8 +131,10 @@ + set(CORE_VIDEO_FOUND OFF CACHE INTERNAL "VXL core video libraries built") + endif () + +-# common test executable +-add_subdirectory(testlib) ++# common test executable if testing enabled ++if(BUILD_TESTING) ++ add_subdirectory(testlib) ++endif() + + # Tests that check and output the vxl configuration + # NOTE: some external projects remove the tests directory (aka ITK) -- GitLab