File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -65,21 +65,21 @@ if (Amp1394_BUILD_SWIG)
65
65
find_package (SWIG REQUIRED )
66
66
include (${SWIG_USE_FILE} )
67
67
68
- find_package ( PythonLibs )
69
- include_directories ( ${PYTHON_INCLUDE_PATH} )
70
-
71
- find_package ( PythonInterp )
72
- if ( PYTHON_EXECUTABLE )
73
- execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print(numpy.get_include())"
74
- ERROR_QUIET
75
- OUTPUT_VARIABLE Amp1394_NUMPY_INCLUDE_DIR
76
- OUTPUT_STRIP_TRAILING_WHITESPACE )
77
- include_directories (${Amp1394_NUMPY_INCLUDE_DIR} " ${Amp1394_BINARY_DIR} /Amp1394" )
78
- endif ( )
68
+ # Find Python and NumPy
69
+ set ( AMP1394_PYTHON_VERSION_REQUIRED "" CACHE STRING "Required Python version (if not empty)" )
70
+ if ( AMP1394_PYTHON_VERSION_REQUIRED )
71
+ message ( STATUS "Looking for Python ${AMP1394_PYTHON_VERSION_REQUIRED} " )
72
+ find_package ( Python ${AMP1394_PYTHON_VERSION_REQUIRED} EXACT REQUIRED COMPONENTS Development NumPy )
73
+ else ()
74
+ find_package ( Python REQUIRED COMPONENTS Interpreter Development NumPy )
75
+ endif ()
76
+
77
+ include_directories (${Python_INCLUDE_DIRS} ${Python_NumPy_INCLUDE_DIRS} )
78
+ include_directories ( " ${Amp1394_BINARY_DIR} /Amp1394" )
79
79
80
80
set_source_files_properties (Amp1394.i PROPERTIES CPLUSPLUS ON )
81
81
swig_add_module (Amp1394Python python Amp1394.i ${HEADERS} ${SOURCE_FILES} )
82
- swig_link_libraries (Amp1394Python ${PYTHON_LIBRARIES } ${Amp1394_EXTRA_LIBRARIES} )
82
+ swig_link_libraries (Amp1394Python ${Python_LIBRARIES } ${Amp1394_EXTRA_LIBRARIES} )
83
83
84
84
if (WIN32 )
85
85
set_target_properties (_Amp1394Python PROPERTIES SUFFIX .pyd )
You can’t perform that action at this time.
0 commit comments