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
34a9ce6e
Commit
34a9ce6e
authored
7 years ago
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: support searching for TBB via cmake package mechanism
parent
403c3c3d
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
OpenCVDetectTBB.cmake
cmake/OpenCVDetectTBB.cmake
+24
-3
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+1
-1
No files found.
cmake/OpenCVDetectTBB.cmake
View file @
34a9ce6e
...
...
@@ -18,7 +18,24 @@
# - HAVE_TBB set to TRUE
# - "tbb" target exists and added to OPENCV_LINKER_LIBS
function
(
ocv_tbb_verify
)
function
(
ocv_tbb_cmake_guess _found
)
find_package
(
TBB QUIET COMPONENTS tbb PATHS
"$ENV{TBBROOT}/cmake"
)
if
(
TBB_FOUND
)
if
(
NOT TARGET TBB::tbb
)
message
(
WARNING
"No TBB::tbb target found!"
)
return
()
endif
()
get_target_property
(
_lib TBB::tbb IMPORTED_LOCATION_RELEASE
)
message
(
STATUS
"Found TBB (cmake):
${
_lib
}
"
)
get_target_property
(
_inc TBB::tbb INTERFACE_INCLUDE_DIRECTORIES
)
ocv_tbb_read_version
(
"
${
_inc
}
"
)
add_library
(
tbb INTERFACE
)
target_link_libraries
(
tbb INTERFACE TBB::tbb
)
set
(
${
_found
}
TRUE PARENT_SCOPE
)
endif
()
endfunction
()
function
(
ocv_tbb_env_verify
)
if
(
NOT
"$ENV{TBBROOT}"
STREQUAL
""
)
# check that library and include dir are inside TBBROOT location
get_filename_component
(
_root
"$ENV{TBBROOT}"
ABSOLUTE
)
...
...
@@ -46,7 +63,7 @@ function(ocv_tbb_env_guess _found)
find_library
(
TBB_ENV_LIB_DEBUG NAMES
"tbb_debug"
PATHS ENV LIBRARY_PATH NO_DEFAULT_PATH
)
find_library
(
TBB_ENV_LIB_DEBUG NAMES
"tbb_debug"
)
if
(
TBB_ENV_INCLUDE
AND
(
TBB_ENV_LIB OR TBB_ENV_LIB_DEBUG
))
ocv_tbb_verify
()
ocv_tbb_
env_
verify
()
ocv_tbb_read_version
(
"
${
TBB_ENV_INCLUDE
}
"
)
add_library
(
tbb UNKNOWN IMPORTED
)
set_target_properties
(
tbb PROPERTIES
...
...
@@ -54,7 +71,7 @@ function(ocv_tbb_env_guess _found)
IMPORTED_LOCATION_DEBUG
"
${
TBB_ENV_LIB_DEBUG
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
TBB_ENV_INCLUDE
}
"
)
message
(
STATUS
"Found TBB:
${
TBB_ENV_LIB
}
"
)
message
(
STATUS
"Found TBB
(env)
:
${
TBB_ENV_LIB
}
"
)
set
(
${
_found
}
TRUE PARENT_SCOPE
)
endif
()
endfunction
()
...
...
@@ -74,6 +91,10 @@ if(BUILD_TBB)
set
(
HAVE_TBB TRUE
)
endif
()
if
(
NOT HAVE_TBB
)
ocv_tbb_cmake_guess
(
HAVE_TBB
)
endif
()
if
(
NOT HAVE_TBB
)
ocv_tbb_env_guess
(
HAVE_TBB
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
cmake/OpenCVUtils.cmake
View file @
34a9ce6e
...
...
@@ -1238,7 +1238,7 @@ macro(ocv_get_all_libs _modules _extra _3rdparty)
endif
()
if
(
TARGET
${
dep
}
)
get_target_property
(
_type
${
dep
}
TYPE
)
if
(
_type STREQUAL
"STATIC_LIBRARY"
AND BUILD_SHARED_LIBS
)
if
(
_type STREQUAL
"STATIC_LIBRARY"
AND BUILD_SHARED_LIBS
OR _type STREQUAL
"INTERFACE_LIBRARY"
)
# nothing
else
()
get_target_property
(
_output
${
dep
}
IMPORTED_LOCATION
)
...
...
This diff is collapsed.
Click to expand it.
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