-
Notifications
You must be signed in to change notification settings - Fork 63
/
FindRuby.cmake
428 lines (370 loc) · 15.3 KB
/
FindRuby.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# Fixes for Windows. Hopefully this file can be deleted depending on the outcome
# of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9309
# 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"@:>@)'`
# Ruby_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
# Ruby_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
# uncomment the following line to get debug output for this file
# set(_Ruby_DEBUG_OUTPUT TRUE)
# Determine the list of possible names of the ruby executable depending
# on which version of ruby is required
set(_Ruby_POSSIBLE_EXECUTABLE_NAMES ruby)
# If not specified, allow everything as far back as 1.8.0
if(NOT DEFINED Ruby_FIND_VERSION_MAJOR)
set(Ruby_FIND_VERSION "1.8.0")
set(Ruby_FIND_VERSION_MAJOR 1)
set(Ruby_FIND_VERSION_MINOR 8)
set(Ruby_FIND_VERSION_PATCH 0)
endif()
if(_Ruby_DEBUG_OUTPUT)
message("Ruby_FIND_VERSION=${Ruby_FIND_VERSION}")
message("Ruby_FIND_VERSION_MAJOR=${Ruby_FIND_VERSION_MAJOR}")
message("Ruby_FIND_VERSION_MINOR=${Ruby_FIND_VERSION_MINOR}")
message("Ruby_FIND_VERSION_PATCH=${Ruby_FIND_VERSION_PATCH}")
endif()
set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${Ruby_FIND_VERSION_MINOR}")
# Set name of possible executables, ignoring the minor
# Eg:
# 2.1.1 => from ruby33 to ruby21 included
# 2.1 => from ruby33 to ruby21 included
# 2 => from ruby33 to ruby20 included
# empty => from ruby33 to ruby18 included
if(NOT Ruby_FIND_VERSION_EXACT)
foreach(_ruby_version RANGE 33 18 -1)
string(SUBSTRING "${_ruby_version}" 0 1 _ruby_major_version)
string(SUBSTRING "${_ruby_version}" 1 1 _ruby_minor_version)
if(NOT "${_ruby_major_version}${_ruby_minor_version}" VERSION_LESS ${Ruby_FIND_VERSION_SHORT_NODOT})
# Append both rubyX.Y and rubyXY (eg: ruby2.7 ruby27)
list(APPEND _Ruby_POSSIBLE_EXECUTABLE_NAMES ruby${_ruby_major_version}.${_ruby_minor_version} ruby${_ruby_major_version}${_ruby_minor_version})
else()
break()
endif()
endforeach()
list(REMOVE_DUPLICATES _Ruby_POSSIBLE_EXECUTABLE_NAMES)
endif()
# virtual environments handling (eg RVM)
if (DEFINED ENV{MY_RUBY_HOME})
if(_Ruby_DEBUG_OUTPUT)
message("My ruby home is defined: $ENV{MY_RUBY_HOME}")
endif()
if (DEFINED Ruby_FIND_VIRTUALENV)
if (NOT Ruby_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY|STANDARD)$")
message (AUTHOR_WARNING "FindRuby: ${Ruby_FIND_VIRTUALENV}: invalid value for 'Ruby_FIND_VIRTUALENV'. 'FIRST', 'ONLY' or 'STANDARD' expected. 'FIRST' will be used instead.")
set (_Ruby_FIND_VIRTUALENV "FIRST")
else()
set (_Ruby_FIND_VIRTUALENV ${Ruby_FIND_VIRTUALENV})
endif()
else()
set (_Ruby_FIND_VIRTUALENV FIRST)
endif()
else()
if (DEFINED Ruby_FIND_VIRTUALENV)
message("Environment variable MY_RUBY_HOME isn't set, defaulting back to Ruby_FIND_VIRTUALENV=STANDARD")
endif()
set (_Ruby_FIND_VIRTUALENV STANDARD)
endif()
if(_Ruby_DEBUG_OUTPUT)
message("_Ruby_POSSIBLE_EXECUTABLE_NAMES=${_Ruby_POSSIBLE_EXECUTABLE_NAMES}")
message("_Ruby_FIND_VIRTUALENV=${_Ruby_FIND_VIRTUALENV}")
endif()
function (_RUBY_VALIDATE_INTERPRETER)
if (NOT Ruby_EXECUTABLE)
return()
endif()
cmake_parse_arguments (PARSE_ARGV 0 _RVI "EXACT;CHECK_EXISTS" "" "")
if (_RVI_UNPARSED_ARGUMENTS)
set (expected_version ${_RVI_UNPARSED_ARGUMENTS})
else()
unset (expected_version)
endif()
if (_RVI_CHECK_EXISTS AND NOT EXISTS "${Ruby_EXECUTABLE}")
# interpreter does not exist anymore
set (_Ruby_Interpreter_REASON_FAILURE "Cannot find the interpreter \"${Ruby_EXECUTABLE}\"")
set_property (CACHE Ruby_EXECUTABLE PROPERTY VALUE "Ruby_EXECUTABLE-NOTFOUND")
return()
endif()
# Check the version it returns
# executable found must have a specific version
execute_process (COMMAND "${Ruby_EXECUTABLE}" -e "puts RUBY_VERSION"
RESULT_VARIABLE result
OUTPUT_VARIABLE version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (result OR (_RVI_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version))
# interpreter not usable or has wrong major version
if (result)
set (_Ruby_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${Ruby_EXECUTABLE}\"")
else()
set (_Ruby_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${Ruby_EXECUTABLE}\"")
endif()
set_property (CACHE Ruby_EXECUTABLE PROPERTY VALUE "Ruby_EXECUTABLE-NOTFOUND")
return()
endif()
endfunction()
while(1)
# Virtual environments handling
if(_Ruby_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$")
if(_Ruby_DEBUG_OUTPUT)
message("Inside Matches")
endif()
find_program (Ruby_EXECUTABLE
NAMES ${_Ruby_POSSIBLE_EXECUTABLE_NAMES}
NAMES_PER_DIR
PATHS ENV MY_RUBY_HOME
PATH_SUFFIXES bin Scripts
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
if(_Ruby_DEBUG_OUTPUT)
message("Ruby_EXECUTABLE=${Ruby_EXECUTABLE}")
endif()
_RUBY_VALIDATE_INTERPRETER (${Ruby_FIND_VERSION}})
if(Ruby_EXECUTABLE)
break()
endif()
if(NOT _Ruby_FIND_VIRTUALENV STREQUAL "ONLY")
break()
endif()
elseif(_Ruby_DEBUG_OUTPUT)
message("_Ruby_FIND_VIRTUALENV doesn't match: ${_Ruby_FIND_VIRTUALENV}")
endif()
# try using standard paths
find_program (Ruby_EXECUTABLE
NAMES ${_Ruby_POSSIBLE_EXECUTABLE_NAMES}
NAMES_PER_DIR)
_RUBY_VALIDATE_INTERPRETER (${Ruby_FIND_VERSION})
if (Ruby_EXECUTABLE)
break()
else()
# Remove first entry from names list.
LIST(REMOVE_AT _Ruby_POSSIBLE_EXECUTABLE_NAMES 0)
# If the list is now empty, abort.
if (NOT _Ruby_POSSIBLE_EXECUTABLE_NAMES)
break()
else()
# Otherwise, continue with the remaining list. Make sure that we clear
# the cached variable.
unset(Ruby_EXECUTABLE CACHE)
endif()
endif()
endwhile()
if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_MAJOR)
function(_RUBY_CONFIG_VAR RBVAR OUTVAR)
execute_process(COMMAND ${Ruby_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
RESULT_VARIABLE _Ruby_SUCCESS
OUTPUT_VARIABLE _Ruby_OUTPUT
ERROR_QUIET)
if(_Ruby_SUCCESS OR _Ruby_OUTPUT STREQUAL "")
execute_process(COMMAND ${Ruby_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
RESULT_VARIABLE _Ruby_SUCCESS
OUTPUT_VARIABLE _Ruby_OUTPUT
ERROR_QUIET)
endif()
set(${OUTVAR} "${_Ruby_OUTPUT}" PARENT_SCOPE)
endfunction()
# query the ruby version
_RUBY_CONFIG_VAR("MAJOR" Ruby_VERSION_MAJOR)
_RUBY_CONFIG_VAR("MINOR" Ruby_VERSION_MINOR)
_RUBY_CONFIG_VAR("TEENY" Ruby_VERSION_PATCH)
# query the different directories
_RUBY_CONFIG_VAR("archdir" Ruby_ARCH_DIR)
_RUBY_CONFIG_VAR("arch" Ruby_ARCH)
_RUBY_CONFIG_VAR("rubyhdrdir" Ruby_HDR_DIR)
_RUBY_CONFIG_VAR("rubyarchhdrdir" Ruby_ARCHHDR_DIR)
_RUBY_CONFIG_VAR("libdir" Ruby_POSSIBLE_LIB_DIR)
_RUBY_CONFIG_VAR("rubylibdir" Ruby_RUBY_LIB_DIR)
# site_ruby
_RUBY_CONFIG_VAR("sitearchdir" Ruby_SITEARCH_DIR)
_RUBY_CONFIG_VAR("sitelibdir" Ruby_SITELIB_DIR)
# vendor_ruby available ?
execute_process(COMMAND ${Ruby_EXECUTABLE} -r vendor-specific -e "print 'true'"
OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET)
if(Ruby_HAS_VENDOR_RUBY)
_RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR)
_RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR)
endif()
# save the results in the cache so we don't have to run ruby the next time again
set(Ruby_VERSION_MAJOR ${Ruby_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
set(Ruby_VERSION_MINOR ${Ruby_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
set(Ruby_VERSION_PATCH ${Ruby_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
set(Ruby_ARCH_DIR ${Ruby_ARCH_DIR} CACHE PATH "The Ruby arch dir" FORCE)
set(Ruby_HDR_DIR ${Ruby_HDR_DIR} CACHE PATH "The Ruby header dir (1.9+)" FORCE)
set(Ruby_ARCHHDR_DIR ${Ruby_ARCHHDR_DIR} CACHE PATH "The Ruby arch header dir (2.0+)" FORCE)
set(Ruby_POSSIBLE_LIB_DIR ${Ruby_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
set(Ruby_RUBY_LIB_DIR ${Ruby_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE)
set(Ruby_SITEARCH_DIR ${Ruby_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE)
set(Ruby_SITELIB_DIR ${Ruby_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE)
set(Ruby_HAS_VENDOR_RUBY ${Ruby_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE)
set(Ruby_VENDORARCH_DIR ${Ruby_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE)
set(Ruby_VENDORLIB_DIR ${Ruby_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE)
mark_as_advanced(
Ruby_ARCH_DIR
Ruby_ARCH
Ruby_HDR_DIR
Ruby_ARCHHDR_DIR
Ruby_POSSIBLE_LIB_DIR
Ruby_RUBY_LIB_DIR
Ruby_SITEARCH_DIR
Ruby_SITELIB_DIR
Ruby_HAS_VENDOR_RUBY
Ruby_VENDORARCH_DIR
Ruby_VENDORLIB_DIR
Ruby_VERSION_MAJOR
Ruby_VERSION_MINOR
Ruby_VERSION_PATCH
)
endif()
# In case Ruby_EXECUTABLE could not be executed (e.g. cross compiling)
# try to detect which version we found. This is not too good.
if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_MAJOR)
# by default assume 1.8.0
set(Ruby_VERSION_MAJOR 1)
set(Ruby_VERSION_MINOR 8)
set(Ruby_VERSION_PATCH 0)
# check whether we found 1.9.x
if(${Ruby_EXECUTABLE} MATCHES "ruby1\\.?9")
set(Ruby_VERSION_MAJOR 1)
set(Ruby_VERSION_MINOR 9)
endif()
# check whether we found 2.[0-7].x
if(${Ruby_EXECUTABLE} MATCHES "ruby2")
set(Ruby_VERSION_MAJOR 2)
string(REGEX_REPLACE ${Ruby_EXECUTABLE} "ruby2\\.?([0-7])" "\\1" Ruby_VERSION_MINOR)
endif()
# check whether we found 3.[0-1].x
if(${Ruby_EXECUTABLE} MATCHES "ruby3")
set(Ruby_VERSION_MAJOR 3)
string(REGEX_REPLACE ${Ruby_EXECUTABLE} "ruby3\\.?([0-1])" "\\1" Ruby_VERSION_MINOR)
endif()
endif()
if(Ruby_VERSION_MAJOR)
set(Ruby_VERSION "${Ruby_VERSION_MAJOR}.${Ruby_VERSION_MINOR}.${Ruby_VERSION_PATCH}")
set(_Ruby_VERSION_SHORT "${Ruby_VERSION_MAJOR}.${Ruby_VERSION_MINOR}")
set(_Ruby_VERSION_SHORT_NODOT "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}")
set(_Ruby_NODOT_VERSION "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}${Ruby_VERSION_PATCH}")
set(_Ruby_NODOT_VERSION_ZERO_PATCH "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}0")
endif()
# FIXME: Currently we require both the interpreter and development components to be found
# in order to use either. See issue #20474.
find_path(Ruby_INCLUDE_DIR
NAMES ruby.h
HINTS
${Ruby_HDR_DIR}
${Ruby_ARCH_DIR}
/usr/lib/ruby/${_Ruby_VERSION_SHORT}/i586-linux-gnu/
)
set(Ruby_INCLUDE_DIRS ${Ruby_INCLUDE_DIR})
# if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir
if( Ruby_FIND_VERSION VERSION_GREATER_EQUAL "1.9" OR Ruby_VERSION VERSION_GREATER_EQUAL "1.9" OR Ruby_HDR_DIR)
find_path(Ruby_CONFIG_INCLUDE_DIR
NAMES ruby/config.h config.h
HINTS
${Ruby_HDR_DIR}/${Ruby_ARCH}
${Ruby_ARCH_DIR}
${Ruby_ARCHHDR_DIR}
)
set(Ruby_INCLUDE_DIRS ${Ruby_INCLUDE_DIRS} ${Ruby_CONFIG_INCLUDE_DIR} )
endif()
# Determine the list of possible names for the ruby library
set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby${_Ruby_NODOT_VERSION} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION})
if(WIN32)
set(_Ruby_POSSIBLE_MSVC_RUNTIMES "ucrt;msvcrt;vcruntime140;vcruntime140_1")
if(MSVC_TOOLSET_VERSION)
list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr${MSVC_TOOLSET_VERSION}")
else()
list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr")
endif()
set(_Ruby_POSSIBLE_VERSION_SUFFICES "${_Ruby_NODOT_VERSION};${_Ruby_NODOT_VERSION_ZERO_PATCH}")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_Ruby_POSSIBLE_ARCH_PREFIXS "libx64-;x64-")
else()
set(_Ruby_POSSIBLE_ARCH_PREFIXS "lib")
endif()
foreach(_Ruby_MSVC_RUNTIME ${_Ruby_POSSIBLE_MSVC_RUNTIMES})
foreach(_Ruby_VERSION_SUFFIX ${_Ruby_POSSIBLE_VERSION_SUFFICES})
foreach(_Ruby_ARCH_PREFIX ${_Ruby_POSSIBLE_ARCH_PREFIXS})
list(APPEND _Ruby_POSSIBLE_LIB_NAMES
"${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}"
"${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}-static")
endforeach()
endforeach()
endforeach()
endif()
find_library(Ruby_LIBRARY NAMES ${_Ruby_POSSIBLE_LIB_NAMES} HINTS ${Ruby_POSSIBLE_LIB_DIR} )
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()
if(_Ruby_DEBUG_OUTPUT)
message(STATUS "--------FindRuby.cmake debug------------")
message(STATUS "_Ruby_POSSIBLE_EXECUTABLE_NAMES: ${_Ruby_POSSIBLE_EXECUTABLE_NAMES}")
message(STATUS "_Ruby_POSSIBLE_LIB_NAMES: ${_Ruby_POSSIBLE_LIB_NAMES}")
message(STATUS "Ruby_ARCH_DIR: ${Ruby_ARCH_DIR}")
message(STATUS "Ruby_HDR_DIR: ${Ruby_HDR_DIR}")
message(STATUS "Ruby_POSSIBLE_LIB_DIR: ${Ruby_POSSIBLE_LIB_DIR}")
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_LIBRARY: ${Ruby_LIBRARY}")
message(STATUS "Ruby_INCLUDE_DIR: ${Ruby_INCLUDE_DIR}")
message(STATUS "Ruby_CONFIG_INCLUDE_DIR: ${Ruby_CONFIG_INCLUDE_DIR}")
message(STATUS "--------------------")
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_Ruby_REQUIRED_VARS}
VERSION_VAR Ruby_VERSION )
if(Ruby_FOUND)
set(Ruby_LIBRARIES ${Ruby_LIBRARY})
endif()
mark_as_advanced(
Ruby_EXECUTABLE
Ruby_LIBRARY
Ruby_INCLUDE_DIR
Ruby_CONFIG_INCLUDE_DIR
)
# Set some variables for compatibility with previous version of this file (no need to provide a CamelCase version of that...)
set(RUBY_POSSIBLE_LIB_PATH ${Ruby_POSSIBLE_LIB_DIR})
set(RUBY_RUBY_LIB_PATH ${Ruby_RUBY_LIB_DIR})
set(RUBY_INCLUDE_PATH ${Ruby_INCLUDE_DIRS})
# Backwards compatibility
# Define upper case versions of output variables
foreach(Camel
Ruby_EXECUTABLE
Ruby_INCLUDE_DIRS
Ruby_LIBRARY
Ruby_VERSION
Ruby_VERSION_MAJOR
Ruby_VERSION_MINOR
Ruby_VERSION_PATCH
Ruby_ARCH_DIR
Ruby_ARCH
Ruby_HDR_DIR
Ruby_ARCHHDR_DIR
Ruby_POSSIBLE_LIB_DIR
Ruby_RUBY_LIB_DIR
Ruby_SITEARCH_DIR
Ruby_SITELIB_DIR
Ruby_HAS_VENDOR_RUBY
Ruby_VENDORARCH_DIR
Ruby_VENDORLIB_DIR
)
string(TOUPPER ${Camel} UPPER)
set(${UPPER} ${${Camel}})
endforeach()