Skip to content

Commit 9e5d8db

Browse files
authored
Update setup.py
1 parent f12b6d9 commit 9e5d8db

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

setup.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,18 @@ def main():
160160
# Raw paths relative to sourcetree root.
161161
files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]}
162162

163-
ci_cmake_generator = (
164-
["-G", "Visual Studio 14" + (" Win64" if is64 else "")]
165-
if os.name == "nt"
166-
else ["-G", "Unix Makefiles"]
167-
)
168-
163+
if os.name == "nt":
164+
vs_env = os.environ.get("VISUAL_STUDIO")
165+
if vs_env == "17":
166+
generator_name = "Visual Studio 17 2022"
167+
arch = "x64" if is64 else "Win32"
168+
ci_cmake_generator = ["-G", generator_name, "-A", arch]
169+
else:
170+
generator_name = "Visual Studio 14" + (" Win64" if is64 else "")
171+
ci_cmake_generator = ["-G", generator_name]
172+
else:
173+
ci_cmake_generator = ["-G", "Unix Makefiles"]
174+
169175
cmake_args = (
170176
(ci_cmake_generator if is_CI_build else [])
171177
+ [
@@ -193,8 +199,8 @@ def main():
193199
"-DBUILD_DOCS=OFF",
194200
"-DPYTHON3_LIMITED_API=ON",
195201
"-DBUILD_OPENEXR=ON",
196-
"-DLAPACK=ON",
197-
202+
"-DWITH_OBSENSOR=OFF",
203+
"-DWITH_MEDIAFOUNDATION=OFF",
198204
]
199205
+ (
200206
# CMake flags for windows/arm64 build

0 commit comments

Comments
 (0)