Commit Graph

60638 Commits

Author SHA1 Message Date
FeRD (Frank Dana)
bfa61ccf64 Help: Modernize PackageConfigHelpers example
The example shown in the module documentation for
CMakePackageConfigHelpers was showing its age, by:

1. Hardcoding directory prefixes (`etc/`, `lib/`, etc.) instead of
   using GNUInstallDirs
2. Handwaving `set()` commands (incorrectly!) as:
     `set(VAR dir/ ... CACHE )`
   which should, at the very least, be:
     `set(VAR dir/ CACHE ... )`
3. Installing CMake configuration files to `lib/Foo/cmake/`, when
   current practice favors `${CMAKE_INSTALL_LIBDIR}/cmake/Foo/`

This updated example addresses all of those issues.
2023-01-23 18:02:31 -05:00
Brad King
f9f34eb111 Merge topic 'improve_supported_language_docs'
b787be2714 Help: Update supported languages in project and enable_language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8101
2023-01-23 10:41:41 -05:00
Brad King
709bc0368f Merge topic 'genex-CONFIG-validate-all'
910ada1a88 Genex: $<CONFIG:> syntax of all entries checked
42e417ad12 GeneratorExpression Tests: Remove duplicate test entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8082
2023-01-23 10:40:53 -05:00
Brad King
c9fc146a93 Merge topic 'find_cudatoolkit_add_nvrtc_static'
2a94c762ed FindCUDAToolkit: Add support for CUDA::nvrtc_static

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8100
2023-01-23 10:40:05 -05:00
Brad King
99bd5eb062 Merge topic 'vs-BuildInParallel'
33c15ae2b9 VS: Build custom commands concurrently when possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8093
2023-01-23 10:39:09 -05:00
Ivan Zinkevich
33c15ae2b9 VS: Build custom commands concurrently when possible
Enable the `BuildInParallel` setting in VS project files when supported.

Fixes: #18405
2023-01-23 10:38:07 -05:00
Brad King
f45ef98a7e Merge branch 'release-3.25' 2023-01-23 10:35:52 -05:00
Brad King
f07fdb250c Merge topic 'FindOpenSP-pkg-config-hints'
3b1c19f00a FindOpenSP: Use pkg-config only as hints for main code path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8097
2023-01-23 10:35:52 -05:00
Brad King
b179982001 Merge topic 'FindOpenSP-pkg-config-hints' into release-3.25
3b1c19f00a FindOpenSP: Use pkg-config only as hints for main code path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8097
2023-01-23 10:35:50 -05:00
Brad King
f4d604f77f Merge topic 'try_compile-verbose'
faa950a155 try_compile: Run native build tool with verbose output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8095
2023-01-23 10:34:37 -05:00
Kitware Robot
adac7f3ca4 CMake Nightly Date Stamp 2023-01-23 00:01:17 -05:00
Kitware Robot
6d57bbdc7b CMake Nightly Date Stamp 2023-01-22 00:01:08 -05:00
Kitware Robot
09ce97c40d CMake Nightly Date Stamp 2023-01-21 00:01:11 -05:00
Brad King
35c220e653 Merge topic 'ci-docker-nvidia'
ebd81d0e12 ci: rebase nvidia-derived docker images on tags we control

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !8102
2023-01-20 15:05:34 -05:00
Robert Maynard
b787be2714 Help: Update supported languages in project and enable_language 2023-01-20 13:55:38 -05:00
Robert Maynard
910ada1a88 Genex: $<CONFIG:> syntax of all entries checked
Fixes #24327
2023-01-20 13:30:25 -05:00
Brad King
ebd81d0e12 ci: rebase nvidia-derived docker images on tags we control
According to NVIDIA's container image support policy [1], they will
remove tags for older images over time.  In order to preserve our
ability to rebuild CI images based on them in the future, base them on
tags we control.

[1] https://gitlab.com/nvidia/container-images/cuda/blob/85fbd45b92/doc/support-policy.md
2023-01-20 13:00:19 -05:00
Robert Maynard
2a94c762ed FindCUDAToolkit: Add support for CUDA::nvrtc_static 2023-01-20 12:05:43 -05:00
Kefu Chai
3b1c19f00a FindOpenSP: Use pkg-config only as hints for main code path
before this change, pkg_check_modules(.. IMPORTED_TARGET GLOBAL)
is used for creating an imported target from which another imported
interface library named OpenSP::OpenSP is created. but pkg-config
does not account for all of CMake's other search behavior controls,
such as CMAKE_FIND_ROOT_PATH. neither does it export the full path
with OpenSP_LIBRARY.

after this change, the paths found by pkg-config are only used
as hints for the find_*() commands. and some cleanup are included:

* be QUIET when calling find_package(PkgConfig ..) and
  pkg_check_modules(..) as they are distracting from user's point of
  view. what matters is the output of find_package_handle_standard_args()
* parse the version and check for the existance of symbol as long as
  header path is found. because they only use header files.
* define OpenSP_LIBRARY as long as it exists. this just follows
  the convention. as OpenSP_FOUND implies a valid OpenSP_LIBRARY.
