Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
2c27e4f8
Commit
2c27e4f8
authored
5 years ago
by
Cédric Traizet
Browse files
Options
Downloads
Patches
Plain Diff
COMP: update findOpenCV.cmake for openCV 4
parent
5d475c21
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMake/FindOpenCV.cmake
+5
-10
5 additions, 10 deletions
CMake/FindOpenCV.cmake
with
5 additions
and
10 deletions
CMake/FindOpenCV.cmake
+
5
−
10
View file @
2c27e4f8
...
@@ -28,11 +28,11 @@ if(OpenCV_DIR)
...
@@ -28,11 +28,11 @@ if(OpenCV_DIR)
if
(
OPENCV_SEARCH_PATH
)
if
(
OPENCV_SEARCH_PATH
)
find_path
(
find_path
(
opencv_INCLUDE_DIR
opencv_INCLUDE_DIR
opencv
/
cv.h
opencv
2/open
cv.h
pp
PATHS
"
${
OPENCV_SEARCH_PATH
}
"
PATHS
"
${
OPENCV_SEARCH_PATH
}
"
#no additional paths are added to the search if OpenCV_DIR
#no additional paths are added to the search if OpenCV_DIR
NO_DEFAULT_PATH
NO_DEFAULT_PATH
PATH_SUFFIXES
"include"
PATH_SUFFIXES
"include"
"include/opencv4"
DOC
"The directory where opencv/cv.h is installed"
)
DOC
"The directory where opencv/cv.h is installed"
)
endif
()
endif
()
endif
()
endif
()
...
@@ -40,17 +40,12 @@ endif()
...
@@ -40,17 +40,12 @@ endif()
if
(
NOT opencv_INCLUDE_DIR
)
if
(
NOT opencv_INCLUDE_DIR
)
find_path
(
find_path
(
opencv_INCLUDE_DIR
opencv_INCLUDE_DIR
opencv
/
cv.h
opencv
2/open
cv.h
pp
PATHS
"
${
OpenCV_DIR
}
"
PATHS
"
${
OpenCV_DIR
}
"
PATH_SUFFIXES
"include"
PATH_SUFFIXES
"include"
"include/opencv4"
DOC
"The directory where opencv/cv.h is installed"
)
DOC
"The directory where opencv/cv.h is installed"
)
endif
()
endif
()
if
(
NOT EXISTS
${
opencv_INCLUDE_DIR
}
/opencv2/opencv.hpp
)
message
(
FATAL_ERROR
"
${
opencv_INCLUDE_DIR
}
/opencv2/opencv.hpp does not exists. "
"Make sure you have opencv 2.3 or higher. We had searched in
${
OPENCV_SEARCH_PATHS
}
"
)
endif
()
set
(
opencv_core_NAMES opencv_core
)
set
(
opencv_core_NAMES opencv_core
)
set
(
opencv_ml_NAMES opencv_ml
)
set
(
opencv_ml_NAMES opencv_ml
)
...
@@ -61,7 +56,7 @@ if (opencv_INCLUDE_DIR)
...
@@ -61,7 +56,7 @@ if (opencv_INCLUDE_DIR)
if
(
NOT OpenCV_VERSION
)
if
(
NOT OpenCV_VERSION
)
file
(
READ
"
${
opencv_INCLUDE_DIR
}
/opencv2/core/version.hpp"
_header_content
)
file
(
READ
"
${
opencv_INCLUDE_DIR
}
/opencv2/core/version.hpp"
_header_content
)
# detect the type of version file (2.3.x , 2.4.x or
3
.x)
# detect the type of version file (2.3.x , 2.4.x
, 3.x
or
4
.x)
string
(
REGEX MATCH
".*# *define +CV_VERSION_EPOCH +([0-9]+).*"
has_epoch
${
_header_content
}
)
string
(
REGEX MATCH
".*# *define +CV_VERSION_EPOCH +([0-9]+).*"
has_epoch
${
_header_content
}
)
string
(
REGEX MATCH
".*# *define +CV_MAJOR_VERSION +([0-9]+).*"
has_old_major
${
_header_content
}
)
string
(
REGEX MATCH
".*# *define +CV_MAJOR_VERSION +([0-9]+).*"
has_old_major
${
_header_content
}
)
string
(
REGEX MATCH
".*# *define +CV_MINOR_VERSION +([0-9]+).*"
has_old_minor
${
_header_content
}
)
string
(
REGEX MATCH
".*# *define +CV_MINOR_VERSION +([0-9]+).*"
has_old_minor
${
_header_content
}
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment