Fix LAPACK finding CMake code
authorVictor Westerhuis <VJ.Westerhuis@student.han.nl>
Fri, 9 Sep 2022 12:01:42 +0000 (14:01 +0200)
committerSantiago Vila <sanvila@debian.org>
Thu, 15 Aug 2024 17:00:00 +0000 (19:00 +0200)
On Debian cblas.h and lapacke.h are not installed in the same include
directory. This does not matter when compiling, but the custom header
check in OpenCV fails on it. Force OpenCV to use the standard CMake
check_include_file function to do the check so it succeeds.

Gbp-Pq: Name 0006-Fix-LAPACK-finding-CMake-code.patch

cmake/OpenCVFindLAPACK.cmake

index 9b1b60f19ec3b32f9bfbad88fab4847e45d8917c..f51479b8e179fd6e6752b613d37b9d4c2126596b 100644 (file)
@@ -1,22 +1,11 @@
 macro(_find_header_file_in_dirs VAR NAME)
   unset(${VAR})
   unset(${VAR} CACHE)
-  if(" ${ARGN}" STREQUAL " ")
-    check_include_file("${NAME}" HAVE_${VAR})
-    if(HAVE_${VAR})
-      set(${VAR} "${NAME}") # fallback
-    else()
-      set(${VAR} "")
-    endif()
+  check_include_file("${NAME}" HAVE_${VAR})
+  if(HAVE_${VAR})
+    set(${VAR} "${NAME}") # fallback
   else()
-    find_path(${VAR} "${NAME}" ${ARGN} NO_DEFAULT_PATH)
-    if(${VAR})
-      set(${VAR} "${${VAR}}/${NAME}")
-      unset(${VAR} CACHE)
-    else()
-      unset(${VAR} CACHE)
-      set(${VAR} "")
-    endif()
+    set(${VAR} "")
   endif()
 endmacro()