From 55564bd5815eac520531c600fc72d2c2e50deae0 Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Tue, 17 Mar 2026 13:01:42 +0000 Subject: [PATCH] ENH: Make ITK_CMAKE_DIR an internal cache variable When building ITK with FetchConent, ITK_CMAKE_DIR is needed in the parent project for configurations paths, and in the itk_generate_factory_registration macro. Making this variable enables it to be access by the parent project. --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aba2ec14dd4..4a0d0ca3027 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,14 @@ project( C ) -set(ITK_CMAKE_DIR "${ITK_SOURCE_DIR}/CMake") +# Made a cache variable to be used by project which use FetchContent to build ITK. +set( + ITK_CMAKE_DIR + "${ITK_SOURCE_DIR}/CMake" + CACHE INTERNAL + "Directory containing CMake files for ITK configuration and module macros" + FORCE +) if(APPLE) include(itkApple)