* wrap and intent multi-line command calls for better readability
* check OpenSP_FOUND before adding OpenSP::OpenSP, it's more
  idiomatic.

Fixes: #24313
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2023-01-20 10:14:39 -05:00
Brad King
06c7e88b91 Merge topic 'configure-log'
317aac14ef cmake: Stop pointing users at logs on configure errors
eae1398d09 cmake --system-information: Stop dumping CMake{Output,Error}.log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8094
2023-01-20 09:37:08 -05:00
Brad King
1d52007564 Merge topic 'ninja-swift-exported-executables'
4165eb3d0b Ninja: Emit swiftmodule from executable with exports

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8048
2023-01-20 09:36:00 -05:00
Brad King
8150831dfd Merge topic 'cygwin-no-legacy-win32'
a429e4b9b1 CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8096
2023-01-20 09:33:34 -05:00
Brad King
526b2db5d3 Merge topic 'print-configure-generate-time'
5f0c5ec49b cmake: Print configure/generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8083
2023-01-20 09:32:45 -05:00
Brad King
dde39a820e Merge topic 'update-kwsys'
dae189fb09 Merge branch 'upstream-KWSys' into update-kwsys
4ac17cff42 KWSys 2023-01-19 (be3c441e)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8092
2023-01-20 09:29:52 -05:00
Brad King
faa950a155 try_compile: Run native build tool with verbose output
Make the compiler command lines visible in the configure log.

Issue: #23200
2023-01-20 09:17:51 -05:00
Kitware Robot
50dd0c4bfb CMake Nightly Date Stamp 2023-01-20 00:01:12 -05:00
Evan Wilde
4165eb3d0b Ninja: Emit swiftmodule from executable with exports
This patch adds support for tracking the swiftmodules for executables
exporting symbols.

This fixes a bug in the earlier implementation around emitting the
swiftmodule. Previously, the code would use
`CMAKE_EXE_EXPORTS_Swift_FLAG` to inject the `-emit-module`, and module
path information into the `CMAKE_Swift_LINK_EXECUTABLE` rule. Because
Swift skips the build step and only runs during the link phase, these
flags were injected in `cmNinjaNormalTargetGenerator::ComputeLinkCmd`
instead of `cmLocalGenerator::GetTargetFlags` where it is done normally.

Unfortunately, injecting in `ComputeLinkCmd` didn't do anything because
we have a `linkCmd` so `ComputeLinkCmd` exits early, before the
EXE_EXPORT flags get added to the link command.

Instead of playing with that flag, CMake checks
`CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS` and uses that as the link
rule if it exists and falls back on `CMAKE_Swift_LINK_EXECUTABLE`. I've
defined that variable in terms of `CMAKE_Swift_LINK_EXECUTABLE` with the
necessary additional flags for emitting the swift module instead. This
has the same end effect as the desired behavior, but simplifies things a
bit.

Since we're generating the swiftmodule for executables with exports,
I've also updated the dependency graph to include the swiftmodule as an
output in the build dependency graph if the executable has exports.

Tests updated:
 - RunCMake/NoWorkToDo:
   Ensure that the build graph does not result in unnecessary rebuilds
   with exporting executables.

 - SwiftOnly:
   Ensure that we can consume functions defined in the executable by a
   library getting linked into said executable.
2023-01-19 11:49:24 -08:00
Brad King
a429e4b9b1 CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32
Prior to CMake 2.8.4 (released in 2011), we defined `WIN32` on CYGWIN.
That was removed, but an undocumented `CMAKE_LEGACY_CYGWIN_WIN32`
compatibility mode was left to help projects transition.  Only projects
that do not require at least 2.8.4 as their minimum CMake version need
the compatibility mode.  We've also long warned about projects that do
not require at least 2.8.12, so it is now reasonable to remove the
legacy compatibility mode.
2023-01-19 14:29:35 -05:00
Brad King
317aac14ef cmake: Stop pointing users at logs on configure errors
Since commit 18e1bfbb3c (cmake: On configure error suggest looking at
CMake*.log files, 2013-07-09, v2.8.12~210^2), when configuring a project
fails, we print `See also .../CMake{Output,Error}.log` near the end of
the output.  This was intended to help users find failures in system and
compiler inspection checks, but for normal project errors the messages
may be misleading.  The logs may contain incidental errors that are part
of normal operation and do not need to be addressed by the user.

Since commit f6ed2585e5 (Modules: Record system inspection steps in the
configure log, 2023-01-16), CMake's builtin modules no longer log
information to the old-style `CMake{Output,Error}.log` files anyway,
so stop mentioning them.

