Commit Graph

95 Commits

Author SHA1 Message Date
Charlie Savage
b4f2c7beab FindRuby: Hide interpreter query cache entries
Avoid exposing them to editing in `cmake-gui` or `ccmake`.
2025-12-11 09:22:06 -05:00
Charlie Savage
996a65a328 FindRuby: Add support for Brew on macOS
Brew is a common way to install Ruby on MacOS.  Search using paths
provided by the ruby interpreter.
2025-12-09 15:46:22 -05:00
Peter Kokot
0fedf1592c Find*: Update *_FOUND variables
This marks all `<PACKAGENAME>_FOUND` result variables as deprecated
where possible (for `<PackageName>` find modules) to make it clearer
which variable to use.

In CMake 3.3, the FindPackageHandleStandardArgs module was refactored to
set both `<PackageName>_FOUND` and uppercase `<PACKAGENAME>_FOUND`
result variables to the same values. Before that, the FOUND_VAR argument
could be used to set the result variable.

* FindMatlab: Uppercased MATLAB_FOUND is not mentioned as it was never
  documented.
* Documentation for FindPythonInterp and FindPythonLibs modules synced
  accordingly to their deprecation (3.12 instead of 4.2).
* OPENGL_FOUND: deprecation version synced with other find modules.
* DevIL_FOUND was introduced in CMake 3.8. The uppercased variant not
  mentioned as it was previously never documented.

Fixes: #27242
2025-09-23 21:40:58 +02:00
Peter Kokot
8510666702 FindRuby: Sync documentation
- Added intro code block showing how to use this module.
- Resorted result variables.
- Synced descriptions.
- Added separate examples section.
2025-08-06 00:37:13 +02:00
cfis
c972050ff5 FindRuby: Improve logic populating MSVC runtime alternatives
Ruby (mswin) links to vcruntime140, but future proof by using MSVC
toolset version.
2025-05-14 08:44:48 -04:00
cfis
cc4f7a73bd FindRuby: Improve order of library name alternatives
Prefer long versions over short versions.
Prefer dotted versions over no-dot versions.
2025-05-14 08:42:22 -04:00
cfis
e99cb9e35a FindRuby: The library name on Windows uses major.minor.0 format 2025-05-13 11:25:34 -04:00
cfis
d703443809 FindRuby: Improve formatting of list of possible library names 2025-05-05 09:50:14 -04:00
cfis
120192cde7 FindRuby: Fix typos in variable names 2025-05-05 09:48:44 -04:00
cfis
13da6bea6e FindRuby: Generalize name of runtime candidates variable 2025-05-05 09:47:22 -04:00
cfis
ae1ce9048a FindRuby: Name private version variables more consistently 2025-05-05 09:46:12 -04:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Charlie Savage
21a5ca5fc2 FindRuby: Update comments 2025-02-03 11:44:02 -05:00
Brad King
d65f522a50 Merge topic 'FindRuby-compat-vars'
2d86cf314f FindRuby: Drop upper-case RUBY_ results in favor of Ruby_ variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10273
2025-02-02 07:03:10 -05:00
Brad King
2d86cf314f FindRuby: Drop upper-case RUBY_ results in favor of Ruby_ variables
Add policy CMP0185 for compatibility.

Fixes: #26640
2025-02-01 07:12:30 -05:00
Charlie Savage
8d1f9e5408 FindRuby: Port debug output to message(DEBUG) 2025-01-31 09:07:19 -05:00
Brad King
7afa58b15d Modules/Find*: Include FindPackageHandleStandardArgs normally
Since commit d74210a8bd (CMP0017: Remove support for OLD behavior,
2024-11-17) we can rely on CMP0017's NEW behavior unconditionally.
Calling `include(FindPackageHandleStandardArgs)` in a builtin module
will always get the builtin `FindPackageHandleStandardArgs`.
2025-01-30 08:53:12 -05:00
Charlie Savage
64e4b4c638 FindRuby: Reformat code so it is consistent 2025-01-29 10:29:16 -08:00
Brad King
ec7cc80370 Merge topic 'patch-lower-case-style'
4e6a13f211 Use lower case style for commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !10245
2025-01-29 11:37:51 -05:00
Peter Kokot
4e6a13f211 Use lower case style for commands
Where possible this syncs the CS for command names:

- check_c_source_compiles()
- check_cxx_compiler_flag()
- check_cxx_source_compiles()
- check_cxx_symbol_exists()
- check_include_file_cxx()
- check_include_file()
- check_include_files()
- check_library_exists()
- check_source_compiles()
- check_struct_has_member()
- check_symbol_exists()
- check_type_size()
- cmake_dependent_option()
- cmake_parse_arguments()
- feature_summary()
- file()
- find_package_handle_standard_args()
- if(), endif...
- install(FILES)
- list()
- message()
- pkg_check_modules()
- select_library_configurations()
- set_package_info()
- test_big_endian()
2025-01-28 13:51:46 -05:00
cfis
ef2c3ca828 FindRuby: Add rbenv support 2025-01-27 20:36:06 -05:00
Charlie Savage
61c3718a00 FindRuby: Use find_program VALIDATOR
Avoid caching an unsuitable version of `Ruby_EXECUTABLE`.
2025-01-17 18:02:34 -05:00
Charlie Savage
e891159657 FindRuby: Clarify search process comments and conditions 2025-01-17 17:05:47 -05:00
Charlie Savage
9f0b3e90b6 FindRuby: Remove unused variable 2025-01-17 17:05:47 -05:00
Brad King
e184dda2da FindRuby: Query Ruby_EXECUTABLE again if it changes 2025-01-17 17:05:47 -05:00
cfis
a023377b86 FindRuby: Move checking of RVM and System Ruby to separate functions. 2024-12-04 13:21:04 -08:00
cfis
48bf16fba1 FindRuby: Remove unneeded code and define all functions at the top-level. 2024-12-03 12:12:59 -08:00
cfis
21e51dca1d FindRuby: Add support for 3.4 2024-12-02 13:25:54 -05:00
Charlie Savage
c2bf3e46fa FindRuby: Fix finding Ruby 3.1+ on Windows
It switched to the UCRT C runtime.
2024-03-05 08:47:59 -05:00
Charlie Savage
867550db43 FindRuby: Add support for 3.3 2024-03-05 08:46:29 -05:00
Heiko Becker
77ed529c22 FindRuby: Add support for 3.2 2023-10-10 09:25:05 -04:00
Hannes Braun
0d7f40a5c4 FindRuby: Remove documentation for non-existent Ruby_ROOT_DIR
Documentation was added by commit 905d5667e8 (FindRuby: Add support for
RVM installations, 2020-03-23, v3.18.0-rc1~497^2), but this feature was
never implemented.

