mirror of
https://github.com/Karllzy/cotton_color.git
synced 2025-11-08 18:53:53 +00:00
Change the OpenCV_DIR to an Environment variable.
This commit is contained in:
parent
ccd034a14e
commit
da14ed2c1d
2
.gitignore
vendored
2
.gitignore
vendored
@ -363,4 +363,4 @@ MigrationBackup/
|
||||
FodyWeavers.xsd
|
||||
|
||||
.idea
|
||||
cmake-build-release-visual-studio
|
||||
cmake-build-*
|
||||
@ -5,7 +5,12 @@ project(cotton_color)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# 设置 OpenCV 路径
|
||||
set(OpenCV_DIR "E:/opencv4.10/opencv/build")
|
||||
if(DEFINED ENV{OpenCV_DIR})
|
||||
set(OpenCV_DIR ENV{OpenCV_DIR})
|
||||
message(STATUS "OpenCV_DIR set from environment variable: ${OpenCV_DIR}")
|
||||
else()
|
||||
message(FATAL_ERROR "OpenCV_DIR is not set. Please set the OpenCV_DIR environment variable.")
|
||||
endif()
|
||||
|
||||
# 找到 OpenCV 包
|
||||
find_package(OpenCV REQUIRED)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user