Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import subprocess
import re
import sysconfig
from sysconfig import get_paths as gp


def main():
Expand Down Expand Up @@ -103,7 +104,7 @@ def main():
]) + [
# skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3
"-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys.executable,
"-DPYTHON3_EXECUTABLE=%s" % sys.executable,
"-DPYTHON3_INCLUDE_DIR=%s" % gp()['include'],
"-DBUILD_opencv_python3=ON",
"-DBUILD_opencv_python2=OFF",

Expand All @@ -122,7 +123,9 @@ def main():
"-DBUILD_TESTS=OFF",
"-DBUILD_PERF_TESTS=OFF",
"-DBUILD_DOCS=OFF"
] + (["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib else [])
] + \
(["-DPYTHON3_LIBRARY=%s" % os.path.join(*[sysconfig.get_config_var('BINDIR'), "libs","python{}.lib".format("".join(str(v) for v in sys.version_info[:2]))])] if sys.platform.startswith('win') else ["-DPYTHON3_LIBRARY=%s" % os.path.join('/usr/lib/x86_64-linux-gnu/', sysconfig.get_config_var('LDLIBRARY'))]) + \
(["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib else [])

# OS-specific components
if sys.platform.startswith('linux') and not build_headless:
Expand Down