oneTBB: TBBConfig.cmake should not add '-isystem /usr/local' to gcc's CXX_INCLUDES flag

TBBConfig.cmake: https://github.com/intel/tbb/blob/tbb_2019/cmake/templates/TBBConfig.cmake.in#L57 sets the property INTERFACE_INCLUDE_DIRECTORIES to ${CMAKE_CURRENT_LIST_DIR}/../../../include (which equals /usr/include). It causes that -isystem /usr/lib64/cmake/TBB/../../../include (equal -isystem /usr/include) is being added to gcc’s CXX_INCLUDES flag, what is wrong and causes a compilation error - see https://github.com/pmem/libpmemobj-cpp/issues/508

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@alalek, @RuRo, thank you for so detailed investigation! I checked it on my side too. The fix is planned to be implemented in one of future TBB releases.

This one works:

get_filename_component(COMPONENT_INCLUDE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@" ABSOLUTE)
set_target_properties(TBB::${_tbb_component} PROPERTIES
                    INTERFACE_INCLUDE_DIRECTORIES "${COMPONENT_INCLUDE_DIRECTORY}")

Just changing ABSOLUTE to REALPATH doesn’t seem to work.

Okay, resolving symlinks in TBBConfig.cmake like you suggested worked for me.