Commit Graph

97 Commits

Author SHA1 Message Date
Nikita Nemkin
9890cfc4ec Help: More syntax highlighting for literal blocks
Covers almost all blocks containing actual code, except:

* Parsed-literal blocks can't be highlighted, including many command
  summaries and substitution-heavy docs like find_... commands.
  This is a Sphinx limitation.

* Code with errors, like CMP0049, DEPLOYMENT_ADDITIONAL_FILES,
  DEPLOYMENT_REMOTE_DIRECTORY, @PACKAGE_INIT@ substitution in the
  tutorial, bracket arguments/comments in cmake-language.7 and
  cmake-developer.7.

* FindQt4 module, which needs reformatting.
2025-01-29 16:48:53 -05:00
Peter Kokot
dc7aabf4d0 Help: Document CMAKE_OBJDUMP variable 2025-01-24 10:43:18 -05:00
Brad King
c283aafe62 CMP0057: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
Alex Turbov
bc8621d999
Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Adrian Pop
c51f84b96a GET_RUNTIME_DEPENDENCIES: Allow more whitespace before objdump's "DLL Name:"
LLVM's `llvm-objdump` has spaces before "DLL Name:" instead of tabs.
2024-03-10 11:03:21 -04:00
makise-homura
76a0a67026 GetPrerequisites: Tolerate multiple leading '/' in system library paths
On OS Elbrus 8.x, we see a dependency on `//usr/lib/libpcre2-8.so.0``
in the Qt4Deploy test.  Recognize it as a system path.
2024-01-08 15:25:57 -05:00
Brad King
139df0bc2f GetPrerequisites: Revert "Ignore relative paths printed by ldd"
Revert commit cf2ad9995a (GetPrerequisites: Ignore relative paths
printed by ldd, 2023-02-20, v3.27.0-rc1~459^2) because it regressed
existing use cases.  We will need to find another solution to the use
case motivating the change.

Fixes: #25372
2023-10-31 14:15:29 -04:00
Đoàn Trần Công Danh
cf2ad9995a GetPrerequisites: Ignore relative paths printed by ldd
On x86 Linux, the ldd output for its vDSO (linux-gate.so.1) is a bit
different from other Linux with standard vDSO name (linux-vdso.so.1).

    $ ldd /bin/ls
    linux-gate.so.1 => linux-gate.so.1 (0xf7f5e000)
    libcap.so.2 => /usr/lib32/libcap.so.2 (0xf7f22000)
    libc.so.6 => /usr/lib32/libc.so.6 (0xf7cfb000)
    /lib/ld-linux.so.2 => /usr/lib32/ld-linux.so.2 (0xf7f60000)

This fixes the `Tests/BundleUtilities` test on x86 Linux.
2023-02-20 09:30:40 -05:00
Mehdi Chinoune
ef2fa9b03b GetPrerequisties: pass "-a" only to grep. 2022-03-25 09:07:44 -04:00
Daniel Schlegel
403f343082 GetPrerequisites: Support CMAKE_OBJDUMP with .exe extension
When running `fixup_bundle` in a MSYS environment it fails because
`gp_tool` resolves to `objdump.exe` and not just `objdump`.

Fixes: #22381
2021-09-28 10:11:00 -04:00
Josef Angstenberger
15cc39ed7f
Modules: Fix typos and spelling in documentation 2021-05-07 17:00:16 +02:00
Brad King
6bf23b2755 Merge topic 'macos-include-weak-dependencies'
7e615a540e file(GET_RUNTIME_DEPENDENCIES): Fix weak macOS libraries not detected
f2d92b983b GetPrerequisites: Include weak macOS dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5703
2021-01-21 09:16:37 -05:00
Bianca van Schaik
f2d92b983b GetPrerequisites: Include weak macOS dependencies
Starting with Clang 12, `otool -L` adds `, weak` to weakly linked
libraries.  Update GetPrerequisites to recognize these.

Issue: #21684
2021-01-20 10:26:54 -05:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Err0rC0deX
417b765f5a GetPrerequisites: Classify vcruntime libraries as system
Previously GetPrerequisites classified `vcruntime*.dll` as type "other".
They should be classified as type "system".
2020-03-19 10:17:40 -04:00
Jon Chronopoulos
3bb7453436 GetPrerequisites: match ldd output on Solaris
Solaris output is the following:

```
$ ldd /lib/libxml2.so
libz.so.1 =>     /lib/libz.so.1
libm.so.2 =>     /lib/libm.so.2
libc.so.1 =>     /lib/libc.so.1
```

While on Linux

```
$ ldd /usr/lib/libxml2.so
linux-vdso.so.1 (0x00007ffe02bbe000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f03ab852000)
libicuuc.so.64 => /usr/lib/libicuuc.so.64 (0x00007f03ab67a000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f03ab463000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f03ab23d000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f03ab0f7000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f03aaf34000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f03ab9fd000)
libicudata.so.64 => /usr/lib/libicudata.so.64 (0x00007f03a94ee000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f03a94cd000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f03a92e5000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f03a92cb000)
```
2019-08-21 17:25:28 +10:00
Rolf Eike Beer
8d59ebb704 GetPrerequisites: use CMAKE_OBJDUMP if it is set 2019-06-19 07:14:31 +02:00
Kyle Edwards
54ec4c1e79 GetPrerequisites: Add deprecation notice
GetPrerequisites has now been superceded by file(GET_RUNTIME_DEPENDENCIES),
so add a deprecation notice stating such.
2019-06-10 14:35:28 -04:00
Ben Boeckel
0da2c35d6b GetPrerequisites: fix regression in gp_append_unique
The `item` variable was the loop variable in the old code prior to
commit 3dfc8b9bd6 (GetPrerequisites: use if(IN_LIST) instead of foreach,
2019-05-09).  The function argument `value` should be used instead.
2019-06-04 12:00:06 -04:00
Ben Boeckel
3dfc8b9bd6 GetPrerequisites: use if(IN_LIST) instead of foreach 2019-05-23 09:15:04 -04:00
Alexander Grund
08be74bfd7 GetPrerequisites: Fix handling of executable scripts
Fixes: #18667
2019-01-05 09:09:39 +11:00
Alexander Grund
52445300d6 GetPrerequisites: Allow prefixed tools
e.g. for cross-compilation with e.g. x86_64-pc-linux-gnu-ldd
2018-12-31 11:56:40 +11:00
Alexander Grund
1bac4678ea GetPrerequisites: Add GET_PREREQUISITES_VERBOSE to set verbose 2018-12-31 11:56:40 +11:00
Alexander Grund
428680da92 GetPrerequisites: Don't use hardcoded name for otool 2018-12-30 15:08:49 +01:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Harry Mallon
dce77d9ad9 GetPrerequisites: Move dylibs from MacOS to Frameworks folder in bundle
Fixes: #16828
2018-07-24 14:07:22 -04:00
Christian Pfeiffer
f88ef9a9b8 Modules: Remove paths set as global Unix prefixes
This commit removes hardcoded paths that are already given in the
platform files or in `UnixPath` on a global level.
2017-11-20 16:21:49 +01:00
Brad King
1a7b8c8321 GetPrerequisites: Restore behavior on missing binary of not clearing list
Prior to commit v3.4.0-rc1~264^2~1 (GetPrerequisites: Add error checks
for execute_process() calls, 2015-07-29), `get_prerequisites` would
simply warn on a missing binary and not update the result list at all.
That commit accidentally made the case an error.  This was fixed by
commit v3.8.0-rc1~110^2 (GetPrerequisites: Do not fail on files we
cannot find, 2017-01-10), but the fix also cleared the result list.
Clearing the list is incorrect because it is supposed to be able to
accumulate results over multiple calls.

Remove the list clearing behavior to restore the original behavior on a
missing binary.

Fixes: #17306
2017-09-26 07:31:33 -04:00
Brad King
23451a66ac GetPrerequisites: Do not warn about non-absolute UCRT system libraries
Issue: #17007
2017-06-26 10:33:16 -04:00
Guillaume Dumont
e0e414d659 GetPrerequisites: Only recurse on resolved unseen prerequisites
I encountered an issue where not all prerequisites would be listed by
`get_prerequisites` since some of the prerequisites cannot be resolved
and are added to the list of unseen prerequisites.  This has the side
effect of clearing the list of `prerequisites_var` and thus removes some
prerequisites from the list.  Fix it.
2017-05-11 16:12:38 -04:00
Steven Newbury
bed9c73dec Modules: Add x32-abi support to hard-coded paths
Update hard-coded library paths in bundled CMake Modules for libx32 as
used with x32-abi.
2017-03-07 15:22:55 -05:00
Michael Maltese
eacf7decbf GetPrerequisites: also try to resolve just the basename
Fixes #16625.
2017-02-22 12:27:39 -08:00
Brad King
bc09abd7d0 Merge topic 'get_prerequisites_delayload'
a7c5d5fb GetPrerequisites: Exclude delay load dependencies on Windows
2017-01-12 10:21:30 -05:00
Martin Koegler
17a0703d20 GetPrerequisites: Do not fail on files we cannot find
Historically we have always warned and skipped missing files.  Since
commit v3.4.0-rc1~264^2~1 (GetPrerequisites: Add error checks for
execute_process() calls, 2015-07-29) we fail instead, but this was not
an intentional part of that change.  Restore the warn-only behavior so
that missing system libraries (e.g. during cross-compiling) do not cause
failure.

Closes: #16523
2017-01-11 10:57:04 -05:00
Pascal Thomet
a7c5d5fb0e GetPrerequisites: Exclude delay load dependencies on Windows
With some Windows toolchains we use `objdump` which does not mention
delay load dependencies in its output.  Therefore, to get consistent
behavior we should always ignore them.

Use the `dumpbin` message "Image has the following delay load
dependencies" that precedes the delay load dependencies to recognize and
skip them.  Fortunately, this message is not translated to the current
locale (at least on "Windows 7 French", "Windows 10 French" and "Windows
Server 2008 R2 French").

Fixes: #16241
2017-01-11 10:48:36 -05:00
Martin Koegler
1d1f29f435 GetPrerequisites: Fix call to find_program for ri tool
`find_program` does not work with `${a};${b}` as a search path.
Use separate arguments to `PATHS`.
2016-12-12 14:27:21 -05: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
Brad King
258b7b2833 GetPrerequisites: Recognize absolute paths to UCRT system libraries
The matching expression added by commit v3.5.0-rc1~33^2
(GetPrerequisites: Define api-ms-win-* files as system libraries,
2016-01-19) did not account for absolute paths to the UCRT libraries.
We already recognize absolute paths to the MSVC runtime libraries.
Do this for UCRT libraries too.

Issue: #16240
2016-09-08 10:24:01 -04:00
Brad King
d47abe40b6 Merge topic 'GetPrerequisites-fix-regression'
a2d5c25a GetPrerequisites: Fix regression in gp_resolved_file_type
2016-08-15 08:59:43 -04:00
Brad King
a2d5c25a7a GetPrerequisites: Fix regression in gp_resolved_file_type
Since commit v3.6.0-rc1~287^2 (GetPrerequisites: Fix
gp_resolved_file_type on non-canonical paths, 2016-03-08) we
accidentally convert relative paths (e.g. system dll file names) to
absolute paths even when we do not know the base directory.  Fix this by
canonicalizing only paths that are already absolute.

Closes: #16240
2016-08-12 10:24:48 -04:00
Alexander Shishenko
5f3c8f6ab2 GetPrerequisites: Always filter objdump output as text
When using `grep` to filter the output, add the `-a` flag to tell
it never to treat the output as binary.  Otherwise when LANG != C
in the environment the non-ascii text may break the filter.
2016-08-08 14:05:21 -04:00
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
Automate with:

find Modules -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:41:13 +02:00
Rolf Eike Beer
8b3ffbe4af GetPrerequisites: fix typo in comment 2016-06-23 08:55:07 -04:00
Rolf Eike Beer
460a589d20 GetPrerequisites: fix typo in comment 2016-06-22 21:38:08 +02:00
Laurent Tarrisse
867b73e275 GetPrerequisites: Optimize on Windows by filtering objdump output
Extend the optimization from commit v3.4.0-rc1~264^2 (GetPrerequisites:
Optionally filter "objdump" output for speed, 2015-07-29) to work
on Windows by using `findstr` in place of `grep`.
2016-06-21 08:48:09 -04:00
Brad King
c9cebed5d8 GetPrerequisites: Look for VS tools using registry entries (#16108) 2016-05-25 09:00:33 -04:00
Brad King
a1c402910c GetPrerequisites: Look for VS tools using environment variables
The `VS*COMNTOOLS` environment variables specify locations of VS tools
and are set during the VS installation.  Use them in addition to the
hard-coded default install locations.
2016-04-08 08:48:20 -04:00
FARBOS Arnaud
c79f88b019 GetPrerequisites: add path of VS 10,11,12,14 in order to find dumpbin.exe 2016-04-08 08:48:03 -04:00
Brad King
37e8ccee54 GetPrerequisites: Fix gp_resolved_file_type on non-canonical paths
Canonicalize the input paths so we treat them both consistently,
in particular when comparing them via string operations.  This
is needed for calls like

    fixup_bundle("${CMAKE_INSTALL_PREFIX}/../test" ...)

Suggested-by: Benjamin Ballet <bballet@ivsweb.com>
2016-03-08 09:08:54 -05:00