Browse Source

WriteBasicConfigVersionFile: Fix regression in ARCH_INDEPENDENT check

Refactoring in commit 77982de955 (CMakePackageConfigHelpers: only emit
arch check if needed, 2023-01-29, v3.26.0-rc1~16^2) did not correctly
preserve the check for empty `CMAKE_SIZEOF_VOID_P`.  Fix it.

The difference between the version files generated before and after is:

    -if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "")
    +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")

This restores the check generated before the above-mentioned commit.

Fixes: #24608
Brad King 2 years ago
parent
commit
6988ddf8ac
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/WriteBasicConfigVersionFile.cmake

+ 1 - 1
Modules/WriteBasicConfigVersionFile.cmake

@@ -49,7 +49,7 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
   if(NOT CVF_ARCH_INDEPENDENT)
     set(CVF_ARCH_INDEPENDENT_CHECK "
 # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
-if(CMAKE_SIZEOF_VOID_P STREQUAL \"\" OR \"${CMAKE_SIZEOF_VOID_P}\" STREQUAL \"\")
+if(\"\${CMAKE_SIZEOF_VOID_P}\" STREQUAL \"\" OR \"${CMAKE_SIZEOF_VOID_P}\" STREQUAL \"\")
   return()
 endif()