@@ -45,6 +45,7 @@ if (WIN32)
4545 set (_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB" )
4646 set (_TBB_LIB_NAME "tbb" )
4747 set (_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME} malloc" )
48+ set (_TBB_LIB_MALLOC_PROXY_NAME "${_TBB_LIB_NAME} malloc_proxy" )
4849 set (_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME} _debug" )
4950 set (_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME} _debug" )
5051 if (MSVC71 )
@@ -78,6 +79,7 @@ if (UNIX)
7879 # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
7980 set (_TBB_LIB_NAME "tbb" )
8081 set (_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME} malloc" )
82+ set (_TBB_LIB_MALLOC_PROXY_NAME "${_TBB_LIB_NAME} malloc_proxy" )
8183 set (_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME} _debug" )
8284 set (_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME} _debug" )
8385 # has only one flavor: ia32/cc4.0.1_os10.4.9
@@ -88,6 +90,7 @@ if (UNIX)
8890 set (_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include" )
8991 set (_TBB_LIB_NAME "tbb" )
9092 set (_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME} malloc" )
93+ set (_TBB_LIB_MALLOC_PROXY_NAME "${_TBB_LIB_NAME} malloc_proxy" )
9194 set (_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME} _debug" )
9295 set (_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME} _debug" )
9396 # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
@@ -135,10 +138,12 @@ endif (NOT _TBB_INSTALL_DIR)
135138
136139if (TBB_OBVIOUS_PLACE)
137140 set (TBB_FOUND "YES" )
138- set (TBB_LIBRARIES ${TEST_TBB_LIBRARY} ${TBB_LIBRARIES} )
141+ find_library (TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} )
142+ find_library (TBB_MALLOC_PROXY_LIBRARY ${_TBB_LIB_MALLOC_PROXY_NAME} ${TBB_LIBRARY_DIR} )
143+ set (TBB_LIBRARIES ${TEST_TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_MALLOC_PROXY_LIBRARY} ${TBB_LIBRARIES} )
139144 set (TBB_INCLUDE_DIRS ${TEST_TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
140145 mark_as_advanced (TBB_INCLUDE_DIRS TBB_LIBRARIES)
141- message (STATUS "Found Intel TBB" )
146+ message (STATUS "Found Intel TBB, includes ${TBB_INCLUDE_DIRS} , ${TBB_LIBRARIES} " )
142147elseif (NOT _TBB_INSTALL_DIR)
143148 message (FATAL_ERROR "ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR} " )
144149else (TBB_OBVIOUS_PLACE)
@@ -163,34 +168,37 @@ else (TBB_OBVIOUS_PLACE)
163168 if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "" )
164169 set (TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR} /$ENV{TBB_ARCH_PLATFORM} /lib" )
165170 else (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "" )
166- # Undeprecated to allow for Windows use.
171+ # Undeprecated to allow for Windows use.
167172 set (TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR} /lib/${_TBB_ARCHITECTURE} /${_TBB_COMPILER} " )
168173 endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "" )
169174
170175 find_library (TBB_LIBRARY ${_TBB_LIB_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
171176 find_library (TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
172- mark_as_advanced (TBB_LIBRARY TBB_MALLOC_LIBRARY)
177+ find_library (TBB_MALLOC_PROXY_LIBRARY ${_TBB_LIB_MALLOC_PROXY_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
178+
179+ mark_as_advanced (TBB_LIBRARY TBB_MALLOC_LIBRARY TBB_MALLOC_PROXY_LIBRARY)
173180
174181 #-- Look for debug libraries
175182 find_library (TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
176183 find_library (TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
177184 mark_as_advanced (TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
178185
186+ message (STATUS "Found obvious Intel TBB, includes ${TBB_INCLUDE_DIRS} , ${TBB_LIBRARIES} " )
179187
180188 if (TBB_INCLUDE_DIR)
181189 if (TBB_LIBRARY)
182190 set (TBB_FOUND "YES" )
183191 if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
184- set (TBB_LIBRARIES optimized ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES} debug ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES} )
192+ set (TBB_LIBRARIES optimized ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_MALLOC_PROXY_LIBRARY} ${ TBB_LIBRARIES} debug ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES} )
185193 else ()
186- set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES} )
194+ set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_MALLOC_PROXY_LIBRARY} ${ TBB_LIBRARIES} )
187195 set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES} )
188196 mark_as_advanced (TBB_DEBUG_LIBRARIES)
189197 endif ()
190198 set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
191199 set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
192200 mark_as_advanced (TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_LIBRARIES)
193- message (STATUS "Found Intel TBB" )
201+ message (STATUS "Found Intel TBB, includes ${TBB_INCLUDE_DIRS} , ${TBB_LIBRARIES} " )
194202 endif (TBB_LIBRARY)
195203 endif (TBB_INCLUDE_DIR)
196204
0 commit comments