Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/cmake/Modules/FindTBB.cmake

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /cmake/Modules/FindTBB.cmake (Version 11.3.0) and /cmake/Modules/FindTBB.cmake (Version 8.2)


  1 # - Find ThreadingBuildingBlocks include dirs     
  2 # Use this module by invoking find_package wit    
  3 #  find_package(TBB                               
  4 #    [REQUIRED]             # Fail with error     
  5 #    )                      #                     
  6 # Once done, this will define                     
  7 #                                                 
  8 #  TBB_FOUND - system has TBB                     
  9 #  TBB_INCLUDE_DIRS - the TBB include director    
 10 #  TBB_LIBRARIES - TBB libraries to be lined,     
 11 #                  malloc proxy                   
 12 #  TBB::tbb - imported target for the TBB libr    
 13 #                                                 
 14 #  TBB_VERSION_MAJOR - Major Product Version N    
 15 #  TBB_VERSION_MINOR - Minor Product Version N    
 16 #  TBB_INTERFACE_VERSION - Engineering Focused    
 17 #  TBB_COMPATIBLE_INTERFACE_VERSION - The olde    
 18 #                                     still su    
 19 #                                     focused     
 20 #                                                 
 21 #  TBB_MALLOC_FOUND - system has TBB malloc li    
 22 #  TBB_MALLOC_INCLUDE_DIRS - the TBB malloc in    
 23 #  TBB_MALLOC_LIBRARIES - The TBB malloc libra    
 24 #  TBB::malloc - imported target for the TBB m    
 25 #                                                 
 26 #  TBB_MALLOC_PROXY_FOUND - system has TBB mal    
 27 #  TBB_MALLOC_PROXY_INCLUDE_DIRS = the TBB mal    
 28 #  TBB_MALLOC_PROXY_LIBRARIES - The TBB malloc    
 29 #  TBB::malloc_proxy - imported target for the    
 30 #                                                 
 31 #                                                 
 32 # This module reads hints about search locatio    
 33 #  ENV TBB_ARCH_PLATFORM - for eg. set it to "    
 34 #  ENV TBB_ROOT or just TBB_ROOT - root direct    
 35 #  ENV TBB_BUILD_PREFIX - specifies the build     
 36 #                         libraries. Should be    
 37 #                         and optionally...       
 38 #  ENV TBB_BUILD_DIR - if build directory is d    
 39 #                                                 
 40 #                                                 
 41 # Modified by Robert Maynard from the original    
 42 #                                                 
 43 #---------------------------------------------    
 44 # This file is part of the CMake build system     
 45 #     (Object-oriented Graphics Rendering Engi    
 46 # For the latest info, see http://www.ogre3d.o    
 47 #                                                 
 48 # The contents of this file are placed in the     
 49 # free to make use of it in any way you like.     
 50 #---------------------------------------------    
 51 #                                                 
 52 #=============================================    
 53 # Copyright 2010-2012 Kitware, Inc.               
 54 # Copyright 2012      Rolf Eike Beer <eike@sf-    
 55 #                                                 
 56 # Distributed under the OSI-approved BSD Licen    
 57 # see accompanying file COPYING-CMAKE-SCRIPTS     
 58 #                                                 
 59 # This software is distributed WITHOUT ANY WAR    
 60 # implied warranty of MERCHANTABILITY or FITNE    
 61 # See the License for more information.           
 62 #=============================================    
 63                                                   
 64 #=============================================    
 65 #  FindTBB helper functions and macros            
 66 #                                                 
 67                                                   
 68 # Use TBBConfig.cmake if possible.                
 69                                                   
 70 set(_tbb_find_quiet)                              
 71 if (TBB_FIND_QUIETLY)                             
 72   set(_tbb_find_quiet QUIET)                      
 73 endif ()                                          
 74 set(_tbb_find_components)                         
 75 set(_tbb_find_optional_components)                
 76 foreach (_tbb_find_component IN LISTS TBB_FIND    
 77   if (TBB_FIND_REQUIRED_${_tbb_find_component}    
 78     list(APPEND _tbb_find_components "${_tbb_f    
 79   else ()                                         
 80     list(APPEND _tbb_find_optional_components     
 81   endif ()                                        
 82 endforeach ()                                     
 83 unset(_tbb_find_component)                        
 84 find_package(TBB CONFIG ${_tbb_find_quiet}        
 85   COMPONENTS ${_tbb_find_components}              
 86   OPTIONAL_COMPONENTS ${_tbb_find_optional_com    
 87 unset(_tbb_find_quiet)                            
 88 unset(_tbb_find_components)                       
 89 unset(_tbb_find_optional_components)              
 90 if (TBB_FOUND)                                    
 91   return ()                                       
 92 endif ()                                          
 93                                                   
 94 #=============================================    
 95 # Fix the library path in case it is a linker     
 96 #=============================================    
 97 function(tbb_extract_real_library library real    
 98   if(NOT UNIX OR NOT EXISTS ${library})           
 99     set(${real_library} "${library}" PARENT_SC    
100     return()                                      
101   endif()                                         
102                                                   
103   #Read in the first 4 bytes and see if they a    
104   set(_elf_magic "7f454c46")                      
105   file(READ ${library} _hex_data OFFSET 0 LIMI    
106   if(_hex_data STREQUAL _elf_magic)               
107     #we have opened a elf binary so this is wh    
108     #we should link to                            
109     set(${real_library} "${library}" PARENT_SC    
110     return()                                      
111   endif()                                         
112                                                   
113   file(READ ${library} _data OFFSET 0 LIMIT 10    
114   if("${_data}" MATCHES "INPUT \\(([^(]+)\\)")    
115     #extract out the .so name from REGEX MATCH    
116     set(_proper_so_name "${CMAKE_MATCH_1}")       
117                                                   
118     #construct path to the real .so which is p    
119     #as the input file                            
120     get_filename_component(_so_dir "${library}    
121     set(${real_library} "${_so_dir}/${_proper_    
122   else()                                          
123     #unable to determine what this library is     
124     #and pass it unmodified.                      
125     set(${real_library} "${library}" PARENT_SC    
126   endif()                                         
127 endfunction()                                     
128                                                   
129 #=============================================    
130 # Do the final processing for the package find    
131 #=============================================    
132 macro(findpkg_finish PREFIX TARGET_NAME)          
133   if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBR    
134     set(${PREFIX}_FOUND TRUE)                     
135     set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_IN    
136     set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRA    
137   else ()                                         
138     if (${PREFIX}_FIND_REQUIRED AND NOT ${PREF    
139       message(FATAL_ERROR "Required library ${    
140     endif ()                                      
141   endif ()                                        
142                                                   
143   if (NOT TARGET "TBB::${TARGET_NAME}")           
144     if (${PREFIX}_LIBRARY_RELEASE)                
145       tbb_extract_real_library(${${PREFIX}_LIB    
146     endif ()                                      
147     if (${PREFIX}_LIBRARY_DEBUG)                  
148       tbb_extract_real_library(${${PREFIX}_LIB    
149     endif ()                                      
150     add_library(TBB::${TARGET_NAME} UNKNOWN IM    
151     set_target_properties(TBB::${TARGET_NAME}     
152       INTERFACE_INCLUDE_DIRECTORIES "${${PREFI    
153     if (${PREFIX}_LIBRARY_DEBUG AND ${PREFIX}_    
154       set_target_properties(TBB::${TARGET_NAME    
155         IMPORTED_LOCATION "${real_release}"       
156         IMPORTED_LOCATION_DEBUG "${real_debug}    
157         IMPORTED_LOCATION_RELEASE "${real_rele    
158     elseif (${PREFIX}_LIBRARY_RELEASE)            
159       set_target_properties(TBB::${TARGET_NAME    
160         IMPORTED_LOCATION "${real_release}")      
161     elseif (${PREFIX}_LIBRARY_DEBUG)              
162       set_target_properties(TBB::${TARGET_NAME    
163         IMPORTED_LOCATION "${real_debug}")        
164     endif ()                                      
165   endif ()                                        
166                                                   
167   #mark the following variables as internal va    
168   mark_as_advanced(${PREFIX}_INCLUDE_DIR          
169                    ${PREFIX}_LIBRARY              
170                    ${PREFIX}_LIBRARY_DEBUG        
171                    ${PREFIX}_LIBRARY_RELEASE)     
172 endmacro()                                        
173                                                   
174 #=============================================    
175 # Generate debug names from given release name    
176 #=============================================    
177 macro(get_debug_names PREFIX)                     
178   foreach(i ${${PREFIX}})                         
179     set(${PREFIX}_DEBUG ${${PREFIX}_DEBUG} ${i    
180   endforeach()                                    
181 endmacro()                                        
182                                                   
183 #=============================================    
184 # See if we have env vars to help us find tbb     
185 #=============================================    
186 macro(getenv_path VAR)                            
187    set(ENV_${VAR} $ENV{${VAR}})                   
188    # replace won't work if var is blank           
189    if (ENV_${VAR})                                
190      string( REGEX REPLACE "\\\\" "/" ENV_${VA    
191    endif ()                                       
192 endmacro()                                        
193                                                   
194 #=============================================    
195 # Couple a set of release AND debug libraries     
196 #=============================================    
197 macro(make_library_set PREFIX)                    
198   if (${PREFIX}_RELEASE AND ${PREFIX}_DEBUG)      
199     set(${PREFIX} optimized ${${PREFIX}_RELEAS    
200   elseif (${PREFIX}_RELEASE)                      
201     set(${PREFIX} ${${PREFIX}_RELEASE})           
202   elseif (${PREFIX}_DEBUG)                        
203     set(${PREFIX} ${${PREFIX}_DEBUG})             
204   endif ()                                        
205 endmacro()                                        
206                                                   
207                                                   
208 #=============================================    
209 #  Now to actually find TBB                       
210 #                                                 
211                                                   
212 # Get path, convert backslashes as ${ENV_${var    
213 getenv_path(TBB_ROOT)                             
214                                                   
215 # initialize search paths                         
216 set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT    
217 set(TBB_INC_SEARCH_PATH "")                       
218 set(TBB_LIB_SEARCH_PATH "")                       
219                                                   
220                                                   
221 # If user built from sources                      
222 set(TBB_BUILD_PREFIX $ENV{TBB_BUILD_PREFIX})      
223 if (TBB_BUILD_PREFIX AND ENV_TBB_ROOT)            
224   getenv_path(TBB_BUILD_DIR)                      
225   if (NOT ENV_TBB_BUILD_DIR)                      
226     set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/buil    
227   endif ()                                        
228                                                   
229   # include directory under ${ENV_TBB_ROOT}/in    
230   list(APPEND TBB_LIB_SEARCH_PATH                 
231     ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_r    
232     ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_d    
233 endif ()                                          
234                                                   
235                                                   
236 # For Windows, let's assume that the user migh    
237 # TBB packages from the main website. These us    
238 # structure (at least for automatically findin    
239 # on platform and compiler, but we'll do our b    
240 # Not adding the same effort for the precompil    
241 # have different versions for CC compiler vers    
242 # will never adequately match the user's setup    
243 # to detect the "best" version to use. The use    
244 # select the right files. (Chances are the dis    
245 # custom version of tbb, anyway, so the proble    
246 if (WIN32 AND MSVC)                               
247   set(COMPILER_PREFIX "vc7.1")                    
248   if (MSVC_VERSION EQUAL 1400)                    
249     set(COMPILER_PREFIX "vc8")                    
250   elseif(MSVC_VERSION EQUAL 1500)                 
251     set(COMPILER_PREFIX "vc9")                    
252   elseif(MSVC_VERSION EQUAL 1600)                 
253     set(COMPILER_PREFIX "vc10")                   
254   elseif(MSVC_VERSION EQUAL 1700)                 
255     set(COMPILER_PREFIX "vc11")                   
256   elseif(MSVC_VERSION EQUAL 1800)                 
257     set(COMPILER_PREFIX "vc12")                   
258   elseif(MSVC_VERSION GREATER_EQUAL 1900)         
259     set(COMPILER_PREFIX "vc14")                   
260   endif ()                                        
261                                                   
262   # for each prefix path, add ia32/64\${COMPIL    
263   foreach (dir IN LISTS TBB_PREFIX_PATH)          
264     if (CMAKE_CL_64)                              
265       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
266       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
267       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
268       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
269     else ()                                       
270       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
271       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
272     endif ()                                      
273   endforeach ()                                   
274 endif ()                                          
275                                                   
276 # For OS X binary distribution, choose libc++     
277 # and above and AppleClang                        
278 if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND       
279     NOT CMAKE_SYSTEM_VERSION VERSION_LESS 13.0    
280   set (USE_LIBCXX OFF)                            
281   cmake_policy(GET CMP0025 POLICY_VAR)            
282                                                   
283   if (POLICY_VAR STREQUAL "NEW")                  
284     if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleC    
285       set (USE_LIBCXX ON)                         
286     endif ()                                      
287   else ()                                         
288     if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"    
289       set (USE_LIBCXX ON)                         
290     endif ()                                      
291   endif ()                                        
292                                                   
293   if (USE_LIBCXX)                                 
294     foreach (dir IN LISTS TBB_PREFIX_PATH)        
295       list (APPEND TBB_LIB_SEARCH_PATH ${dir}/    
296     endforeach ()                                 
297   endif ()                                        
298 endif ()                                          
299                                                   
300 # check compiler ABI                              
301 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")         
302   set(COMPILER_PREFIX)                            
303   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_L    
304     list(APPEND COMPILER_PREFIX "gcc4.8")         
305   endif()                                         
306   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_L    
307     list(APPEND COMPILER_PREFIX "gcc4.7")         
308   endif()                                         
309   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_L    
310     list(APPEND COMPILER_PREFIX "gcc4.4")         
311   endif()                                         
312   list(APPEND COMPILER_PREFIX "gcc4.1")           
313 elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")     
314   set(COMPILER_PREFIX)                            
315   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_L    
316     list(APPEND COMPILER_PREFIX "gcc4.8")         
317   endif()                                         
318   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_L    
319     list(APPEND COMPILER_PREFIX "gcc4.7")         
320   endif()                                         
321   list(APPEND COMPILER_PREFIX "gcc4.4")           
322 else() # Assume compatibility with 4.4 for oth    
323   list(APPEND COMPILER_PREFIX "gcc4.4")           
324 endif ()                                          
325                                                   
326 # if platform architecture is explicitly speci    
327 set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM})    
328 if (TBB_ARCH_PLATFORM)                            
329   foreach (dir IN LISTS TBB_PREFIX_PATH)          
330     list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${T    
331     list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib    
332   endforeach ()                                   
333 endif ()                                          
334                                                   
335 foreach (dir IN LISTS TBB_PREFIX_PATH)            
336   foreach (prefix IN LISTS COMPILER_PREFIX)       
337     if (CMAKE_SIZEOF_VOID_P EQUAL 8)              
338       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
339       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
340       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
341       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
342     else ()                                       
343       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
344       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/l    
345       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
346       list(APPEND TBB_LIB_SEARCH_PATH ${dir}/i    
347     endif ()                                      
348   endforeach()                                    
349 endforeach ()                                     
350                                                   
351 # add general search paths                        
352 foreach (dir IN LISTS TBB_PREFIX_PATH)            
353   list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib $    
354     ${dir}/Libs)                                  
355   list(APPEND TBB_INC_SEARCH_PATH ${dir}/inclu    
356     ${dir}/include/tbb)                           
357 endforeach ()                                     
358                                                   
359 set(TBB_LIBRARY_NAMES tbb)                        
360 get_debug_names(TBB_LIBRARY_NAMES)                
361                                                   
362                                                   
363 find_path(TBB_INCLUDE_DIR                         
364           NAMES tbb/tbb.h                         
365           PATHS ${TBB_INC_SEARCH_PATH})           
366                                                   
367 find_library(TBB_LIBRARY_RELEASE                  
368              NAMES ${TBB_LIBRARY_NAMES}           
369              PATHS ${TBB_LIB_SEARCH_PATH})        
370 find_library(TBB_LIBRARY_DEBUG                    
371              NAMES ${TBB_LIBRARY_NAMES_DEBUG}     
372              PATHS ${TBB_LIB_SEARCH_PATH})        
373 make_library_set(TBB_LIBRARY)                     
374                                                   
375 findpkg_finish(TBB tbb)                           
376                                                   
377 #if we haven't found TBB no point on going any    
378 if (NOT TBB_FOUND)                                
379   return()                                        
380 endif ()                                          
381                                                   
382 #=============================================    
383 # Look for TBB's malloc package                   
384 set(TBB_MALLOC_LIBRARY_NAMES tbbmalloc)           
385 get_debug_names(TBB_MALLOC_LIBRARY_NAMES)         
386                                                   
387 find_path(TBB_MALLOC_INCLUDE_DIR                  
388           NAMES tbb/tbb.h                         
389           PATHS ${TBB_INC_SEARCH_PATH})           
390                                                   
391 find_library(TBB_MALLOC_LIBRARY_RELEASE           
392              NAMES ${TBB_MALLOC_LIBRARY_NAMES}    
393              PATHS ${TBB_LIB_SEARCH_PATH})        
394 find_library(TBB_MALLOC_LIBRARY_DEBUG             
395              NAMES ${TBB_MALLOC_LIBRARY_NAMES_    
396              PATHS ${TBB_LIB_SEARCH_PATH})        
397 make_library_set(TBB_MALLOC_LIBRARY)              
398                                                   
399 findpkg_finish(TBB_MALLOC tbbmalloc)              
400                                                   
401 #=============================================    
402 # Look for TBB's malloc proxy package             
403 set(TBB_MALLOC_PROXY_LIBRARY_NAMES tbbmalloc_p    
404 get_debug_names(TBB_MALLOC_PROXY_LIBRARY_NAMES    
405                                                   
406 find_path(TBB_MALLOC_PROXY_INCLUDE_DIR            
407           NAMES tbb/tbbmalloc_proxy.h             
408           PATHS ${TBB_INC_SEARCH_PATH})           
409                                                   
410 find_library(TBB_MALLOC_PROXY_LIBRARY_RELEASE     
411              NAMES ${TBB_MALLOC_PROXY_LIBRARY_    
412              PATHS ${TBB_LIB_SEARCH_PATH})        
413 find_library(TBB_MALLOC_PROXY_LIBRARY_DEBUG       
414              NAMES ${TBB_MALLOC_PROXY_LIBRARY_    
415              PATHS ${TBB_LIB_SEARCH_PATH})        
416 make_library_set(TBB_MALLOC_PROXY_LIBRARY)        
417                                                   
418 findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_prox    
419                                                   
420                                                   
421 #=============================================    
422 #parse all the version numbers from tbb           
423 if(NOT TBB_VERSION)                               
424   if (EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/ve    
425     file(STRINGS                                  
426       "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h    
427       TBB_VERSION_CONTENTS                        
428       REGEX "VERSION")                            
429   else()                                          
430     #only read the start of the file              
431     file(STRINGS                                  
432       "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"       
433       TBB_VERSION_CONTENTS                        
434       REGEX "VERSION")                            
435   endif()                                         
436                                                   
437   string(REGEX REPLACE                            
438     ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "    
439     TBB_VERSION_MAJOR "${TBB_VERSION_CONTENTS}    
440                                                   
441   string(REGEX REPLACE                            
442     ".*#define TBB_VERSION_MINOR ([0-9]+).*" "    
443     TBB_VERSION_MINOR "${TBB_VERSION_CONTENTS}    
444                                                   
445   string(REGEX REPLACE                            
446         ".*#define TBB_INTERFACE_VERSION ([0-9    
447         TBB_INTERFACE_VERSION "${TBB_VERSION_C    
448                                                   
449   string(REGEX REPLACE                            
450         ".*#define TBB_COMPATIBLE_INTERFACE_VE    
451         TBB_COMPATIBLE_INTERFACE_VERSION "${TB    
452                                                   
453   set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_    
454                                                   
455 endif()                                           
456                                                   
457 include(FindPackageHandleStandardArgs)            
458 find_package_handle_standard_args(TBB             
459   REQUIRED_VARS TBB_INCLUDE_DIR TBB_LIBRARY       
460   VERSION_VAR TBB_VERSION)