Skip to content

Commit b1862e2

Browse files
committed
Add documentation for the PYTHON_MODULE_EXTENSION and only set it when crosscompiling to allow Python version upgrades.
Signed-off-by: Alexis Paques <paa1ti@bosch.com>
1 parent bd2bbde commit b1862e2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/Modules/FindPythonExtra.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# - PythonExtra_INCLUDE_DIRS: The paths to the directories where the Python
2727
# headers are installed.
2828
# - PythonExtra_LIBRARIES: The paths to the Python libraries.
29+
# - PYTHON_MODULE_EXTENSION: The full module extension, as the suffix+extension.
30+
# This is required for packages using pybind11 when crosscompiling.
2931
#
3032
# Example usage:
3133
#
@@ -219,3 +221,7 @@ find_package_handle_standard_args(PythonExtra
219221
FOUND_VAR PythonExtra_FOUND
220222
REQUIRED_VARS ${_required_vars}
221223
)
224+
225+
if(DEFINED CMAKE_SYSROOT)
226+
set(PYTHON_MODULE_EXTENSION ${PythonExtra_EXTENSION_SUFFIX}${PythonExtra_EXTENSION_EXTENSION})
227+
endif()

0 commit comments

Comments
 (0)