
* added package gptune with all its dependencies: adding py-autotune, pygmo, py-pyaml, py-autotune, py-gpy, py-lhsmdu, py-hpbandster, pagmo2, py-opentuner; modifying superlu-dist, py-scikit-optimize * adding gptune package * minor fix for macos spack test * update patch for py-scikit-optimize; update test files for gptune * fixing gptune package style error * fixing unit tests * a few changes reviewed in the PR * improved gptune package.py with a few newly added/improved dependencies * fixed a few style errors * minor fix on package name py-pyro4 * fixing more style errors * Update var/spack/repos/builtin/packages/py-scikit-optimize/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * resolved a few issues in the PR * fixing file permissions * a few minor changes * style correction * minor correction to jq package file * Update var/spack/repos/builtin/packages/py-pyro4/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * fixing a few issues in the PR * adding py-selectors34 required by py-pyro4 * improved the superlu-dist package * improved the superlu-dist package * moree changes to gptune and py-selectors34 based on the PR * Update var/spack/repos/builtin/packages/py-selectors34/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
85 lines
2.9 KiB
Diff
85 lines
2.9 KiB
Diff
commit dd7f88bd68f95e56437035cc95d4af482482fcc2
|
|
Author: Alexander Alekhin <alexander.alekhin@intel.com>
|
|
Date: Thu Jun 7 12:32:48 2018 +0300
|
|
|
|
python: support standalone Python bindings build
|
|
|
|
- requires OpenCV source directory
|
|
- requires OpenCV binary directory with built modules and 'python_bindings_generator' target
|
|
|
|
diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake
|
|
index 6dec76ff66..b6c7a2535c 100644
|
|
--- a/cmake/OpenCVDetectPython.cmake
|
|
+++ b/cmake/OpenCVDetectPython.cmake
|
|
@@ -27,6 +27,12 @@ function(find_python preferred_version min_version library_env include_dir_env
|
|
debug_library include_path include_dir include_dir2 packages_path
|
|
numpy_include_dirs numpy_version)
|
|
if(NOT ${found})
|
|
+ if(" ${executable}" STREQUAL " PYTHON_EXECUTABLE")
|
|
+ set(__update_python_vars 0)
|
|
+ else()
|
|
+ set(__update_python_vars 1)
|
|
+ endif()
|
|
+
|
|
ocv_check_environment_variables(${executable})
|
|
if(${executable})
|
|
set(PYTHON_EXECUTABLE "${${executable}}")
|
|
@@ -47,7 +53,7 @@ if(NOT ${found})
|
|
endforeach()
|
|
endif()
|
|
|
|
- string(REGEX MATCH "^[0-9]+" _preferred_version_major ${preferred_version})
|
|
+ string(REGEX MATCH "^[0-9]+" _preferred_version_major "${preferred_version}")
|
|
|
|
find_host_package(PythonInterp "${preferred_version}")
|
|
if(NOT PYTHONINTERP_FOUND)
|
|
@@ -56,7 +62,7 @@ if(NOT ${found})
|
|
|
|
if(PYTHONINTERP_FOUND)
|
|
# Check if python major version is correct
|
|
- if(${_preferred_version_major} EQUAL ${PYTHON_VERSION_MAJOR})
|
|
+ if("${_preferred_version_major}" STREQUAL "" OR "${_preferred_version_major}" STREQUAL "${PYTHON_VERSION_MAJOR}")
|
|
# Copy outputs
|
|
set(_found ${PYTHONINTERP_FOUND})
|
|
set(_executable ${PYTHON_EXECUTABLE})
|
|
@@ -65,7 +71,9 @@ if(NOT ${found})
|
|
set(_version_minor ${PYTHON_VERSION_MINOR})
|
|
set(_version_patch ${PYTHON_VERSION_PATCH})
|
|
endif()
|
|
+ endif()
|
|
|
|
+ if(__update_python_vars)
|
|
# Clear find_host_package side effects
|
|
unset(PYTHONINTERP_FOUND)
|
|
unset(PYTHON_EXECUTABLE CACHE)
|
|
@@ -109,7 +117,8 @@ if(NOT ${found})
|
|
set(_library_release ${PYTHON_LIBRARY_RELEASE})
|
|
set(_include_dir ${PYTHON_INCLUDE_DIR})
|
|
set(_include_dir2 ${PYTHON_INCLUDE_DIR2})
|
|
-
|
|
+ endif()
|
|
+ if(__update_python_vars)
|
|
# Clear find_package side effects
|
|
unset(PYTHONLIBS_FOUND)
|
|
unset(PYTHON_LIBRARIES)
|
|
@@ -160,7 +169,7 @@ if(NOT ${found})
|
|
unset(_path)
|
|
endif()
|
|
|
|
- set(_numpy_include_dirs ${${numpy_include_dirs}})
|
|
+ set(_numpy_include_dirs "${${numpy_include_dirs}}")
|
|
|
|
if(NOT _numpy_include_dirs)
|
|
if(CMAKE_CROSSCOMPILING)
|
|
@@ -222,6 +231,10 @@ if(NOT ${found})
|
|
endif()
|
|
endfunction(find_python)
|
|
|
|
+if(OPENCV_PYTHON_SKIP_DETECTION)
|
|
+ return()
|
|
+endif()
|
|
+
|
|
find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
|
|
PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
|
|
PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
|