Add OpenVDB to dependencies

* Add Linux openvdb integration
* Add Mac openvdb integration and enable in ALL
* Create openvdb sandbox to test integration.
* Additional fixes in the patches
* Remove slabasebed sandbox as it has no relevance now
* Provide FindOpenVDB module and fix build issues
This commit is contained in:
tamasmeszaros 2019-10-25 13:09:25 +02:00
parent a7c843d213
commit 4554da29ab
20 changed files with 3199 additions and 275 deletions

View file

@ -93,8 +93,16 @@
# This module will also create the "tbb" target that may be used when building
# executables and libraries.
unset(TBB_FOUND CACHE)
unset(TBB_INCLUDE_DIRS CACHE)
unset(TBB_LIBRARIES)
unset(TBB_LIBRARIES_DEBUG)
unset(TBB_LIBRARIES_RELEASE)
include(FindPackageHandleStandardArgs)
find_package(Threads QUIET REQUIRED)
if(NOT TBB_FOUND)
##################################
@ -215,6 +223,9 @@ if(NOT TBB_FOUND)
foreach(_comp ${TBB_SEARCH_COMPOMPONENTS})
if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")
unset(TBB_${_comp}_LIBRARY_DEBUG CACHE)
unset(TBB_${_comp}_LIBRARY_RELEASE CACHE)
# Search for the libraries
find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}${TBB_STATIC_SUFFIX}
HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
@ -261,6 +272,7 @@ if(NOT TBB_FOUND)
set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
endif()
set(TBB_DEFINITIONS "")
if (MSVC AND TBB_STATIC)
set(TBB_DEFINITIONS __TBB_NO_IMPLICIT_LINKAGE)
endif ()
@ -269,6 +281,7 @@ if(NOT TBB_FOUND)
find_package_handle_standard_args(TBB
REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES
FAIL_MESSAGE "TBB library cannot be found. Consider set TBBROOT environment variable."
HANDLE_COMPONENTS
VERSION_VAR TBB_VERSION)
@ -279,6 +292,8 @@ if(NOT TBB_FOUND)
if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
add_library(TBB::tbb UNKNOWN IMPORTED)
set_target_properties(TBB::tbb PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS}"
INTERFACE_LINK_LIBRARIES "Threads::Threads;${CMAKE_DL_LIBS}"
INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}
IMPORTED_LOCATION ${TBB_LIBRARIES})
if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG)
@ -290,11 +305,6 @@ if(NOT TBB_FOUND)
IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE}
)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Threads QUIET REQUIRED)
set_target_properties(TBB::tbb PROPERTIES INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS};Threads::Threads")
endif()
endif()
mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES)