From 2c2cdcf789deecc01d0a824a71b1d88f4e4d59df Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 4 Sep 2014 16:28:11 +0400 Subject: [PATCH] Changed cmake python library search startegy for crosscompiling --- cmake/OpenCVDetectPython.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake index 91e62e38c6..a4142daa8a 100644 --- a/cmake/OpenCVDetectPython.cmake +++ b/cmake/OpenCVDetectPython.cmake @@ -83,7 +83,12 @@ function(find_python preferred_version min_version library_env include_dir_env endif() # not using _version_string here, because it might not conform to the CMake version format - find_host_package(PythonLibs "${_version_major_minor}.${_version_patch}" EXACT) + if(CMAKE_CROSSCOMPILING) + # builder version can differ from target, matching base version (e.g. 2.7) + find_host_package(PythonLibs "${_version_major_minor}") + else() + find_host_package(PythonLibs "${_version_major_minor}.${_version_patch}" EXACT) + endif() if(PYTHONLIBS_FOUND) # Copy outputs