message: Build OpenImageDenoise only if TBB is available.
diff: @@ -67,8 +67,17 @@ endif()
  find_package(embree 3.0 QUIET PATHS /usr/lib64/cmake)
  if (embree_FOUND AND NOT ANDROID)
  message("Found embree in ${embree_DIR}")
  + set(MKLDNN_THREADING "TBB")
  + include(third_party/OpenImageDenoise/mkl-dnn/cmake/Threading.cmake)
  + include(third_party/OpenImageDenoise/mkl-dnn/cmake/TBB.cmake)
  + find_package(TBB QUIET)
  + if (TBB_FOUND AND "${TBB_VERSION_MAJOR}" VERSION_EQUAL 2019)
  + message("Found TBB ${TBB_VERSION}")
  add_definitions(-DFILAMENT_HAS_EMBREE)
  set(DENOISE_LIBRARY OpenImageDenoise)
  + else()
  + message("TBB 2019 not found.")
  + endif()
  else()
  message("Embree not found, pipeline features are disabled.")
  endif()
  @@ -421,8 +430,6 @@ if (NOT ANDROID AND NOT WEBGL AND NOT IOS)
  add_subdirectory(${EXTERNAL}/libz/tnt)
  add_subdirectory(${EXTERNAL}/skylight/tnt)
  add_subdirectory(${EXTERNAL}/tinyexr/tnt)
  - add_subdirectory(${EXTERNAL}/OpenImageDenoise)
  -
  add_subdirectory(${TOOLS}/cmgen)
  add_subdirectory(${TOOLS}/filamesh)
  add_subdirectory(${TOOLS}/glslminifier)
  @@ -436,6 +443,10 @@ if (NOT ANDROID AND NOT WEBGL AND NOT IOS)
  add_subdirectory(${TOOLS}/specular-color)
  endif()
  +if (DENOISE_LIBRARY)
  + add_subdirectory(${EXTERNAL}/OpenImageDenoise)
  +endif()
  +
  # Generate exported executables for cross-compiled builds (Android, WebGL, and iOS)
  if (NOT CMAKE_CROSSCOMPILING)
  export(TARGETS matc cmgen filamesh mipgen resgen glslminifier FILE ${IMPORT_EXECUTABLES})
  