FindTBBMALLOC.cmake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ################################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ################################################################################
  16. # - Try to find the TBB malloc proxy library
  17. # Once done this will define
  18. #
  19. # TBBMALLOC_FOUND - system has the TBBMALLOC library
  20. # TBBMALLOC_LIBRARIES - The libraries needed to use TBBMALLOC
  21. IF (NOT TBBMALLOC_FOUND)
  22. SET (tbbmalloc_lib "tbbmalloc_proxy")
  23. IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
  24. IF (WIN32)
  25. IF (${ARCH64BIT} EQUAL 1)
  26. SET (osdir "Win64")
  27. ELSE()
  28. SET (osdir "Win32")
  29. ENDIF()
  30. SET (tbbver "1.2.8")
  31. ELSE()
  32. SET (osdir "unknown")
  33. SET (tbbver "unknown")
  34. ENDIF()
  35. IF (NOT ("${osdir}" STREQUAL "unknown"))
  36. FIND_LIBRARY (TBBMALLOC_LIBRARIES NAMES ${tbbmalloc_lib} PATHS "${EXTERNALS_DIRECTORY}/tbb/${tbbver}/lib/${osdir}" NO_DEFAULT_PATH)
  37. ENDIF()
  38. ENDIF()
  39. if (USE_NATIVE_LIBRARIES)
  40. # if we didn't find in externals, look in system include path
  41. FIND_LIBRARY (TBBMALLOC_LIBRARIES NAMES ${tbbmalloc_lib})
  42. endif()
  43. include(FindPackageHandleStandardArgs)
  44. find_package_handle_standard_args(TBBMALLOC DEFAULT_MSG
  45. TBBMALLOC_LIBRARIES
  46. )
  47. MARK_AS_ADVANCED(TBBMALLOC_LIBRARIES)
  48. ENDIF()