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
b9ab5939
Commit
b9ab5939
authored
Mar 05, 2013
by
cuda-geek
Committed by
OpenCV Buildbot
Mar 05, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #607 from cuda-geek:auto-compile-cuda
parents
fcde059c
39ecd940
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+22
-6
CMakeLists.txt
modules/core/CMakeLists.txt
+3
-16
No files found.
cmake/OpenCVModule.cmake
View file @
b9ab5939
...
...
@@ -427,16 +427,29 @@ endmacro()
# Usage:
# ocv_glob_module_sources(<extra sources&headers in the same format as used in ocv_set_module_sources>)
macro
(
ocv_glob_module_sources
)
file
(
GLOB
_RECURSE lib_srcs
"src/*.cpp"
)
file
(
GLOB
_RECURSE
lib_int_hdrs
"src/*.hpp"
"src/*.h"
)
file
(
GLOB lib_hdrs
"include/opencv2/
${
name
}
/*.hpp"
"include/opencv2/
${
name
}
/*.h"
)
file
(
GLOB
lib_srcs
"src/*.cpp"
)
file
(
GLOB lib_int_hdrs
"src/*.hpp"
"src/*.h"
)
file
(
GLOB lib_hdrs
"include/opencv2/
${
name
}
/*.hpp"
"include/opencv2/
${
name
}
/*.h"
)
file
(
GLOB lib_hdrs_detail
"include/opencv2/
${
name
}
/detail/*.hpp"
"include/opencv2/
${
name
}
/detail/*.h"
)
file
(
GLOB lib_device_srcs
"src/cuda/*.cu"
)
set
(
device_objs
""
)
set
(
lib_device_hdrs
""
)
if
(
HAVE_CUDA AND lib_device_srcs
)
ocv_include_directories
(
${
CUDA_INCLUDE_DIRS
}
)
file
(
GLOB lib_device_hdrs
"src/cuda/*.hpp"
)
ocv_cuda_compile
(
device_objs
${
lib_device_srcs
}
${
lib_device_hdrs
}
)
source_group
(
"Src
\\
Cuda"
FILES
${
lib_device_srcs
}
${
lib_device_hdrs
}
)
endif
()
ocv_set_module_sources
(
${
ARGN
}
HEADERS
${
lib_hdrs
}
${
lib_hdrs_detail
}
SOURCES
${
lib_srcs
}
${
lib_int_hdrs
}
${
device_objs
}
${
lib_device_srcs
}
${
lib_device_hdrs
}
)
source_group
(
"Src"
FILES
${
lib_srcs
}
${
lib_int_hdrs
}
)
source_group
(
"Include"
FILES
${
lib_hdrs
}
)
source_group
(
"Include
\\
detail"
FILES
${
lib_hdrs_detail
}
)
ocv_set_module_sources
(
${
ARGN
}
HEADERS
${
lib_hdrs
}
${
lib_hdrs_detail
}
SOURCES
${
lib_srcs
}
${
lib_int_hdrs
}
)
endmacro
()
# creates OpenCV module in current folder
...
...
@@ -449,6 +462,9 @@ macro(ocv_create_module)
if
(
NOT
"
${
ARGN
}
"
STREQUAL
"SKIP_LINK"
)
target_link_libraries
(
${
the_module
}
${
OPENCV_MODULE_
${
the_module
}
_DEPS
}
${
OPENCV_MODULE_
${
the_module
}
_DEPS_EXT
}
${
OPENCV_LINKER_LIBS
}
${
IPP_LIBS
}
${
ARGN
}
)
if
(
HAVE_CUDA
)
target_link_libraries
(
${
the_module
}
${
CUDA_LIBRARIES
}
${
CUDA_npp_LIBRARY
}
)
endif
()
endif
()
add_dependencies
(
opencv_modules
${
the_module
}
)
...
...
@@ -530,8 +546,8 @@ endmacro()
# ocv_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
macro
(
ocv_define_module module_name
)
ocv_add_module
(
${
module_name
}
${
ARGN
}
)
ocv_glob_module_sources
()
ocv_module_include_directories
()
ocv_glob_module_sources
()
ocv_create_module
()
ocv_add_precompiled_headers
(
${
the_module
}
)
...
...
modules/core/CMakeLists.txt
View file @
b9ab5939
set
(
the_description
"The Core Functionality"
)
ocv_add_module
(
core
${
ZLIB_LIBRARIES
}
)
ocv_module_include_directories
(
${
ZLIB_INCLUDE_DIR
}
)
ocv_module_include_directories
(
${
ZLIB_INCLUDE_DIR
}
"
${
OpenCV_SOURCE_DIR
}
/modules/gpu/include"
)
if
(
HAVE_CUDA
)
ocv_source_group
(
"Src
\\
Cuda"
GLOB
"src/cuda/*.cu"
)
ocv_include_directories
(
"
${
OpenCV_SOURCE_DIR
}
/modules/gpu/include"
${
CUDA_INCLUDE_DIRS
}
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef
)
file
(
GLOB lib_cuda
"src/cuda/*.cu"
)
ocv_cuda_compile
(
cuda_objs
${
lib_cuda
}
)
set
(
cuda_link_libs
${
CUDA_LIBRARIES
}
${
CUDA_npp_LIBRARY
}
)
else
()
set
(
lib_cuda
""
)
set
(
cuda_objs
""
)
set
(
cuda_link_libs
""
)
endif
()
ocv_glob_module_sources
(
SOURCES
${
lib_cuda
}
${
cuda_objs
}
"
${
opencv_core_BINARY_DIR
}
/version_string.inc"
)
ocv_create_module
(
${
cuda_link_libs
}
)
ocv_glob_module_sources
(
SOURCES
"
${
opencv_core_BINARY_DIR
}
/version_string.inc"
)
ocv_create_module
()
ocv_add_precompiled_headers
(
${
the_module
}
)
ocv_add_accuracy_tests
()
ocv_add_perf_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