Commit Graph

13127 Commits

Author SHA1 Message Date
Brad King
8f82e755f3 Ninja: Fix detection of MSVC showIncludes prefix in Italian
The prefix does not have two colons.  Update our regex.

Fixes: #24357
2023-01-28 07:16:58 -05:00
Brad King
a9d97492fd Ninja: Record showIncludes detection in configure log
Also avoid running the detection multiple times.
2023-01-27 10:55:37 -05:00
hstejas
1bba218214 FindImageMagick: Define targets for specific components
- With this change we can use e.g. ImageMagick::Magick++ directly
  in targt_link_libraries.
- This change also adds CFLAGS which was missing before.
- Also adds example on how to use the targets.
2023-01-27 10:33:10 -05:00
Jiri Malak
e194caa5a3 OpenWatcom: Add correct support for 16-bit Windows
This add correct Open Watcom support for 16-bit Windows 3.x.
It replace existing strange mixture with WIN32 stuff which implement 16-bit Windows target partially as part of WIN32 stuff.
Now pre-defined OS ID Windows3x is used instead of confusing WIN32.
It support properly 16-bit and 32-bit application for 16-bit Windows host.
32-bit applications are build with OW WIN386 extender.

It is used similar as for other platforms by set CMAKE_SYSTEM_NAME=Windows3x and CMAKE_SYSTEM_PROCESSOR=I86 for 16-bit application or CMAKE_SYSTEM_PROCESSOR=x86 for 32-bit WIN386 extender application running on 16-bit Windows 3.x.
CMAKE_SYSTEM_NAME=Windows is used only for WIN32 applications.
2023-01-25 17:53:03 +01:00
Brad King
950effe434 Merge topic 'CheckCompilerFlag-clang'
5b45a3d0ce CheckCompilerFlag: Match the Clang "argument unused" output for all languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8117
2023-01-25 11:19:21 -05:00
Brad King
d1ba79da4f Merge topic 'FindOpenMP-test-include-dir'
6e53d74147 FindOpenMP: Use OpenMP_<lang>_INCLUDE_DIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8110
2023-01-25 11:17:46 -05:00
KOLANICH
5b45a3d0ce CheckCompilerFlag: Match the Clang "argument unused" output for all languages
Improve detection of missing compiler flags: move "argument unused
during compilation: .*" pattern from language-specific branches into
the common list.
2023-01-24 17:17:36 -05:00
Jiri Malak
10623a51a0 OpenWatcom: Refactor population of standard include directories
Add setup of system include directories to language related macro to remove extra lines for C and CXX.
System include directories are always same for both languages (they are defined per platform).
2023-01-24 20:44:11 +01:00
Brad King
62483b9b99 Merge topic 'gen-pkg-example'
bfa61ccf64 Help: Modernize PackageConfigHelpers example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8111
2023-01-24 09:20:49 -05:00
Brad King
caf5aea63f Merge topic 'FindPython-CMP0007-NEW'
486b3c0850 FindPython: Policy CMP0007 must be set to NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8104
2023-01-24 09:19:16 -05:00
Brad King
4db877ce9a Merge topic 'FindPython-CMP0007-NEW' into release-3.25
486b3c0850 FindPython: Policy CMP0007 must be set to NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8104
2023-01-24 09:19:14 -05:00
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
Andrey Alekseenko
6e53d74147 FindOpenMP: Use OpenMP_<lang>_INCLUDE_DIR
If `OpenMP_<lang>_INCLUDE_DIR` is defined, add it to the list of include
directories before checking flags. Previously, this variable was
ignored for all compilers but AppleClang, despite the documentation
mentioning it as one of the possible inputs.

