Skip to content

Commit 10d63b1

Browse files
committed
COMP: Fix ExternalData when ITK is built with FetchContent
Addresses two issue: - When ITK is built from FetchContent, the fetched source is outside of the main source. This is an error with external data paths, so use the ITK PROJECT source path explicitly as the External data. - Use PROJECT_BINARY_DIR for output of download data, to prevent target conflics with the main project.
1 parent 5032829 commit 10d63b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CMake/ITKExternalData.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set(ExternalData_SOURCE_ROOT "${PROJECT_SOURCE_DIR}")
12
get_filename_component(_ITKExternalData_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
23
include(${_ITKExternalData_DIR}/ExternalData.cmake)
34

@@ -28,10 +29,10 @@ list(
2829
APPEND
2930
ExternalData_OBJECT_STORES
3031
# Local data store populated by the ITK pre-commit hook
31-
"${CMAKE_SOURCE_DIR}/.ExternalData"
32+
"${PROJECT_SOURCE_DIR}/.ExternalData"
3233
)
3334

34-
set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/ExternalData)
35+
set(ExternalData_BINARY_ROOT ${PROJECT_BINARY_DIR}/ExternalData)
3536

3637
# Expands %(algo:lower)
3738
set(ExternalData_URL_ALGO_CID_lower cid)

0 commit comments

Comments
 (0)