diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake index 034487f9f6c..82b1520e5ee 100644 --- a/cmake/FindTBB.cmake +++ b/cmake/FindTBB.cmake @@ -45,6 +45,7 @@ if (WIN32) set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB") set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") + set(_TBB_LIB_MALLOC_PROXY_NAME "${_TBB_LIB_NAME}malloc_proxy") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") if (MSVC71) @@ -78,6 +79,7 @@ if (UNIX) # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") + set(_TBB_LIB_MALLOC_PROXY_NAME "${_TBB_LIB_NAME}malloc_proxy") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") # has only one flavor: ia32/cc4.0.1_os10.4.9 @@ -88,6 +90,7 @@ if (UNIX) set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include") set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") + set(_TBB_LIB_MALLOC_PROXY_NAME "${_TBB_LIB_NAME}malloc_proxy") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") # 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) if (TBB_OBVIOUS_PLACE) set (TBB_FOUND "YES") - set (TBB_LIBRARIES ${TEST_TBB_LIBRARY} ${TBB_LIBRARIES}) + find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME}) + find_library(TBB_MALLOC_PROXY_LIBRARY ${_TBB_LIB_MALLOC_PROXY_NAME} ${TBB_LIBRARY_DIR}) + set (TBB_LIBRARIES ${TEST_TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_MALLOC_PROXY_LIBRARY} ${TBB_LIBRARIES}) set (TBB_INCLUDE_DIRS ${TEST_TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE) mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES) - message(STATUS "Found Intel TBB") + message(STATUS "Found Intel TBB, includes ${TBB_INCLUDE_DIRS}, ${TBB_LIBRARIES}") elseif (NOT _TBB_INSTALL_DIR) message (FATAL_ERROR "ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}") else (TBB_OBVIOUS_PLACE) @@ -163,34 +168,37 @@ else (TBB_OBVIOUS_PLACE) if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") set (TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib") else (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") - # Undeprecated to allow for Windows use. + # Undeprecated to allow for Windows use. set (TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/lib/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}") endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") find_library(TBB_LIBRARY ${_TBB_LIB_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH) find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY) + find_library(TBB_MALLOC_PROXY_LIBRARY ${_TBB_LIB_MALLOC_PROXY_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH) + + mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY TBB_MALLOC_PROXY_LIBRARY) #-- Look for debug libraries find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH) find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH) mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG) + message(STATUS "Found obvious Intel TBB, includes ${TBB_INCLUDE_DIRS}, ${TBB_LIBRARIES}") if (TBB_INCLUDE_DIR) if (TBB_LIBRARY) set (TBB_FOUND "YES") if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - set(TBB_LIBRARIES optimized ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES} debug ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES}) + 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}) else() - set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES}) + set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_MALLOC_PROXY_LIBRARY} ${TBB_LIBRARIES}) set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES}) mark_as_advanced(TBB_DEBUG_LIBRARIES) endif() set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE) set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE) mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_LIBRARIES) - message(STATUS "Found Intel TBB") + message(STATUS "Found Intel TBB, includes ${TBB_INCLUDE_DIRS}, ${TBB_LIBRARIES}") endif (TBB_LIBRARY) endif (TBB_INCLUDE_DIR) diff --git a/src/xrCore/CMakeLists.txt b/src/xrCore/CMakeLists.txt index 7167b9aa7d7..2daf9276356 100644 --- a/src/xrCore/CMakeLists.txt +++ b/src/xrCore/CMakeLists.txt @@ -21,13 +21,12 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/pugixml/src #${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include ${SDL_INCLUDE_DIR} + ${TBB_INCLUDE_DIRS} ) add_definitions(-DXRCORE_EXPORTS) add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES}) set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") -#this is a temporary solution until find_package will not be fixed -set(TBB_LIBRARIES tbb tbbmalloc_proxy tbbmalloc) target_link_libraries(${PROJECT_NAME} xrMiscMath ${SDL_LIBRARIES} ${LZO_LIBRARIES} ${CRYPTO++_LIBRARIES} ${PUGIXML_LIBRARY} ${TBB_LIBRARIES}) diff --git a/src/xrEngine/CMakeLists.txt b/src/xrEngine/CMakeLists.txt index 4e1980baa67..e8e518e2279 100644 --- a/src/xrEngine/CMakeLists.txt +++ b/src/xrEngine/CMakeLists.txt @@ -12,6 +12,8 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include ${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/luabind ${SDL_INCLUDE_DIR} + ${FREEIMAGE_INCLUDE_PATH} + ${LOCKFILE_INCLUDE_DIR} ) list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./tntQAVI.cpp") @@ -29,4 +31,4 @@ add_definitions(-DENGINE_BUILD) add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES}) set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath luabind xrAPI xrSound xrScriptEngine ${LUA_LIBRARIES} theora ${OGG_LIBRARIES} xrCDB xrPhysics freeimage openal lockfile ${SDL_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath luabind xrAPI xrSound xrScriptEngine ${LUA_LIBRARIES} theora ${OGG_LIBRARIES} xrCDB xrPhysics ${FREEIMAGE_LIBRARY} openal ${LOCKFILE_LIBRARIES} ${SDL_LIBRARIES})