diff options
| author | Jake Forster <jakecameron.forster@gmail.com> | 2025-06-24 22:14:18 +0930 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-06-30 14:30:40 +0200 |
| commit | d6b106b5b4c9af15a0a38561fceb1a1d4d60fea0 (patch) | |
| tree | df9155ac30007e4b28032c502257307a3d15190c /gnu/packages/image-processing.scm | |
| parent | a13acf79853915fc58942e29367e616c146e5bcc (diff) | |
gnu: insight-toolkit: Exclude gtest target.
Fixes: guix/guix#776
This new phase makes it possible to configure projects that use
insight-toolkit. I think this is what the configure flag '-DGTEST_ROOT=gtest'
was intended to do, but it does not. In addition, the configure flag
'-DITK_USE_SYSTEM_GOOGLETEST=ON' and native input googletest are no longer
required to placate the configure phase.
* gnu/packages/image-processing (insight-toolkit) [arguments]
<#:configure-flags>: Remove -DITK_USE_SYSTEM_GOOGLETEST=ON and
-DGTEST_ROOT=gtest.
<#:phases>: Add phase 'exclude-gtest-target.
[native-inputs]: Remove googletest.
Change-Id: I9c2e051ac9cfc3439ea53e1a4f3207fbb2f3337b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/image-processing.scm')
| -rw-r--r-- | gnu/packages/image-processing.scm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 7b4ff93c459..2fbf590fc16 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -1254,7 +1254,6 @@ libraries designed for computer vision research and implementation.") #:configure-flags #~(list "-DITK_USE_GPU=ON" "-DITK_USE_SYSTEM_LIBRARIES=ON" - "-DITK_USE_SYSTEM_GOOGLETEST=ON" "-DITK_USE_SYSTEM_CASTXML=ON" "-DITK_BUILD_SHARED=ON" "-DITK_WRAPPING=ON" @@ -1268,10 +1267,6 @@ libraries designed for computer vision research and implementation.") "/lib/python" python-version "/site-packages"))) (string-append "-DPY_SITE_PACKAGES_PATH=" python-lib-path)) - ;; This prevents "GTest::GTest" from being added to the ITK_LIBRARIES - ;; variable in the installed CMake files. This is necessary as other - ;; packages using insight-toolkit could not be configured otherwise. - "-DGTEST_ROOT=gtest" "-DCMAKE_CXX_STANDARD=17") #:phases #~(modify-phases %standard-phases @@ -1283,7 +1278,20 @@ libraries designed for computer vision research and implementation.") (add-after 'unpack 'ignore-warnings (lambda _ (substitute* "Wrapping/Generators/Python/CMakeLists.txt" - (("-Werror") ""))))))) + (("-Werror") "")))) + (add-after 'unpack 'exclude-gtest-target + (lambda _ + ;; Prevent ITKGoogleTest from being added to + ;; ITK_MODULES_ENABLED in the installed + ;; ITKConfig.cmake, which in turn prevents + ;; 'GTest::GTest' from being added to the + ;; ITK_LIBRARIES variable. This is necessary + ;; because projects that use ITK fail to configure + ;; otherwise. Fixes + ;; <https://codeberg.org/guix/guix/issues/776>. + ;; <https://github.com/microsoft/vcpkg/pull/27187> + (substitute* "Modules/ThirdParty/GoogleTest/itk-module.cmake" + (("DEPENDS") "DEPENDS\n EXCLUDE_FROM_DEFAULT"))))))) (inputs (list eigen expat @@ -1300,7 +1308,7 @@ libraries designed for computer vision research and implementation.") vxl-1 zlib)) (native-inputs - (list castxml googletest pkg-config swig which)) + (list castxml pkg-config swig which)) ;; The 'CMake/ITKSetStandardCompilerFlags.cmake' file normally sets ;; '-mtune=native -march=corei7', suggesting there's something to be |
