mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 10:20:56 -06:00
FindRuby: Fix compatibility with upper-case cache variables
In commit e672db628b (FindRuby: Rename variables to match case of module
name, 2020-03-11) compatibility was provided for result variables but
not for the cache entries that scripts might set.
This commit is contained in:
@@ -34,6 +34,22 @@ Also:
|
||||
same as Ruby_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
|
||||
#]=======================================================================]
|
||||
|
||||
# Backwards compatibility
|
||||
# Define camel case versions of input variables
|
||||
foreach(UPPER
|
||||
RUBY_EXECUTABLE
|
||||
RUBY_LIBRARY
|
||||
RUBY_INCLUDE_DIR
|
||||
RUBY_CONFIG_INCLUDE_DIR
|
||||
)
|
||||
if (DEFINED ${UPPER})
|
||||
string(REPLACE "RUBY_" "Ruby_" Camel ${UPPER})
|
||||
if (NOT DEFINED ${Camel})
|
||||
set(${Camel} ${${UPPER}})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Ruby_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
|
||||
# Ruby_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
|
||||
# Ruby_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
|
||||
|
||||
Reference in New Issue
Block a user