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
c35ddcba
Commit
c35ddcba
authored
Jan 15, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: refactor OpenCL detection, allow custom configurations
parent
243c513e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
29 deletions
+19
-29
CMakeLists.txt
CMakeLists.txt
+5
-6
OpenCVDetectOpenCL.cmake
cmake/OpenCVDetectOpenCL.cmake
+13
-21
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+0
-1
CMakeLists.txt
modules/core/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
c35ddcba
...
...
@@ -1138,14 +1138,13 @@ endif()
if
(
HAVE_OPENCL
)
status
(
""
)
status
(
" OpenCL:"
)
if
(
HAVE_OPENCL_STATIC
)
set
(
__opencl_
ver
"static
"
)
set
(
__opencl_
type
"<Link with OpenCL library>
"
)
else
()
set
(
__opencl_
ver
"dynamic
"
)
set
(
__opencl_
type
"<Dynamic loading of OpenCL library>
"
)
endif
()
status
(
"
Version:"
${
__opencl_ver
}
)
if
(
OPENCL_INCLUDE_DIR
)
status
(
"
OpenCL:"
${
__opencl_type
}
)
if
(
OPENCL_INCLUDE_DIR
S
)
status
(
" Include path:"
${
OPENCL_INCLUDE_DIRS
}
)
endif
()
if
(
OPENCL_LIBRARIES
)
...
...
@@ -1162,7 +1161,7 @@ if(HAVE_OPENCL)
list
(
APPEND __libs
"
${
l
}
"
)
endif
()
endforeach
()
status
(
" libraries:"
${
__libs
}
)
status
(
"
Link
libraries:"
${
__libs
}
)
endif
()
status
(
" Use AMDFFT:"
HAVE_CLAMDFFT THEN YES ELSE NO
)
status
(
" Use AMDBLAS:"
HAVE_CLAMDBLAS THEN YES ELSE NO
)
...
...
cmake/OpenCVDetectOpenCL.cmake
View file @
c35ddcba
set
(
OPENCL_FOUND ON CACHE BOOL
"OpenCL library is found"
)
if
(
APPLE
)
set
(
OPENCL_FOUND YES
)
set
(
OPENCL_LIBRARY
"-framework OpenCL"
CACHE STRING
"OpenCL library"
)
set
(
OPENCL_INCLUDE_DIR
""
CACHE STRING
"OpenCL include directory"
)
mark_as_advanced
(
OPENCL_INCLUDE_DIR OPENCL_LIBRARY
)
set
(
HAVE_OPENCL_STATIC ON
)
set
(
OPENCL_INCLUDE_DIR
""
CACHE PATH
"OpenCL include directory"
)
else
(
APPLE
)
set
(
OPENCL_FOUND YES
)
set
(
HAVE_OPENCL_STATIC OFF
)
set
(
OPENCL_INCLUDE_DIR
"
${
OpenCV_SOURCE_DIR
}
/3rdparty/include/opencl/1.2"
)
set
(
OPENCL_LIBRARY
""
CACHE STRING
"OpenCL library"
)
set
(
OPENCL_INCLUDE_DIR
"
${
OpenCV_SOURCE_DIR
}
/3rdparty/include/opencl/1.2"
CACHE PATH
"OpenCL include directory"
)
endif
(
APPLE
)
if
(
WINRT
)
set
(
OPENCL_FOUND NO
)
set
(
HAVE_OPENCL_STATIC OFF
)
endif
(
WINRT
)
mark_as_advanced
(
OPENCL_INCLUDE_DIR OPENCL_LIBRARY
)
if
(
OPENCL_FOUND
)
if
(
OPENCL_LIBRARY
)
set
(
HAVE_OPENCL_STATIC ON
)
set
(
OPENCL_LIBRARIES
"
${
OPENCL_LIBRARY
}
"
)
else
()
set
(
HAVE_OPENCL_STATIC OFF
)
endif
()
if
(
NOT HAVE_OPENCL_STATIC
)
try_compile
(
__VALID_OPENCL
"
${
OpenCV_BINARY_DIR
}
"
...
...
@@ -29,20 +29,12 @@ if(OPENCL_FOUND)
endif
()
endif
()
if
(
NOT WINRT
)
set
(
HAVE_OPENCL 1
)
endif
()
set
(
HAVE_OPENCL 1
)
if
(
WITH_OPENCL_SVM
)
set
(
HAVE_OPENCL_SVM 1
)
endif
()
if
(
HAVE_OPENCL_STATIC
)
set
(
OPENCL_LIBRARIES
"
${
OPENCL_LIBRARY
}
"
)
else
()
unset
(
OPENCL_LIBRARIES
)
endif
()
set
(
OPENCL_INCLUDE_DIRS
${
OPENCL_INCLUDE_DIR
}
)
if
(
WITH_OPENCLAMDFFT
)
...
...
cmake/OpenCVModule.cmake
View file @
c35ddcba
...
...
@@ -701,7 +701,6 @@ macro(ocv_glob_module_sources)
)
if
(
cl_kernels
)
set
(
OCL_NAME opencl_kernels_
${
name
}
)
ocv_include_directories
(
${
OPENCL_INCLUDE_DIRS
}
)
add_custom_command
(
OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
OCL_NAME
}
.cpp"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
OCL_NAME
}
.hpp"
COMMAND
${
CMAKE_COMMAND
}
"-DMODULE_NAME=
${
name
}
"
"-DCL_DIR=
${
CMAKE_CURRENT_LIST_DIR
}
/src/opencl"
"-DOUTPUT=
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
OCL_NAME
}
.cpp"
-P
"
${
OpenCV_SOURCE_DIR
}
/cmake/cl2cpp.cmake"
...
...
modules/core/CMakeLists.txt
View file @
c35ddcba
...
...
@@ -27,7 +27,7 @@ source_group("Cuda Headers\\Detail" FILES ${lib_cuda_hdrs_detail})
ocv_glob_module_sources
(
SOURCES
"
${
OPENCV_MODULE_opencv_core_BINARY_DIR
}
/version_string.inc"
HEADERS
${
lib_cuda_hdrs
}
${
lib_cuda_hdrs_detail
}
)
ocv_module_include_directories
(
${
the_module
}
${
ZLIB_INCLUDE_DIRS
}
)
ocv_module_include_directories
(
${
the_module
}
${
ZLIB_INCLUDE_DIRS
}
${
OPENCL_INCLUDE_DIRS
}
)
ocv_create_module
(
${
extra_libs
}
)
ocv_add_accuracy_tests
()
...
...
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