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
6b19c762
Commit
6b19c762
authored
Oct 07, 2012
by
cuda_geek
Committed by
marina.kolpakova
Oct 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix hardcoded paths for static build OpenCV with CUDA
parent
b486a592
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
OpenCVGenConfig.cmake
cmake/OpenCVGenConfig.cmake
+9
-0
OpenCVConfig.cmake.in
cmake/templates/OpenCVConfig.cmake.in
+25
-0
No files found.
cmake/OpenCVGenConfig.cmake
View file @
6b19c762
...
...
@@ -13,8 +13,10 @@ endif()
if
(
NOT OpenCV_CUDA_CC
)
set
(
OpenCV_CUDA_CC_CONFIGCMAKE
"
\"\"
"
)
set
(
OpenCV_CUDA_VERSION
""
)
else
()
set
(
OpenCV_CUDA_CC_CONFIGCMAKE
"
${
OpenCV_CUDA_CC
}
"
)
set
(
OpenCV_CUDA_VERSION
${
CUDA_VERSION_STRING
}
)
endif
()
if
(
NOT ANDROID_NATIVE_API_LEVEL
)
...
...
@@ -64,11 +66,18 @@ macro(ocv_generate_dependencies_map_configcmake suffix configuration)
string
(
REGEX REPLACE
"
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
$"
"
${
OPENCV_LINK_LIBRARY_SUFFIX
}
"
__libname
"
${
__libname
}
"
)
endif
()
if
(
CUDA_FOUND AND WIN32
)
if
(
${
__ocv_lib
}
_EXTRA_DEPS_
${
suffix
}
)
list
(
REMOVE_ITEM
${
__ocv_lib
}
_EXTRA_DEPS_
${
suffix
}
${
CUDA_LIBRARIES
}
${
CUDA_CUFFT_LIBRARIES
}
${
CUDA_CUBLAS_LIBRARIES
}
${
CUDA_npp_LIBRARY
}
${
CUDA_nvcuvid_LIBRARY
}
${
CUDA_nvcuvenc_LIBRARY
}
)
endif
()
endif
()
string
(
REPLACE
" "
"
\\
"
__mod_deps
"
${${
__ocv_lib
}
_MODULE_DEPS_
${
suffix
}}
"
)
string
(
REPLACE
" "
"
\\
"
__ext_deps
"
${${
__ocv_lib
}
_EXTRA_DEPS_
${
suffix
}}
"
)
string
(
REPLACE
"
\"
"
"
\\\"
"
__mod_deps
"
${
__mod_deps
}
"
)
string
(
REPLACE
"
\"
"
"
\\\"
"
__ext_deps
"
${
__ext_deps
}
"
)
set
(
OPENCV_DEPENDENCIES_MAP_
${
suffix
}
"
${
OPENCV_DEPENDENCIES_MAP_
${
suffix
}}
set(OpenCV_
${
__ocv_lib
}
_LIBNAME_
${
suffix
}
\"
${
__libname
}
\"
)
\n
"
)
set
(
OPENCV_DEPENDENCIES_MAP_
${
suffix
}
"
${
OPENCV_DEPENDENCIES_MAP_
${
suffix
}}
set(OpenCV_
${
__ocv_lib
}
_DEPS_
${
suffix
}
${
__mod_deps
}
)
\n
"
)
set
(
OPENCV_DEPENDENCIES_MAP_
${
suffix
}
"
${
OPENCV_DEPENDENCIES_MAP_
${
suffix
}}
set(OpenCV_
${
__ocv_lib
}
_EXTRA_DEPS_
${
suffix
}
${
__ext_deps
}
)
\n
"
)
...
...
cmake/templates/OpenCVConfig.cmake.in
View file @
6b19c762
...
...
@@ -40,6 +40,10 @@
# Version Compute Capability from which OpenCV has been compiled is remembered
set(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC_CONFIGCMAKE@)
set(OpenCV_CUDA_VERSION @OpenCV_CUDA_VERSION@)
set(OpenCV_USE_CUBLAS @HAVE_CUBLAS@)
set(OpenCV_USE_CUFFT @HAVE_CUFFT@)
# Android API level from which OpenCV has been compiled is remembered
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
...
...
@@ -212,6 +216,27 @@ foreach(__opttype OPT DBG)
else()
#TODO: duplicates are annoying but they should not be the problem
endif()
# fix hard coded paths for CUDA libraries under Windows
if(WIN32 AND OpenCV_CUDA_VERSION AND NOT OpenCV_SHARED)
if(NOT CUDA_FOUND)
find_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
else()
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION)
message(FATAL_ERROR "OpenCV static library compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
endif()
endif()
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY} ${CUDA_nvcuvid_LIBRARY} ${CUDA_nvcuvenc_LIBRARY})
if(OpenCV_USE_CUBLAS)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUBLAS_LIBRARIES})
endif()
if(OpenCV_USE_CUFFT)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUFFT_LIBRARIES})
endif()
endif()
endforeach()
if(OpenCV_LIBS_DBG)
...
...
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