Skip to content

Commit 8c4e211

Browse files
committed
COMP: Update Python header and include path
Set include directories for Python wrapping from Python3::Module target. Changed Python header inclusion to use angle brackets for consistency. Added include directory properties for `itkPyCommand.cxx` to improve Python wrapping configuration.
1 parent 4a3d500 commit 8c4e211

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Modules/Core/Common/include/itkPyCommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// The python header defines _POSIX_C_SOURCE without a preceding #undef
2525
#undef _POSIX_C_SOURCE
2626
#undef _XOPEN_SOURCE
27-
#include "Python.h"
27+
#include <Python.h>
2828

2929
namespace itk
3030
{

Modules/Core/Common/src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ set(
160160

161161
if(ITK_WRAP_PYTHON)
162162
list(APPEND ITKCommon_SRCS itkPyCommand.cxx)
163+
set_source_files_properties(
164+
itkPyCommand.cxx
165+
PROPERTIES
166+
INCLUDE_DIRECTORIES
167+
"$<TARGET_PROPERTY:Python3::Module,INTERFACE_INCLUDE_DIRECTORIES>"
168+
)
163169
endif()
164170

165171
if(WIN32)

0 commit comments

Comments
 (0)