Skip to content

Commit 79e1fa7

Browse files
committed
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 a cache entry enables it to be access by the parent project.
1 parent d98a658 commit 79e1fa7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ project(
6767
C
6868
)
6969

70-
set(ITK_CMAKE_DIR "${ITK_SOURCE_DIR}/CMake")
70+
# Required as a cache variable for FetchContent parent projects can
71+
# resolve ITK's CMake macros and config paths.
72+
set(
73+
ITK_CMAKE_DIR
74+
"${ITK_SOURCE_DIR}/CMake"
75+
CACHE INTERNAL
76+
"Directory containing CMake files for ITK configuration and module macros"
77+
FORCE
78+
)
7179

7280
if(APPLE)
7381
include(itkApple)

0 commit comments

Comments
 (0)