Fixes: #24260
2023-01-23 19:37:26 +01: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
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
Marc Chevrier
486b3c0850 FindPython: Policy CMP0007 must be set to NEW
Fixes: #24306
2023-01-21 15:08:21 +01: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
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
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
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
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
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
Brad King
874c2e1198 FindQt4: Drop outdated advice to look at CMakeError.log on failure
The find module does not write information to the log.
2023-01-18 16:41:00 -05:00
Brad King
a80465bcad GHS: Drop debugging message from log 2023-01-18 16:41:00 -05:00
Brad King
9199449687 CompileFeatures: Warn explicitly when feature detection binary is not found
This step is not normally expected to fail, so warn instead of logging it.
2023-01-18 16:41:00 -05:00
Brad King
24ccc8c3c9 CompilerId: Restore logging of failed identifications
Changes in commit 9c5bd7fe3a (CompilerId: Output errors from all
attempts at detection, 2022-08-16, v3.25.0-rc1~290^2) accidentally
stopped logging failed compiler identification build output.
2023-01-18 16:41:00 -05:00
Even Rouault
b4be607701 FindLibLZMA: Fix failure when no include directories are needed
Quote the value of `INTERFACE_INCLUDE_DIRECTORIES` to ensure
`set_target_properties` gets matching property/value pairs.
2023-01-18 16:26:24 -05:00
Kitware Robot
33abef7416 Revise C++ coding style using clang-format-15
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 15.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #24315
2023-01-18 16:20:47 -05:00
Brad King
9ce1c87037 Merge topic 'swift-ios'
44abf24848 Swift: Add comment about where platform-specific flags should go
9a013c9e9d Swift: Use macOS-style linker flags on iOS, tvOS, and watchOS too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8070
2023-01-18 10:56:23 -05:00
Brad King
427538b78e Merge topic 'docpc'
93624e4c3d Help:ProcessorCount: recommend cmake_host_system_information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8077
2023-01-18 10:48:35 -05:00
Brad King
bdb4a4136b Merge topic 'IntelLLVM-c++23'
4331f7b4bf IntelLLVM: Add provisional flags for C23 and C++23
42ca6416af IntelLLVM: Replace -Qstd= with -Qstd: on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8064
2023-01-18 10:47:17 -05:00
Brad King
44abf24848 Swift: Add comment about where platform-specific flags should go 2023-01-17 09:21:15 -05:00
Craig Hutchinson
9a013c9e9d Swift: Use macOS-style linker flags on iOS, tvOS, and watchOS too
Without this, building a shared Swift library with `CMAKE_SYSTEM_NAME=iOS`
produces the error `ld: unknown option: -soname`.  iOS is an Apple platform,
and so should use the `-install_name` option.
2023-01-17 09:20:39 -05:00
Vitaly Stakhovsky
99614e06be Source: Fix a few typos 2023-01-17 08:25:04 -05:00
scivision
93624e4c3d Help:ProcessorCount: recommend cmake_host_system_information
closes #24277
2023-01-16 15:30:06 -05:00
scivision
4331f7b4bf IntelLLVM: Add provisional flags for C23 and C++23 2023-01-16 15:08:34 -05:00
scivision
42ca6416af IntelLLVM: Replace -Qstd= with -Qstd: on Windows
The latter is the documented form [1].

[1] https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-reference/compiler-options/language-options/std-qstd.html
2023-01-16 15:08:34 -05:00
Robert Maynard
eb4de10075 FindCUDAToolkit: Handle CUDA::nvToolsExt not existing
Fixes #24275
2023-01-16 09:43:43 -05:00
Brad King
be4dcdf100 Merge topic 'FindMatlab-macos-rosetta'
1bc9b0f256 FindMatlab: accommodate Matlab running under Rosetta
8dcd14bb87 FindMatlab: simplify mexext find logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8063
2023-01-13 08:57:43 -05:00
Brad King
a547f315dd Merge topic 'deprecate-findunixcmds'
0847682c47 FindUnixCommands: Deprecate in favor of cmake -E

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8061
2023-01-13 08:53:30 -05:00
Brad King
ff7e813fc1 Merge topic 'implicit-includes'
607bccb4ef Restore implicit include directory extraction for adaptive relative paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8067
2023-01-13 08:45:38 -05:00
Brad King
2d9e66a23b Merge topic 'implicit-includes' into release-3.25
607bccb4ef Restore implicit include directory extraction for adaptive relative paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8067
2023-01-13 08:45:37 -05:00
Brad King
1efb3c5870 Merge topic 'IntelLLVM-msvc-no-cxx11'
88f9fdcb03 IntelLLVM: Avoid unnecessary -Qstd=c++11 flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8069
2023-01-13 08:43:30 -05:00
Brad King
45da44cc23 Merge topic 'IntelLLVM-msvc-no-cxx11' into release-3.25
88f9fdcb03 IntelLLVM: Avoid unnecessary -Qstd=c++11 flag on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8069
2023-01-13 08:43:29 -05:00