Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c474e27c
Commit
c474e27c
authored
Jul 09, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
One more fix for zlib search #1902
parent
6d3db499
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
25 deletions
+27
-25
CMakeLists.txt
3rdparty/zlib/CMakeLists.txt
+0
-3
OpenCVDetectCUDA.cmake
cmake/OpenCVDetectCUDA.cmake
+1
-1
OpenCVFindLibsGrfmt.cmake
cmake/OpenCVFindLibsGrfmt.cmake
+8
-7
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+18
-14
No files found.
3rdparty/zlib/CMakeLists.txt
View file @
c474e27c
...
...
@@ -97,6 +97,3 @@ endif()
if
(
NOT BUILD_SHARED_LIBS
)
install
(
TARGETS
${
ZLIB_LIBRARY
}
ARCHIVE DESTINATION
${
OPENCV_3P_LIB_INSTALL_PATH
}
COMPONENT main
)
endif
()
ocv_parse_header2
(
ZLIB
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/zlib.h"
ZLIB_VERSION PARENT_SCOPE
)
cmake/OpenCVDetectCUDA.cmake
View file @
c474e27c
if
(
${
CMAKE_VERSION
}
VERSION_LESS
"2.8.3"
)
message
(
STATUS
WITH_CUDA flag requires CMake 2.8.3. CUDA support is disabled.
)
message
(
STATUS
"WITH_CUDA flag requires CMake 2.8.3 or newer. CUDA support is disabled."
)
return
()
endif
()
...
...
cmake/OpenCVFindLibsGrfmt.cmake
View file @
c474e27c
...
...
@@ -7,13 +7,6 @@ if(BUILD_ZLIB)
ocv_clear_vars
(
ZLIB_FOUND
)
else
()
include
(
FindZLIB
)
if
(
ZLIB_VERSION_STRING
)
#cmake 2.8.2 bug - it fails to determine zlib version
unset
(
ZLIB_VERSION_STRING CACHE
)
endif
()
if
(
ZLIB_FOUND
)
ocv_parse_header2
(
ZLIB
"
${
ZLIB_INCLUDE_DIR
}
/zlib.h"
ZLIB_VERSION
""
)
endif
()
if
(
ZLIB_FOUND AND ANDROID
)
if
(
ZLIB_LIBRARY STREQUAL
"
${
ANDROID_SYSROOT
}
/usr/lib/libz.so"
)
set
(
ZLIB_LIBRARY z
)
...
...
@@ -29,6 +22,8 @@ if(NOT ZLIB_FOUND)
set
(
ZLIB_LIBRARIES
${
ZLIB_LIBRARY
}
)
add_subdirectory
(
"
${
OpenCV_SOURCE_DIR
}
/3rdparty/zlib"
)
set
(
ZLIB_INCLUDE_DIR
"
${${
ZLIB_LIBRARY
}
_SOURCE_DIR
}
"
"
${${
ZLIB_LIBRARY
}
_BINARY_DIR
}
"
)
ocv_parse_header2
(
ZLIB
"
${${
ZLIB_LIBRARY
}
_SOURCE_DIR
}
/zlib.h"
ZLIB_VERSION
)
endif
()
# --- libtiff (optional, should be searched after zlib) ---
...
...
@@ -149,3 +144,8 @@ set(PNG_VERSION "${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VE
if
(
WITH_OPENEXR
)
include
(
"
${
OpenCV_SOURCE_DIR
}
/cmake/OpenCVFindOpenEXR.cmake"
)
endif
()
#cmake 2.8.2 bug - it fails to determine zlib version
if
(
ZLIB_FOUND
)
ocv_parse_header2
(
ZLIB
"
${
ZLIB_INCLUDE_DIR
}
/zlib.h"
ZLIB_VERSION
)
endif
()
\ No newline at end of file
cmake/OpenCVUtils.cmake
View file @
c474e27c
...
...
@@ -468,32 +468,36 @@ macro(ocv_parse_header FILENAME FILE_VAR)
endmacro
()
# read single version define from the header file
macro
(
ocv_parse_header2 LIBNAME HDR_PATH VARNAME SCOPE
)
macro
(
ocv_parse_header2 LIBNAME HDR_PATH VARNAME
)
ocv_clear_vars
(
${
LIBNAME
}
_VERSION_MAJOR
${
LIBNAME
}
_VERSION_MAJOR
${
LIBNAME
}
_VERSION_MINOR
${
LIBNAME
}
_VERSION_PATCH
${
LIBNAME
}
_VERSION_TWEAK
${
LIBNAME
}
_VERSION_STRING
)
set
(
${
LIBNAME
}
_H
""
)
if
(
EXISTS
"
${
HDR_PATH
}
"
)
file
(
STRINGS
"
${
HDR_PATH
}
"
${
LIBNAME
}
_H REGEX
"^#define[
\t
]+
${
VARNAME
}
[
\t
]+
\"
[^
\"
]*
\"
.*$"
LIMIT_COUNT 1
)
endif
()
if
(
${
LIBNAME
}
_H
)
string
(
REGEX REPLACE
"^.*[
\t
]
${
VARNAME
}
[
\t
]+
\"
([0-9]+).*$"
"
\\
1"
${
LIBNAME
}
_VERSION_MAJOR
"
${${
LIBNAME
}
_H
}
"
)
string
(
REGEX REPLACE
"^.*[
\t
]
${
VARNAME
}
[
\t
]+
\"
[0-9]+
\\
.([0-9]+).*$"
"
\\
1"
${
LIBNAME
}
_VERSION_MINOR
"
${${
LIBNAME
}
_H
}
"
)
string
(
REGEX REPLACE
"^.*[
\t
]
${
VARNAME
}
[
\t
]+
\"
[0-9]+
\\
.[0-9]+
\\
.([0-9]+).*$"
"
\\
1"
${
LIBNAME
}
_VERSION_PATCH
"
${${
LIBNAME
}
_H
}
"
)
set
(
${
LIBNAME
}
_VERSION_MAJOR
${${
LIBNAME
}
_VERSION_MAJOR
}
${
SCOPE
}
)
set
(
${
LIBNAME
}
_VERSION_MINOR
${${
LIBNAME
}
_VERSION_MINOR
}
${
SCOPE
}
)
set
(
${
LIBNAME
}
_VERSION_PATCH
${${
LIBNAME
}
_VERSION_PATCH
}
${
SCOPE
}
)
set
(
${
LIBNAME
}
_VERSION_STRING
"
${${
LIBNAME
}
_VERSION_MAJOR
}
.
${${
LIBNAME
}
_VERSION_MINOR
}
.
${${
LIBNAME
}
_VERSION_PATCH
}
"
${
SCOPE
}
)
set
(
${
LIBNAME
}
_VERSION_MAJOR
${${
LIBNAME
}
_VERSION_MAJOR
}
${
ARGN
}
)
set
(
${
LIBNAME
}
_VERSION_MINOR
${${
LIBNAME
}
_VERSION_MINOR
}
${
ARGN
}
)
set
(
${
LIBNAME
}
_VERSION_PATCH
${${
LIBNAME
}
_VERSION_PATCH
}
${
ARGN
}
)
set
(
${
LIBNAME
}
_VERSION_STRING
"
${${
LIBNAME
}
_VERSION_MAJOR
}
.
${${
LIBNAME
}
_VERSION_MINOR
}
.
${${
LIBNAME
}
_VERSION_PATCH
}
"
)
# append a TWEAK version if it exists:
set
(
${
LIBNAME
}
_VERSION_TWEAK
""
)
if
(
"
${${
LIBNAME
}
_H
}
"
MATCHES
"^.*[
\t
]
${
VARNAME
}
[
\t
]+
\"
[0-9]+
\\
.[0-9]+
\\
.[0-9]+
\\
.([0-9]+).*$"
)
set
(
${
LIBNAME
}
_VERSION_TWEAK
"
${
CMAKE_MATCH_1
}
"
${
SCOPE
}
)
set
(
${
LIBNAME
}
_VERSION_STRING
"
${${
LIBNAME
}
_VERSION_STRING
}
.
${${
LIBNAME
}
_VERSION_TWEAK
}
"
${
SCOPE
}
)
set
(
${
LIBNAME
}
_VERSION_TWEAK
"
${
CMAKE_MATCH_1
}
"
${
ARGN
}
)
endif
()
if
(
${
LIBNAME
}
_VERSION_TWEAK
)
set
(
${
LIBNAME
}
_VERSION_STRING
"
${${
LIBNAME
}
_VERSION_STRING
}
.
${${
LIBNAME
}
_VERSION_TWEAK
}
"
${
ARGN
}
)
else
()
set
(
${
LIBNAME
}
_VERSION_STRING
"
${${
LIBNAME
}
_VERSION_STRING
}
"
${
ARGN
}
)
endif
()
else
()
ocv_clear_vars
(
${
LIBNAME
}
_VERSION_MAJOR
${
LIBNAME
}
_VERSION_MAJOR
${
LIBNAME
}
_VERSION_MINOR
${
LIBNAME
}
_VERSION_PATCH
${
LIBNAME
}
_VERSION_TWEAK
${
LIBNAME
}
_VERSION_STRING
)
endif
()
endmacro
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment