oneapi-src / oneTBB

oneAPI Threading Building Blocks (oneTBB)
https://oneapi-src.github.io/oneTBB/
Apache License 2.0
5.61k stars 1.01k forks source link

replace `CMAKE_CURRENT_SOURCE_DIR` by `CMAKE_SOURCE_DIR` in `src/tbb/CMakeLists.txt` #517

Closed fschloesser closed 3 years ago

fschloesser commented 3 years ago

When adding oneTBB as a subdirectory i needed to replace CMAKE_CURRENT_SOURCE_DIR by CMAKE_SOURCE_DIR in https://github.com/oneapi-src/oneTBB/blob/a070e5f2086c895adf125c490b1f0e0acd6330a5/src/tbb/CMakeLists.txt#L172

AlexVeprev commented 3 years ago

@fschloesser, the line you point at doesn't contain neither CMAKE_CURRENT_SOURCE_DIR nor CMAKE_SOURCE_DIR. Some time ago I applied a fix to the line: https://github.com/oneapi-src/oneTBB/pull/476. Could you please clarify what problem you have now? What version of oneTBB do you use?

fschloesser commented 3 years ago

Sorry, I mistyped, I of course mean PROJECT_SOURCE_DIR and CMAKE_CURRENT_SOURCE_DIR

I use the onetbb_2021, but i think this is also in master

AlexVeprev commented 3 years ago

@fschloesser, according to the doc:

This is the source directory of the last call to the project() command

Root CMakeLists.txt in oneTBB has unconditional project() call: https://github.com/oneapi-src/oneTBB/blob/357c9b27fa84eaf748bc556585c26995c446eceb/CMakeLists.txt#L57

So this call should set PROJECT_SOURCE_DIR specific for oneTBB scope. How do you do add_subdirectory()? Maybe you can provide step-by-step instruction how to reproduce the issue.

AlexVeprev commented 3 years ago

I use the onetbb_2021, but i think this is also in master

Oh, seems you didn't mean PROJECT_SOURCE_DIR, since onetbb_2021 doesn't contain #476 fix: https://github.com/oneapi-src/oneTBB/blob/261fe22630bd61ec137b66f6dd4403ad7ab36a14/src/tbb/CMakeLists.txt#L140

onetbb_2021 contains release snapshots and will be updated for the next release. Please try master branch for your case.

AlexVeprev commented 3 years ago

Here is the original issue: https://github.com/oneapi-src/oneTBB/issues/474. This one looks as duplicate.

fschloesser commented 3 years ago

Yes, this was the original issue. Thank you and sorry for the confusion.