Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Modules/Bridge/NumPy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.16.3)
project(ITKBridgeNumPy)

set(ITKBridgeNumPy_SYSTEM_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}")
# Don't set SYSTEM_INCLUDE_DIRS for Python - handle includes separately
# to avoid CMake errors about source-prefixed paths in INTERFACE properties
set(ITKBridgeNumPy_SYSTEM_INCLUDE_DIRS "")

if(NOT ITK_SOURCE_DIR)
find_package(ITK REQUIRED)
Expand All @@ -10,3 +12,13 @@ if(NOT ITK_SOURCE_DIR)
else()
itk_module_impl()
endif()

# Add Python includes using BUILD_INTERFACE generator expression
# This ensures they're only used during build, not in exports
if(Python3_INCLUDE_DIRS AND TARGET ITKBridgeNumPyModule)
target_include_directories(ITKBridgeNumPyModule
SYSTEM
INTERFACE
$<BUILD_INTERFACE:${Python3_INCLUDE_DIRS}>
)
endif()