Browse Source

CMakeFindPackageMode: Honor CMAKE_SYSROOT to detect lib64 platforms

Add `CMAKE_SYSROOT` to check the full path on host OS. In a
non-crosscompiling use case, the call to `CMAKE_SYSROOT` is empty.

Fixes: #22608
Pablo Romero 4 years ago
parent
commit
8defe3380e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/CMakeFindPackageMode.cmake

+ 1 - 1
Modules/CMakeFindPackageMode.cmake

@@ -78,7 +78,7 @@ if(UNIX)
   # from the outside
   if(NOT CMAKE_SIZEOF_VOID_P)
     set(CMAKE_SIZEOF_VOID_P 4)
-    if(EXISTS /usr/lib64)
+    if(EXISTS ${CMAKE_SYSROOT}/usr/lib64)
       set(CMAKE_SIZEOF_VOID_P 8)
     else()
       # use the file utility to check whether itself is 64 bit: