Skip to content

Fix compile error with external TBB and -DBUILD_SHARED_LIBS=OFF - #14308

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
m000:master
Apr 16, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
m000:master

Conversation

@m000

@m000 m000 commented Apr 12, 2019 •

Copy link
Copy Markdown
Contributor

Adds IMPORTED for the TBB::tbb alias target as otherwise cmake produces the following error:

CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "tbb" that is not in the export set.

This problem occurs with the defaults used by homebrew on macOS, which compiles both static and shared versions of TBB and OpenCV. The problem should also occur on other platforms when -DBUILD_SHARED_LIBS=OFF is set and an external TBB library is used. However, I don't have the setup to verify this in practice.

A similar fix is implemented in #12741 for another module.

Xbuild_tbb=ON
Xwith_tbb=ON
Xbuild_shared=OFF

@alalek

alalek commented Apr 12, 2019

Copy link
Copy Markdown
Member

Thank you!

As a "bugfix" this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

Adds IMPORTED for the TBB::tbb alias target as otherwise cmake produces
the following error:

CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "tbb" that is not in the export set.

This problem occurs with the defaults used by homebrew on macOS, which
compiles both static and shared versions of TBB and OpenCV.
@m000
m000 changed the base branch from master to 3.4 April 13, 2019 19:53

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit ef16e42 into opencv:3.4 Apr 16, 2019
opencv-pushbot pushed a commit that referenced this pull request Apr 16, 2019
@alalek alalek mentioned this pull request Apr 18, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants