Add a CMake option to disable tests
They take a while to build and it would be nice to turn that off.
@mohd-akram your request is really reasonable. Could you please clarify the use case where you currently need such option?
I'm asking because there can be multiple ways to solve the original problem [test are always built]:
- Add option to control it explicitly (just as you've suggested)
- Automatically turn off the tests if oneDPL is included as sub-project through
add_subdirectory, keep tests turned on if oneDPL is configured directly. - Exclude tests from
alltarget (so they won't be built in case ofmakeormake all) - Combination of the options above
When I opened the issue it was for porting oneDPL to MacPorts. Then I realized this is just a header-only library so I just skipped the build step entirely. The oneTBB library has a TBB_TEST option, so I imagine something similar could be used here. Option 3 would likely be ideal, and would negate the need for a separate config flag in my case.
This seems fixed, thanks!