Browse Source

GNUInstallDirs: Make GNUInstallDirs_get_absolute_install_dir a function

Signed-off-by: Cristian Le <[email protected]>
Cristian Le 7 months ago
parent
commit
a7fcb1320c
1 changed files with 6 additions and 8 deletions
  1. 6 8
      Modules/GNUInstallDirs.cmake

+ 6 - 8
Modules/GNUInstallDirs.cmake

@@ -163,8 +163,8 @@ The following values of :variable:`CMAKE_INSTALL_PREFIX` are special:
 
 
 .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
 .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
 
 
-Macros
-^^^^^^
+Functions
+^^^^^^^^^
 
 
 .. command:: GNUInstallDirs_get_absolute_install_dir
 .. command:: GNUInstallDirs_get_absolute_install_dir
 
 
@@ -177,7 +177,7 @@ Macros
   Set the given variable ``absvar`` to the absolute path contained
   Set the given variable ``absvar`` to the absolute path contained
   within the variable ``var``.  This is to allow the computation of an
   within the variable ``var``.  This is to allow the computation of an
   absolute path, accounting for all the special cases documented
   absolute path, accounting for all the special cases documented
-  above.  While this macro is used to compute the various
+  above.  While this function is used to compute the various
   ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
   ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
   allow users who create additional path variables to also compute
   allow users who create additional path variables to also compute
   absolute paths where necessary, using the same logic.  ``dirname`` is
   absolute paths where necessary, using the same logic.  ``dirname`` is
@@ -529,7 +529,7 @@ mark_as_advanced(
   CMAKE_INSTALL_DOCDIR
   CMAKE_INSTALL_DOCDIR
   )
   )
 
 
-macro(GNUInstallDirs_get_absolute_install_dir absvar var)
+function(GNUInstallDirs_get_absolute_install_dir absvar var)
   set(GGAID_extra_args ${ARGN})
   set(GGAID_extra_args ${ARGN})
   list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
   list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
   if(GGAID_extra_arg_count GREATER "0")
   if(GGAID_extra_arg_count GREATER "0")
@@ -571,10 +571,8 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var)
     set(${absvar} "${${var}}")
     set(${absvar} "${${var}}")
   endif()
   endif()
 
 
-  unset(GGAID_dir)
-  unset(GGAID_extra_arg_count)
-  unset(GGAID_extra_args)
-endmacro()
+  return(PROPAGATE ${var} ${absvar})
+endfunction()
 
 
 # Result directories
 # Result directories
 #
 #