Skip to content

Halide integration doesn't work with recent versions (10+) #20353

@alexreinking

Description

@alexreinking

OpenCVDetectHalide.cmake assumes variables are set by the Halide CMake package that it does not (has never?).

if(NOT HAVE_HALIDE)
find_package(Halide QUIET) # Try CMake-based config files
if(Halide_FOUND)
set(HALIDE_INCLUDE_DIRS "${Halide_INCLUDE_DIRS}" CACHE PATH "Halide include directories" FORCE)
set(HALIDE_LIBRARIES "${Halide_LIBRARIES}" CACHE PATH "Halide libraries" FORCE)
set(HAVE_HALIDE TRUE)
endif()
endif()

As a result, attempting to build against a recent version of Halide incorrectly succeeds during configuration only to fail to find Halide.h during the build.

Locally, I found that replacing the contents of cmake/OpenCVDetectHalide.cmake with the following works at least as far as the build succeeding:

find_package(Halide REQUIRED)

set(HAVE_HALIDE TRUE)
set(HALIDE_LIBRARIES Halide::Halide)
list(APPEND OPENCV_LINKER_LIBS ${HALIDE_LIBRARIES})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions