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
bb873b1d
Commit
bb873b1d
authored
Dec 12, 2014
by
Boaz Stolk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option to link to dynamic IPP libraries
parent
fed1b3fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
16 deletions
+40
-16
CMakeLists.txt
CMakeLists.txt
+4
-0
OpenCVFindIPP.cmake
cmake/OpenCVFindIPP.cmake
+36
-16
No files found.
CMakeLists.txt
View file @
bb873b1d
...
...
@@ -181,6 +181,7 @@ OCV_OPTION(BUILD_PERF_TESTS "Build performance tests"
OCV_OPTION
(
BUILD_TESTS
"Build accuracy & regression tests"
ON
IF
(
NOT IOS
)
)
OCV_OPTION
(
BUILD_WITH_DEBUG_INFO
"Include debug info into debug libs (not MSCV only)"
ON
)
OCV_OPTION
(
BUILD_WITH_STATIC_CRT
"Enables use of staticaly linked CRT for staticaly linked OpenCV"
ON IF MSVC
)
OCV_OPTION
(
BUILD_WITH_DYNAMIC_IPP
"Enables dynamic linking of IPP (only for standalone IPP)"
OFF
)
OCV_OPTION
(
BUILD_FAT_JAVA_LIB
"Create fat java wrapper containing the whole OpenCV library"
ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX
)
OCV_OPTION
(
BUILD_ANDROID_SERVICE
"Build OpenCV Manager for Google Play"
OFF IF ANDROID AND ANDROID_SOURCE_TREE
)
OCV_OPTION
(
BUILD_ANDROID_PACKAGE
"Build platform-specific package for Google Play"
OFF IF ANDROID
)
...
...
@@ -960,6 +961,9 @@ status(" Other third-party libraries:")
if
(
WITH_IPP AND HAVE_IPP
)
status
(
" Use IPP:"
"
${
IPP_VERSION_STR
}
[
${
IPP_VERSION_MAJOR
}
.
${
IPP_VERSION_MINOR
}
.
${
IPP_VERSION_BUILD
}
]"
)
status
(
" at:"
"
${
IPP_ROOT_DIR
}
"
)
if
(
NOT HAVE_IPP_ICV_ONLY
)
status
(
" linked:"
BUILD_WITH_DYNAMIC_IPP THEN
"dynamic"
ELSE
"static"
)
endif
()
else
()
status
(
" Use IPP:"
WITH_IPP AND NOT HAVE_IPP THEN
"IPP not found"
ELSE NO
)
endif
()
...
...
cmake/OpenCVFindIPP.cmake
View file @
bb873b1d
...
...
@@ -34,9 +34,6 @@ unset(IPP_VERSION_MAJOR)
unset
(
IPP_VERSION_MINOR
)
unset
(
IPP_VERSION_BUILD
)
set
(
IPP_LIB_PREFIX
${
CMAKE_STATIC_LIBRARY_PREFIX
}
)
set
(
IPP_LIB_SUFFIX
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
set
(
IPP_X64 0
)
if
(
CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8
)
set
(
IPP_X64 1
)
...
...
@@ -125,19 +122,34 @@ macro(ipp_detect_version)
endif
()
macro
(
_ipp_add_library name
)
# dynamic linking is only supported for standalone version of IPP
if
(
BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY
)
set
(
IPP_LIB_PREFIX
${
CMAKE_SHARED_LIBRARY_PREFIX
}
)
set
(
IPP_LIB_SUFFIX
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
else
()
set
(
IPP_LIB_PREFIX
${
CMAKE_STATIC_LIBRARY_PREFIX
}
)
set
(
IPP_LIB_SUFFIX
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
endif
()
if
(
EXISTS
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
)
add_library
(
ipp
${
name
}
STATIC IMPORTED
)
set_target_properties
(
ipp
${
name
}
PROPERTIES
if
(
BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY
)
add_library
(
${
IPP_PREFIX
}${
name
}
STATIC IMPORTED
)
else
()
add_library
(
${
IPP_PREFIX
}${
name
}
SHARED IMPORTED
)
endif
()
set_target_properties
(
${
IPP_PREFIX
}${
name
}
PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES
""
IMPORTED_LOCATION
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
)
list
(
APPEND IPP_LIBRARIES ipp
${
name
}
)
# CMake doesn't support "install(TARGETS ipp${name} " command with imported targets
install
(
FILES
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
DESTINATION
${
OPENCV_3P_LIB_INSTALL_PATH
}
COMPONENT main
)
string
(
TOUPPER
${
name
}
uname
)
set
(
IPP
${
uname
}
_INSTALL_PATH
"
${
CMAKE_INSTALL_PREFIX
}
/
${
OPENCV_3P_LIB_INSTALL_PATH
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
"
CACHE INTERNAL
""
FORCE
)
set
(
IPP
${
uname
}
_LOCATION_PATH
"
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
"
CACHE INTERNAL
""
FORCE
)
list
(
APPEND IPP_LIBRARIES
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
)
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
# When using dynamic libraries from standalone IPP it is your responsibility to install those on the target system
if
(
NOT BUILD_WITH_DYNAMIC_IPP
)
install
(
FILES
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
DESTINATION
${
OPENCV_3P_LIB_INSTALL_PATH
}
COMPONENT main
)
string
(
TOUPPER
${
name
}
uname
)
set
(
IPP
${
uname
}
_INSTALL_PATH
"
${
CMAKE_INSTALL_PREFIX
}
/
${
OPENCV_3P_LIB_INSTALL_PATH
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
"
CACHE INTERNAL
""
FORCE
)
set
(
IPP
${
uname
}
_LOCATION_PATH
"
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
"
CACHE INTERNAL
""
FORCE
)
endif
()
else
()
message
(
STATUS
"Can't find IPP library:
${
name
}
at
${
IPP_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
IPP_PREFIX
}${
name
}${
IPP_SUFFIX
}${
IPP_LIB_SUFFIX
}
"
)
endif
()
...
...
@@ -145,10 +157,18 @@ macro(ipp_detect_version)
set
(
IPP_PREFIX
"ipp"
)
if
(
${
IPP_VERSION_STR
}
VERSION_LESS
"8.0"
)
set
(
IPP_SUFFIX
"_l"
)
# static not threaded libs suffix IPP 7.x
else
()
if
(
BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY
)
set
(
IPP_SUFFIX
""
)
# dynamic not threaded libs suffix IPP 7.x
else
()
set
(
IPP_SUFFIX
"_l"
)
# static not threaded libs suffix IPP 7.x
endif
()
else
()
if
(
WIN32
)
set
(
IPP_SUFFIX
"mt"
)
# static not threaded libs suffix IPP 8.x for Windows
if
(
BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY
)
set
(
IPP_SUFFIX
""
)
# dynamic not threaded libs suffix IPP 8.x for Windows
else
()
set
(
IPP_SUFFIX
"mt"
)
# static not threaded libs suffix IPP 8.x for Windows
endif
()
else
()
set
(
IPP_SUFFIX
""
)
# static not threaded libs suffix IPP 8.x for Linux/OS X
endif
()
...
...
@@ -191,7 +211,7 @@ macro(ipp_detect_version)
if
(
EXISTS
${
INTEL_COMPILER_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
name
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
list
(
APPEND IPP_LIBRARIES
${
INTEL_COMPILER_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
name
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
else
()
message
(
STATUS
"Can't find compiler library:
${
name
}
"
)
message
(
STATUS
"Can't find compiler library:
${
name
}
at
${
INTEL_COMPILER_LIBRARY_DIR
}
/
${
IPP_LIB_PREFIX
}${
name
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
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