Skip to content
Snippets Groups Projects
Commit 899f863c authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Merge branch 'TBBFixes-master-20201202' into 'master'

TBB Fixes, master branch (2020.12.02.)

See merge request atlas/atlasexternals!784
parents e0945aff 628da44a
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,46 @@ endif()
# Main installation directory for TBB.
get_filename_component( TBB_INSTALL_PATH ${TBB_INCLUDE_DIR} DIRECTORY )
# Update the library names on the imported library targets to point at the
# real physical files. Since in most cases libtbb.so will actually be a text
# file with the name of the real library file. CMake can deal with that
# correctly through ${TBB_LIBRARIES}, but not when we use imported targets...
set( _components tbb ${TBB_FIND_COMPONENTS} )
list( REMOVE_DUPLICATES _components )
foreach( _comp ${_components} )
# If this library/component was not found, don't do anything.
if( NOT TARGET TBB::${_comp} )
continue()
endif()
# Get the library name set on the imported target.
get_target_property( _libName TBB::${_comp} IMPORTED_LOCATION )
# Read in the first 4 bytes of the file and see if they are the ELF magic
# number
set( _elfMagic "7f454c46" )
file( READ "${_libName}" _hexData OFFSET 0 LIMIT 4 HEX )
if( "${_hexData}" STREQUAL "${_elfMagic}" )
# Yepp, we don't need to do anything here.
continue()
endif()
# Read in the entire file as text, and try to set up the path to the real
# library based on that.
file( READ "${_libName}" _data OFFSET 0 LIMIT 1024 )
if( "${_data}" MATCHES "INPUT \\(([^(]+)\\)" )
# Update the library location on the imported target.
get_filename_component( _libDir "${_libName}" DIRECTORY )
set_target_properties( TBB::${_comp} PROPERTIES
IMPORTED_LOCATION "${_libDir}/${CMAKE_MATCH_1}" )
unset( _libDir )
endif()
unset( _data )
# If we got this far, then let's cross our fingers that things will work
# correctly, and don't update anything on the imported target...
endforeach()
unset( _components )
unset( _elfMagic )
unset( _hexData )
unset( _libName )
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( TBB
......
......@@ -15,8 +15,6 @@ endif()
# Find/set up all the externals that Gaudi needs.
find_package( TBB ${_quietFlag} )
set( TBB_ROOT "${TBB_INSTALL_PATH}" )
unset( TBB_FOUND ) # In order for Gaudi's FindTBB.cmake to set up TBB::tbb.
find_package( cppgsl ${_quietFlag} )
find_package( AIDA ${_quietFlag} )
set( AIDA_INCLUDE_DIRS "${AIDA_INCLUDE_DIRS}" CACHE PATH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment