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
f4ebc504
Commit
f4ebc504
authored
Jun 15, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: refactor HAL attaching process
parent
e3844e0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
17 deletions
+34
-17
CMakeLists.txt
CMakeLists.txt
+31
-15
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+1
-0
custom_hal.hpp.in
cmake/templates/custom_hal.hpp.in
+1
-1
CMakeLists.txt
modules/core/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
f4ebc504
...
...
@@ -602,26 +602,42 @@ endif()
include
(
cmake/OpenCVDetectVTK.cmake
)
# -- Custom HAL replacement --
#
Package config in: OpenCV_HALConfig.cmake or opencv_hal-config.cmake
#
Use variables: OpenCV_HAL_LIBRARIES, OpenCV_HAL_HEADERS and OpenCV_HAL_INCLUDE_DIRS variables
find_package
(
OpenCV_HAL NO_MODULE QUIET
)
set
(
_includes
""
)
if
(
OpenCV_HAL_FOUND
)
#
----------------------------------------------------------------------------
#
OpenCV HAL
# ----------------------------------------------------------------------------
set
(
_
hal_
includes
""
)
macro
(
ocv_hal_register HAL_LIBRARIES_VAR HAL_HEADERS_VAR HAL_INCLUDE_DIRS_VAR
)
# 1. libraries
foreach
(
l
${
OpenCV_HAL_LIBRARIES
}
)
get_filename_component
(
l
"
${
l
}
"
ABSOLUTE
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
l
}
)
foreach
(
l
${${
HAL_LIBRARIES_VAR
}}
)
if
(
NOT TARGET
${
l
}
)
get_filename_component
(
l
"
${
l
}
"
ABSOLUTE
)
endif
()
list
(
APPEND OPENCV_HAL_LINKER_LIBS
${
l
}
)
endforeach
()
# 2. headers
foreach
(
h
${
OpenCV_HAL_HEADERS
}
)
set
(
_
includes
"
${
_includes
}
\n
#include
\"
${
h
}
\"
"
)
foreach
(
h
${
${
HAL_HEADERS_VAR
}
}
)
set
(
_
hal_includes
"
${
_hal
_includes
}
\n
#include
\"
${
h
}
\"
"
)
endforeach
()
# 3. include paths
ocv_include_directories
(
${
OpenCV_HAL_INCLUDE_DIRS
}
)
endif
()
ocv_include_directories
(
${${
HAL_INCLUDE_DIRS_VAR
}}
)
endmacro
()
if
(
NOT DEFINED OpenCV_HAL
)
set
(
OpenCV_HAL
"OpenCV_HAL"
)
endif
()
foreach
(
hal
${
OpenCV_HAL
}
)
ocv_debug_message
(
STATUS
"OpenCV HAL:
${
hal
}
..."
)
ocv_clear_vars
(
OpenCV_HAL_LIBRARIES OpenCV_HAL_HEADERS OpenCV_HAL_INCLUDE_DIRS
)
find_package
(
${
hal
}
NO_MODULE QUIET
)
if
(
${
hal
}
_FOUND
)
ocv_hal_register
(
OpenCV_HAL_LIBRARIES OpenCV_HAL_HEADERS OpenCV_HAL_INCLUDE_DIRS
)
list
(
APPEND OpenCV_USED_HAL
"
${
hal
}
(ver
${${
hal
}
_VERSION
}
)"
)
endif
()
endforeach
()
configure_file
(
"
${
OpenCV_SOURCE_DIR
}
/cmake/templates/custom_hal.hpp.in"
"
${
CMAKE_BINARY_DIR
}
/custom_hal.hpp"
@ONLY
)
unset
(
_includes
)
unset
(
_hal_includes
)
# ----------------------------------------------------------------------------
# Add CUDA libraries (needed for apps/tools, samples)
...
...
@@ -1160,7 +1176,7 @@ endif(DEFINED WITH_VA_INTEL)
status
(
" Use Eigen:"
HAVE_EIGEN THEN
"YES (ver
${
EIGEN_WORLD_VERSION
}
.
${
EIGEN_MAJOR_VERSION
}
.
${
EIGEN_MINOR_VERSION
}
)"
ELSE NO
)
status
(
" Use Cuda:"
HAVE_CUDA THEN
"YES (ver
${
CUDA_VERSION_STRING
}
)"
ELSE NO
)
status
(
" Use OpenCL:"
HAVE_OPENCL THEN YES ELSE NO
)
status
(
" Use custom HAL:"
OpenCV_
HAL_FOUND THEN
"YES (ver
${
OpenCV_HAL_VERSION
}
,
${
OpenCV_HAL_CONFIG
}
)"
ELSE
"NO"
)
status
(
" Use custom HAL:"
OpenCV_
USED_HAL THEN
"YES (
${
OpenCV_USED_HAL
}
)"
ELSE
"NO"
)
if
(
HAVE_CUDA
)
status
(
""
)
...
...
cmake/OpenCVUtils.cmake
View file @
f4ebc504
...
...
@@ -126,6 +126,7 @@ endfunction()
# clears all passed variables
macro
(
ocv_clear_vars
)
foreach
(
_var
${
ARGN
}
)
unset
(
${
_var
}
)
unset
(
${
_var
}
CACHE
)
endforeach
()
endmacro
()
...
...
cmake/templates/custom_hal.hpp.in
View file @
f4ebc504
#ifndef _CUSTOM_HAL_INCLUDED_
#define _CUSTOM_HAL_INCLUDED_
@_includes@
@_
hal_
includes@
#endif
modules/core/CMakeLists.txt
View file @
f4ebc504
set
(
the_description
"The Core Functionality"
)
ocv_add_module
(
core
PRIVATE_REQUIRED
${
ZLIB_LIBRARIES
}
"
${
OPENCL_LIBRARIES
}
"
"
${
VA_LIBRARIES
}
"
PRIVATE_REQUIRED
${
ZLIB_LIBRARIES
}
"
${
OPENCL_LIBRARIES
}
"
"
${
VA_LIBRARIES
}
"
"
${
OPENCV_HAL_LINKER_LIBS
}
"
OPTIONAL opencv_cudev
WRAP java python
)
...
...
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