oneTBB
oneTBB copied to clipboard
CMake: add option TBB_INSTALL
Signed-off-by: Vladislav Shchapov [email protected]
Description
Make installation optional.
In the case of including oneTBB using add_subdirectory, it may require a custom installation rules.
Fixes # - issue number(s) if exists
- [x] - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
- [ ] bug fix - change that fixes an issue
- [ ] new feature - change that adds functionality
- [ ] tests - change in tests
- [x] infrastructure - change in infrastructure and CI
- [ ] documentation - documentation update
Tests
- [ ] added - required for new features and some bug fixes
- [x] not needed
Documentation
- [x] updated in this PR
- [ ] needs to be updated
- [ ] not needed
Breaks backward compatibility
- [ ] Yes
- [x] No
- [ ] Unknown
Notify the following users
List users with @ to send notifications
Other information
Hi @phprus, I'd like to double check that I got the use case properly: you want to have oneTBB added into your project with add_subdirectory but don't want oneTBB to be installed when you run make install for your project. Right? And all you need - is to wrap all the installation instructions for oneTBB under condition with a new option TBB_INSTALL without other modifications of installation instructions. Right?
- Yes;
- Yes.
I use this patch (and set TBB_INSTALL to OFF) and custom install() commands (and some additional options for tbb* targets) for tbb, tbbmalloc, tbbmalloc_proxy targets in parent cmake project.
Ping?
Rebased onto current master.
Rebased
@pavelkumbrasev, @isaevil what do you think about this PR?
@pavelkumbrasev, @isaevil, @kboyarinov ping?
Rebased
Rebased and ping.
Rebased to resolve conflicts with current master.
Request review @isaevil, @pavelkumbrasev, @dnmokhov, @ilya-lavrenov
@phprus can you just use add_subdirectory with EXCLUDE_FROM_ALL option? It will ignore TBB install rules.
@ilya-lavrenov, Thank you for your reply!
EXCLUDE_FROM_ALL by default disables test compilation and does not allow to set custom installation rules for targets.
I need build/run all tests and install targets tbb, tbbmalloc, tbbmalloc_proxy with custom DESTINATIONs and COMPONENTs options.
Since the build system has the TBB_INSTALL_VARS option, I suggest adding a option to completely disable the installation.
EXCLUDE_FROM_ALL by default disables test compilation
Why do you need to build tests when TBB (or other external project) is used as submodule and included into main project via add_subdirectory? It's a good practice to include external projects with EXCLUDE_FROM_ALL option
does not allow to set custom installation rules for targets
It allows. But there are some corner cases (like we had with pugixml https://github.com/zeux/pugixml/pull/585 in OpenVINO). So, in general I agree that it's better to disable install rules.
@ilya-lavrenov
Why do you need to build tests when TBB (or other external project) is used as submodule and included into main project via
add_subdirectory?
We try to run tests for all dependencies. Sometimes this helps to find bugs in dependencies. Sometimes we use our own patches for dependencies, which requires running tests. For example, for oneTBB: this PR, #1114 and #714.