FindRuby: fix usage of RUBY_VERSION_MAJOR (#12172)

Alex
This commit is contained in:
Alex Neundorf 2012-01-05 21:53:02 +01:00
parent a823d88149
commit 93c55ec142
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ ENDIF("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION)
IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# query the ruby version
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MAJOR']"
OUTPUT_VARIABLE RUBY_VERSION_MAJOR)
@ -135,7 +135,7 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION)
RUBY_VERSION_MINOR
RUBY_VERSION_PATCH
)
ENDIF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION)
ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling)
# try to detect which version we found. This is not too good.