diff options
author | Brad King <brad.king@kitware.com> | 2020-03-16 14:07:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-16 14:07:56 (GMT) |
commit | 9ad554a1fce78821358d61d8cd010f595b53c098 (patch) | |
tree | 3042fdb1f13095062d14231cf2b7df01a176eaf7 | |
parent | eb7e8d1529a569a5307653538a13b8c6e8fac9e1 (diff) | |
parent | ffa08d256fa0aaa52afcb05b50f4d4a485d84171 (diff) | |
download | CMake-9ad554a1fce78821358d61d8cd010f595b53c098.zip CMake-9ad554a1fce78821358d61d8cd010f595b53c098.tar.gz CMake-9ad554a1fce78821358d61d8cd010f595b53c098.tar.bz2 |
Merge topic 'FindRuby-typo'
ffa08d256f FindRuby: Fix compatibility with upper-case cache variables
50c97e1da0 FindRuby: Fix name of Ruby_LIBRARY variable
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4476
-rw-r--r-- | Modules/FindRuby.cmake | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 6918aed..5df242b 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -21,7 +21,7 @@ the following variables: full path to the ruby binary ``Ruby_INCLUDE_DIRS`` include dirs to be used when using the ruby library -``Ruby_LIBARY`` +``Ruby_LIBRARY`` full path to the ruby library ``Ruby_VERSION`` the version of ruby which was found, e.g. "1.8.7" @@ -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"@:>@)'` @@ -255,10 +271,10 @@ if(WIN32) "${_Ruby_ARCH_PREFIX}msvcrt-ruby${_Ruby_NODOT_VERSION}-static" ) endif() -find_library(Ruby_LIBARY NAMES ${_Ruby_POSSIBLE_LIB_NAMES} HINTS ${Ruby_POSSIBLE_LIB_DIR} ) +find_library(Ruby_LIBRARY NAMES ${_Ruby_POSSIBLE_LIB_NAMES} HINTS ${Ruby_POSSIBLE_LIB_DIR} ) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -set(_Ruby_REQUIRED_VARS Ruby_EXECUTABLE Ruby_INCLUDE_DIR Ruby_LIBARY) +set(_Ruby_REQUIRED_VARS Ruby_EXECUTABLE Ruby_INCLUDE_DIR Ruby_LIBRARY) if(_Ruby_VERSION_SHORT_NODOT GREATER 18) list(APPEND _Ruby_REQUIRED_VARS Ruby_CONFIG_INCLUDE_DIR) endif() @@ -273,7 +289,7 @@ if(_Ruby_DEBUG_OUTPUT) message(STATUS "Found Ruby_VERSION: \"${Ruby_VERSION}\" , short: \"${_Ruby_VERSION_SHORT}\", nodot: \"${_Ruby_VERSION_SHORT_NODOT}\"") message(STATUS "_Ruby_REQUIRED_VARS: ${_Ruby_REQUIRED_VARS}") message(STATUS "Ruby_EXECUTABLE: ${Ruby_EXECUTABLE}") - message(STATUS "Ruby_LIBARY: ${Ruby_LIBARY}") + message(STATUS "Ruby_LIBRARY: ${Ruby_LIBRARY}") message(STATUS "Ruby_INCLUDE_DIR: ${Ruby_INCLUDE_DIR}") message(STATUS "Ruby_CONFIG_INCLUDE_DIR: ${Ruby_CONFIG_INCLUDE_DIR}") message(STATUS "--------------------") @@ -284,7 +300,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_Ruby_REQUIRED_VARS} mark_as_advanced( Ruby_EXECUTABLE - Ruby_LIBARY + Ruby_LIBRARY Ruby_INCLUDE_DIR Ruby_CONFIG_INCLUDE_DIR ) |