Fixes: #22131
Issue: #23200
2023-01-19 13:27:51 -05:00
Brad King
eae1398d09 cmake --system-information: Stop dumping CMake{Output,Error}.log
CMake no longer logs system information to these files.
2023-01-19 13:24:06 -05:00
Brad King
5031934fb0 Merge topic 'configure-log'
f6ed2585e5 Modules: Record system inspection steps in the configure log
0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
ecc26f98eb UsewxWidgets: Remove leftover debugging code
874c2e1198 FindQt4: Drop outdated advice to look at CMakeError.log on failure
a80465bcad GHS: Drop debugging message from log
9199449687 CompileFeatures: Warn explicitly when feature detection binary is not found
24ccc8c3c9 CompilerId: Restore logging of failed identifications
95976514f6 Tests: Avoid using CMake{Output,Error}.log files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8089
2023-01-19 13:21:36 -05:00
Brad King
e107fd0713 Merge branch 'release-3.25' 2023-01-19 10:40:17 -05:00
Kyle Edwards
5f0c5ec49b cmake: Print configure/generate time 2023-01-19 09:51:07 -05:00
Brad King
e2be23a2b3 CMake 3.25.2 v3.25.2 2023-01-19 09:32:19 -05:00
Brad King
c3513e59c4 Merge topic 'minor-tutorial-fixes'
2e3fcf9399 Tutorial: Fix typos in Step 11 exercise and solution
f04c548877 Tutorial: Fix exercise in Step 10 to match solution provided in Step 11
566e12c976 Tutorial: Fix destination of link from Step 6 to Step 5
bef0b9eb64 Tutorial: Fix exercise in Step 5 to match solution provided in Step 6

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8087
2023-01-19 09:24:56 -05:00
Brad King
c601bd28af Merge topic 'FindLibLZMA_quote'
b4be607701 FindLibLZMA: Fix failure when no include directories are needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8088
2023-01-19 09:22:43 -05:00
Brad King
28fd87aa1d Merge topic 'optimize-target-depends-closure'
1f16af01f4 cmGlobalNinjaGenerator: Optimize target depends closure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8079
2023-01-19 09:22:05 -05:00
Brad King
cd87bebe49 Merge topic 'optimize-full-name-function'
a525f5f1bf cmGeneratorTarget: Cache full name components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8033
2023-01-19 09:21:18 -05:00
Brad King
dae189fb09 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2023-01-19 (be3c441e)
2023-01-19 09:17:35 -05:00
KWSys Upstream
4ac17cff42 KWSys 2023-01-19 (be3c441e)
Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit be3c441e46e091a7606565221bb5ae7c9a9b684f (master).

Upstream Shortlog
-----------------

Brad King (4):
      6c66ba9e clang-format.bash: Use generic clang-format attribute
      82ae3f28 clang-format.bash: update to clang-format-15
      a61d0ad6 Empty commit at end of history preceding clang-format-15 style transition
      3cb35bf3 CONTRIBUTING: Update documented clang-format version to 15

Kitware Robot (1):
      f685d817 Revise C++ coding style using clang-format-15

Sean McBride (1):
      d6c6fd82 testDirectory: Rename functions to fix -Wreserved-identifier warnings
2023-01-19 09:17:34 -05:00
Brad King
35afae5913 Merge topic 'clang-format-15'
53d7d8d4ee Help/dev: Update source code guide to specify clang-format version 15

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8091
2023-01-19 09:16:16 -05:00
Brad King
53d7d8d4ee Help/dev: Update source code guide to specify clang-format version 15 2023-01-19 09:13:24 -05:00
Brad King
d6d847607c Merge topic 'clang-format-15'
33abef7416 Revise C++ coding style using clang-format-15
57221fd56f Empty commit at end of history preceding clang-format-15 style transition
6739d57948 clang-format.bash: update to clang-format-15
9ee57226bc clang-format: Add comments to suppress some formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8086
2023-01-19 09:07:18 -05:00
Kitware Robot
4c5efdcfa8 CMake Nightly Date Stamp 2023-01-19 00:01:11 -05:00
Brad King
f6ed2585e5 Modules: Record system inspection steps in the configure log
Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging
with calls to `message(CONFIGURE_LOG)` to record the steps in the
`CMakeConfigureLog.yaml` configure log instead.

Issue: #23200
2023-01-18 17:59:10 -05:00
Joshua Perrett
2e3fcf9399 Tutorial: Fix typos in Step 11 exercise and solution 2023-01-18 21:43:49 +00:00
Joshua Perrett
f04c548877 Tutorial: Fix exercise in Step 10 to match solution provided in Step 11
The solution in Step 11 sets POSITION_INDEPENDENT_CODE to
`${BUILD_SHARED_LIBS}`, rather than simply to "True" in all cases.
2023-01-18 21:43:49 +00:00
Joshua Perrett
566e12c976 Tutorial: Fix destination of link from Step 6 to Step 5
The link in Step 6 (to "Testing Support") clearly refers to Exercise 2.
Fix the location to which the link jumps.
2023-01-18 21:43:49 +00:00
Brad King
0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
`try_compile` and `try_run` now automatically log checks using them to
`CMakeConfigureLog.yaml`.

Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to
replace the description previously written to the old logs.

Issue: #23200
2023-01-18 16:41:01 -05:00
Brad King
ecc26f98eb UsewxWidgets: Remove leftover debugging code 2023-01-18 16:41:01 -05:00