Pārlūkot izejas kodu

GNUInstallDirs: avoid unwanted variable dereference

In some situations, it seems that the variable `0` is defined. In the
case found, it was set to `1`. This makes the detection of the missing
third argument bogus and unnecessarily triggers a warning.

This oversight was introduced in 229b5ee994 (GNUInstallDirs: Add dir
argument to GNUInstallDirs_get_absolute_install_dir, 2020-10-31) prior
to CMake 3.20's release cycle.
Ben Boeckel 4 gadi atpakaļ
vecāks
revīzija
49a5dbcaff
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      Modules/GNUInstallDirs.cmake

+ 1 - 1
Modules/GNUInstallDirs.cmake

@@ -349,7 +349,7 @@ mark_as_advanced(
 macro(GNUInstallDirs_get_absolute_install_dir absvar var)
   set(GGAID_extra_args ${ARGN})
   list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
-  if(GGAID_extra_arg_count GREATER 0)
+  if(GGAID_extra_arg_count GREATER "0")
     list(GET GGAID_extra_args 0 GGAID_dir)
   else()
     # Historical behaviour: use ${dir} from caller's scope