Closes: #21528
2022-11-28 10:35:00 -05:00
Diego Pino Garcia
abe8192d82 FindRuby: Simplify version matching 2022-06-30 09:51:15 +08:00
Mihai Moldovan
6b6bc7791d FindRuby: evict non-matching binaries and keep scanning.
The possible executable names list always starts with a plain "ruby"
binary, which is scanned for first. If that does exist (which satisfies
find_program), but doesn't match the requested version, the executable
will be dismissed by _RUBY_VALIDATE_INTERPRETER (which is sane), but
searching also stops.

Fix that by keeping the search going, removing items from the list as we
go, until find_program returns a path that _RUBY_VALIDATE_INTERPRETER is
happy with or the list is empty.
2022-01-31 05:57:42 +01:00
Mihai Moldovan
42d99a248e FindRuby: add support for versions up to 3.1. 2022-01-31 05:51:36 +01:00
Pedro Luis Castedo Cepeda
238c2b6cb7 FindRuby: Consider ruby names with full nodot version suffixes 2021-03-25 15:30:09 -04:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Silvio Traversaro
d4a16427e2 FindRuby: Consider more VS runtime suffix combinations
These are needed to find recent Ruby versions for builds using
recent VS versions.

Fixes: #21066
2020-11-11 08:30:42 -05:00
Brad King
4c0ef57e8c FindRuby: Restore compatibility variable RUBY_VENDORLIB_DIR
Since commit e672db628b (FindRuby: Rename variables to match case of
module name, 2020-03-11, v3.18.0-rc1~546^2), the result variables named
with the old `RUBY_` prefix are provided by compatibility code that maps
from the new `Ruby_` prefix variables.  This variable was accidentally
left out.

Fixes: #21369
2020-10-27 12:18:05 -04:00
Daniele E. Domenichelli
e7fe0b24c4 FindRuby: Add documentation for deprecated variables
Since commit e672db628b (FindRuby: Rename variables to match case of
module name, 2020-03-11, v3.18.0-rc1~546^2), the upper-case-prefixed
variable names are for compatibility only but still exist.  Put them
back in the documentation.

Issue: #21064
2020-08-12 11:25:45 -04:00
Brad King
6959744131 FindRuby: Restore compatibility variable RUBY_INCLUDE_PATH
Since commit e672db628b (FindRuby: Rename variables to match case of
module name, 2020-03-11, v3.18.0-rc1~546^2), the result variables named
with the old `RUBY_` prefix are provided by compatibility code that maps
from the new `Ruby_` prefix variables.  There is no `Ruby_INCLUDE_PATH`
variable, so do not try to map it to `RUBY_INCLUDE_PATH`.  The latter is
provided by dedicated compatibility code left from before that
transition.

Fixes: #21064
2020-08-07 12:40:26 -04:00
Julien Marrec
905d5667e8 FindRuby: Add support for RVM installations 2020-03-23 13:22:23 +01:00
Julien Marrec
e6699b9b59 FindRuby: Validate Ruby_EXECUTABLE before accepting it 2020-03-23 13:21:40 +01:00
Julien Marrec
46064c8193 FindRuby: Add support for versions up to 2.7
Fixes: #20370
2020-03-17 08:43:10 -04:00
Brad King
675eaf3bd0 FindRuby: Update MSVC runtime library selection
Use the `MSVC_TOOLSET_VERSION` variable computed by CMake to get the
matching Ruby library name component.

Inspired-by: Julien Marrec <julien.marrec@gmail.com>
2020-03-17 08:39:06 -04:00
Julien Marrec
b970e25d98 FindRuby: Remove extra whitespace 2020-03-16 14:07:30 -04:00
Brad King
ecdace4d61 FindRuby: Include FPHSA closer to where it is used 2020-03-16 14:07:30 -04:00
Brad King
f52f496138 FindRuby: Provide Ruby_LIBRARIES result variable
The `cmake-developer(7)` manual documents that a plural non-cached
name should be used for results.
2020-03-16 14:05:26 -04:00
Brad King
ffa08d256f 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.
2020-03-13 14:13:17 -04:00
Brad King
50c97e1da0 FindRuby: Fix name of Ruby_LIBRARY variable
Fix a typo in the variable name caused by commit e672db628b (FindRuby:
Rename variables to match case of module name, 2020-03-11).
2020-03-13 13:59:17 -04:00