Commit Graph

84 Commits

Author SHA1 Message Date
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
Julien Marrec
e672db628b FindRuby: Rename variables to match case of module name
Use recommended case for variable names, i.e. matching name of the
module as passed to `find_package`.

For backwards compatibility, the upper case versions of both input and
output variables are used and defined when appropriate.  Skip this for
the _FOUND variable because FPHSA already does it.

This follows the approach from commit a7b09e7f43 (FindProtobuf: Rename
variables to match case of module name, 2016-03-01, v3.6.0-rc1~273^2).

Issue: #20370
2020-03-11 13:56:10 -04:00
Kitware Robot
932dcce1e6 Modules: Consistently use 2 space indentation 2019-05-14 15:26:46 -04:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Brad King
cd2cdfe253 FindRuby: Add support for versions 2.2, 2.3, and 2.4
Author: J. Peter Mugaas (jpmugaas on gitlab.kitware.com)
Fixes: #17475
2017-11-16 07:05:00 -05:00
Brad King
23ab451a13 FindRuby: Fix match of '.' in version numbers
Escape `.` so that it is matched literally and not treated as a
special match of any character by the regex.
2017-11-16 07:02:26 -05:00
Brad King
9ab966a722 FindRuby: Use MSVC_VERSION instead of MSVC## 2017-03-23 08:40:35 -04:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Michael Smith
e5ef9271a1 FindRuby: Fix finding 64-bit Ruby on Windows
Ruby 2.0.0 and 2.1.5 have 64-bit binaries for Windows, with "x64-"
prefix.
2015-02-10 09:54:21 -05:00
Brad King
1720869a7e Merge topic 'FindRuby-fix-version'
802d0aa0 FindRuby: Fix output check in _RUBY_CONFIG_VAR
2015-01-15 09:53:52 -05:00
David Coppa
dd5d2eb156 FindRuby: fix selection of version x.0 (#15345)
When "Ruby_FIND_VERSION_MINOR" is 0, the "if(Ruby_FIND_VERSION_MAJOR AND
Ruby_FIND_VERSION_MINOR)" check evaluated to false.
2015-01-12 19:28:02 +01:00
Evangelos Foutras
802d0aa0b0 FindRuby: Fix output check in _RUBY_CONFIG_VAR
Since commit v2.8.8~173^2 (FindRuby: clean up querying variables from
Ruby, 2012-02-17) we query RbConfig::CONFIG first and, if the command
fails or its output equates to a false constant, then fall back to
querying Config::CONFIG.

Due to the above, an error condition exists with Ruby 2.2.0; when
querying RbConfig::CONFIG['TEENY'], the output of '0' will be discarded
since it matches the false constant '0'.

In previous versions this wasn't a problem, but Ruby 2.2 has completely
removed Config::CONFIG. This causes RUBY_VERSION_PATCH to be set to an
empty string and the Ruby version to be detected as '2.2.' (instead of
'2.2.0').

Fix the output check to explicitly look for an empty string before using
the fallback query method. (Someone more familiar with Ruby might be
able to deem the fallback as unnecessary and fully remove it.)
2015-01-11 14:49:51 -05:00