File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,24 @@ if(NOT PythonLibsNew_FIND_VERSION)
95
95
set (PythonLibsNew_FIND_VERSION "3.6" )
96
96
endif ()
97
97
98
+ # Save variables that get set by PythonInterp
99
+ macro (_PYBIND11_PUSH_IF_DEFINED name )
100
+ if (DEFINED "${name} " )
101
+ set ("_PYBIND11_ORIG_${name} " "${${name} }" )
102
+ endif ()
103
+ endmacro ()
104
+
105
+ _pybind11_push_if_defined(PYTHON_INCLUDE_DIR)
106
+ _pybind11_push_if_defined(PYTHON_MODULE_EXTENSION)
107
+ _pybind11_push_if_defined(PYTHON_IS_DEBUG)
108
+
98
109
find_package (PythonInterp ${PythonLibsNew_FIND_VERSION} ${_pythonlibs_required}
99
110
${_pythonlibs_quiet} )
100
111
112
+ unset (PYTHON_INCLUDE_DIR)
113
+ unset (PYTHON_MODULE_EXTENSION)
114
+ unset (PYTHON_IS_DEBUG)
115
+
101
116
if (NOT PYTHONINTERP_FOUND)
102
117
set (PYTHONLIBS_FOUND FALSE )
103
118
set (PythonLibsNew_FOUND FALSE )
@@ -153,7 +168,9 @@ endif()
153
168
154
169
# Can manually set values when cross-compiling
155
170
macro (_PYBIND11_GET_IF_UNDEF lst index name )
156
- if (NOT DEFINED "${name} " )
171
+ if (DEFINED "_PYBIND11_ORIG_${name} " )
172
+ set ("${name} " "${_PYBIND11_ORIG_${name} }" )
173
+ elseif (NOT DEFINED "${name} " )
157
174
list (GET "${lst} " "${index} " "${name} " )
158
175
endif ()
159
176
endmacro ()
You can’t perform that action at this time.
0 commit comments