Commit Graph

11902 Commits

Author SHA1 Message Date
Brad King a136b6ec98 MINGW: Define variable only when targeting Windows platforms
The `MINGW` variable indicates that the compiler targets MinGW, a GNU
ABI on Windows.  Since commit aff3147917 (Modernize GNU compiler info on
Windows, 2009-12-02, v2.8.2~636), we load the `Platform/Windows-GNU`
module for compilers targetin MinGW, so set the variable there instead.
This is equivalent to `Platform/Windows-MSVC` setting the `MSVC`
variable.  Also remove `if(MINGW)` checks from the module, which have
not been necessary since the enclosed logic was moved to that module.

The undocumented `CMAKE_COMPILER_IS_MINGW` internal variable is now
unused, so remove it too.

Fixes: #22647
2021-09-17 12:17:35 -04:00
Brad King 0b7ae84a96 Cygwin: Remove redundant definitions of CYGWIN and UNIX variables
These are set by modules loaded for `CMAKE_SYSTEM_NAME`.  We do not
need to set them again if the compiler defines `__CYGWIN__`.

Also remove the now-unused undocumented `CMAKE_COMPILER_IS_CYGWIN`
internal variable.
2021-09-16 09:55:26 -04:00
Brad King 1375862764 Merge topic 'cpack-nsis-apps-n-features'
eb3b3bacdc CPack/NSIS: Fix uninstall on Windows using "Apps & Features"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6517
2021-09-15 10:18:55 -04:00
Robert Maynard 51fd21736b FindFLTK: Safe to include multiple times
FindFLTK could store multiple entries in `FLTK_INCLUDE_DIR`,
and when re-executed would stored into `FLTK_DIR` which had
uses which presumed single entries.

Fixes #13198
2021-09-14 11:10:28 -04:00
Andras Lasso eb3b3bacdc CPack/NSIS: Fix uninstall on Windows using "Apps & Features"
According to NSIS documentation [1], uninstaller executable path in
UninstallString must always be quoted.  Quote the uninstall executable
in `NSIS.template.in` so that it works when the path has spaces.

[1] https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs
2021-09-14 09:52:19 -04:00
Brad King 8f67d42671 Merge topic 'find-matlab-imported-targets'
161990b921 FindMatlab: Add imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6488
2021-09-14 09:42:50 -04:00
Brad King fdeb9e0751 Merge topic 'GNUInstallDirs_become_conda_install_aware'
ecaca8c129 GNUInstallDirs now aware of conda lib directory requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Silvio Traversaro <pegua1@gmail.com>
Merge-request: !6512
2021-09-14 09:41:19 -04:00
Brad King 085719d4d8 Merge topic 'iwyu-cl'
ccfe1b0b40 IWYU: Add `--driver-mode=cl` when applicable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6511
2021-09-14 09:36:13 -04:00
Brad King 2a8d9bf4cc Merge topic 'CMakeDependentOption-condition-syntax'
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6493
2021-09-14 09:35:07 -04:00
Brad King 036f41e45f Merge topic 'CMakeFindPackageMode-sysroot'
8defe3380e CMakeFindPackageMode: Honor CMAKE_SYSROOT to detect lib64 platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6513
2021-09-14 09:33:55 -04:00
Silvio Traversaro 161990b921 FindMatlab: Add imported targets 2021-09-13 12:12:05 -04:00
Robert Maynard ecaca8c129 GNUInstallDirs now aware of conda lib directory requirements
No matter the OS when installing for conda the library components
need to be placed into the `lib` directory.

To better meet these requirements GNUInstallDirs now checks to see
if it is being asked to install into a conda install location,
and if so use the 'lib' directory instead of the system directory
name.
2021-09-13 08:42:40 -04:00
PigeonF ccfe1b0b40 IWYU: Add --driver-mode=cl when applicable
We already do this for `clang-tidy`.

Fixes: #16554
2021-09-10 09:53:31 -04:00
Daniel Schürmann 059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax
Fixes: #22303
2021-09-10 09:46:55 -04:00
Brad King 72c4f1281e Merge topic 'icu-advanced'
cdd2714dfa FindICU: Really mark variables as advanced

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6507
2021-09-10 09:32:26 -04:00
Brad King c8605bfd45 Merge topic 'clang_msvc_frontend_detection_for_asm'
c9c79dde41 Clang: Add MSVC frontend detection for the ASM compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6481
2021-09-10 09:31:00 -04:00
Marc Chevrier dc971e7da4 Merge topic 'thread-typos'
d897391782 Fix typo in comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Arcturus <arcturus102@outlook.com>
Merge-request: !6504
2021-09-10 04:34:09 -04:00
Pablo Romero 8defe3380e CMakeFindPackageMode: Honor CMAKE_SYSROOT to detect lib64 platforms
Add `CMAKE_SYSROOT` to check the full path on host OS. In a
non-crosscompiling use case, the call to `CMAKE_SYSROOT` is empty.

Fixes: #22608
2021-09-09 15:55:26 -04:00
Thomas Bernard c9c79dde41 Clang: Add MSVC frontend detection for the ASM compiler
Fixes: #22495
2021-09-09 14:26:44 -04:00
Marc Chevrier 88ea6cb292 Merge topic 'FindPyhton-homebew-on-Mac-M1'
2636ad5045 FindPython: Ensure homebrew on Mac M1 is used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6499
2021-09-07 05:18:55 -04:00
Mathieu Malaterre cdd2714dfa FindICU: Really mark variables as advanced 2021-09-06 15:09:31 +02:00
Mattias Ellert d897391782 Fix typo in comment
The comment lists -lpthread twice, when "-lpthreads, -lpthread" is meant.
Also the grammar (did not found) is incorrect.
2021-09-06 06:54:51 +02:00
Brad King 6059996467 Merge topic 'vs2022'
38c8f2c4e3 IRSL: Add discovery of VS 2022 v143 toolset redistributables
f01ea7e391 MSVC: Fix MSVC_TOOLSET_VERSION for VS 2022 v143 toolset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6497
2021-09-03 10:18:50 -04:00
Brad King a2c3ef9379 Merge topic 'FindBoost-1.77'
1ad0c5ae53 FindBoost: Add support for Boost 1.77

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6494
2021-09-03 10:17:35 -04:00
Marc Chevrier 2636ad5045 FindPython: Ensure homebrew on Mac M1 is used
Fixes: #22581
2021-09-03 14:59:52 +02:00
Brad King 38c8f2c4e3 IRSL: Add discovery of VS 2022 v143 toolset redistributables
Fixes: #22586
2021-09-02 13:47:46 -04:00
Brad King f01ea7e391 MSVC: Fix MSVC_TOOLSET_VERSION for VS 2022 v143 toolset
This was forgotten in commit 0c7f918fb1 (VS: Update Visual Studio 17
2022 generator for Preview 2, 2021-07-14, v3.21.1~29^2) when the toolset
was first renumbered to `v143`.

Fixes: #22585
2021-09-02 13:47:42 -04:00
Brad King 1ad0c5ae53 FindBoost: Add support for Boost 1.77
Update the list of known versions.

Run the command

    cmake -DBOOST_DIR=/path/to/boost_1_77_0 \
      -P Utilities/Scripts/BoostScanDeps.cmake

to extract dependencies from the 1.77.0 source tree.  The dependencies
differ from those of 1.76: the `contract`, `thread`, and `wave`
components no longer depend on `date_time`.  The `math` component no
longer depends on `atomic`.

Fixes: #22588
2021-09-02 12:43:43 -04:00
Brad King 67d0d8b9d5 Merge topic 'darwin-wmake-jwasm-support'
bf09145eb0 Enable Watcom WMake generator on Darwin
78f758a463 Use dashes for MASM flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6472
2021-08-25 09:18:11 -04:00
Brad King 78eff650fa Merge topic 'GNUInstallDirs-variable-named-0'
49a5dbcaff GNUInstallDirs: avoid unwanted variable dereference

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6474
2021-08-25 09:12:23 -04:00
Brad King eae5533ab3 Merge topic 'GNUInstallDirs-variable-named-0' into release-3.21
49a5dbcaff GNUInstallDirs: avoid unwanted variable dereference

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6474
2021-08-25 09:12:22 -04:00
Brad King cf90aa5595 Merge topic 'host-distro-info'
b9698f89df cmake_host_system_information: Make it available for all systems
5469c71a82 Refactor: Simplify `GetValue()` function calls
6c92f80f2e cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT`
efe139d1b8 cmake_host_system_information: Can run fallback scripts
1e65e4a6e5 cmake_host_system_information: Can read `/etc/os-release` file
e808cbb1dd Testing: Convert `cmake_host_system_information` tests into `RunCMake`
9e831284e5 Documentation: Use definition list instead of tables
346f3de005 Refactor: Deduplicate code for `VS_nn_DIR` keys processing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6410
2021-08-24 10:04:15 -04:00
Brad King 38dbf18bb1 Merge topic 'FindMPI-framework-not-a-compile-flag'
2b2a6a7170 FindMPI: do not detect `-framework` as a compile flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !6467
2021-08-24 09:54:58 -04:00
Craig Scott 600ca2ab1a Merge topic 'FetchContent_doc_restructure'
e802193a34 Help: Rework docs to prioritize FetchContent_MakeAvailable()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6475
2021-08-24 08:33:15 -04:00
Craig Scott e802193a34 Help: Rework docs to prioritize FetchContent_MakeAvailable()
FetchContent_MakeAvailable() should be strongly preferred over
the direct use of FetchContent_Populate(). The latter was the only
method available before CMake 3.14, but the former is simpler and
offers more functionality. Restructure the docs and improve the
wording to steer the reader toward `FetchContent_MakeAvailable()`
as the preferred approach.

Also take the opportunity to pull out the variables that influence
behavior into their own section. They were easily missed when
buried in the docs for the FetchContent_Populate() command.
2021-08-23 21:47:03 +10:00
Ben Boeckel 49a5dbcaff GNUInstallDirs: avoid unwanted variable dereference
In some situations, it seems that the variable `0` is defined. In the
case found, it was set to `1`. This makes the detection of the missing
third argument bogus and unnecessarily triggers a warning.

This oversight was introduced in 229b5ee994 (GNUInstallDirs: Add dir
argument to GNUInstallDirs_get_absolute_install_dir, 2020-10-31) prior
to CMake 3.20's release cycle.
2021-08-22 12:42:48 -04:00
Bradley Bell 78f758a463 Use dashes for MASM flags
Microsoft's tools traditionally uses slashes, but accept dashes as
well. If we use dashes, it becomes possible to use an alternative
MASM-compatible assembler such as JWasm.
2021-08-20 20:28:37 -07:00
Alex Turbov efe139d1b8 cmake_host_system_information: Can run fallback scripts 2021-08-20 09:35:12 -04:00
Ben Boeckel 2b2a6a7170 FindMPI: do not detect -framework as a compile flag
MPICH 3.4.2 now reports `-framework OpenCL` as one of its compilation
flag. The compile flag extraction is seeing it as a generic `-f` flag
and misses its argument. This ends up with a compile option of
`-framework` which eats the next flag (and may be very important).

It does not seem that passing `-framework` as a link flag is necessary
at this time, so that is being actively ignored for now.

Fixes: #22555
2021-08-19 13:09:39 -04:00
Brad King 2a4a630f3a Merge topic 'help_check'
d62d0f048f Help: CheckFortranFunctionExists: recommend more general CheckSourceCompiles
8fddc2bb2f Help: refer to CheckSourceCompiles instead of older

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6446
2021-08-19 10:31:25 -04:00
Brad King 135e79038c Merge topic 'FindPkgConfig-restore-legacy-behavior'
17e4934dbf FindPkgConfig: Restore legacy behavior when CMP0126 is set to NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6461
2021-08-19 10:27:24 -04:00
Brad King 30dd9b33a0 Merge topic 'FindPkgConfig-restore-legacy-behavior' into release-3.21
17e4934dbf FindPkgConfig: Restore legacy behavior when CMP0126 is set to NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6461
2021-08-19 10:27:23 -04:00
Brad King 76f1c9d598 Merge topic 'binutils-clang-fallback-ld'
788b7afff2 FindBinUtils: Fall back to ld for Clang without lld

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6457
2021-08-19 10:26:18 -04:00
Brad King daeb4f0f50 Merge topic 'binutils-clang-fallback-ld' into release-3.21
788b7afff2 FindBinUtils: Fall back to ld for Clang without lld

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6457
2021-08-19 10:26:17 -04:00
Brad King a7daf30070 Merge topic 'CheckLanguage-CMP0126' into release-3.21
89ed11ae6f CheckLanguage: Avoid CMP0126 warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6462
2021-08-19 10:25:15 -04:00
Brad King 4aaddce2be Merge topic 'CheckLanguage-CMP0126'
89ed11ae6f CheckLanguage: Avoid CMP0126 warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6462
2021-08-19 10:25:15 -04:00
Brad King 5dc9f53f50 Merge topic 'android-macos-arm64'
164643fc39 Android: Fix NDK toolchain dir on arm64 mac

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6449
2021-08-19 10:23:31 -04:00
Brad King 89ed11ae6f CheckLanguage: Avoid CMP0126 warning
The macro's implementation converts a normal variable into a cache
variable intentionally, so both are set.  Explicitly set CMP0126 to NEW
to avoid a warning in trace mode.  This won't affect the module behavior
because the code path does not activate if a normal variable is already
defined anyway.

Fixes: #22548
2021-08-18 15:25:49 -04:00
Marc Chevrier 17e4934dbf FindPkgConfig: Restore legacy behavior when CMP0126 is set to NEW
Module behavior must be independent from `CMP0126` policy.

Fixes: #22526
2021-08-18 14:51:50 -04:00
Thomas Bernard 788b7afff2 FindBinUtils: Fall back to ld for Clang without lld
If `lld` is not available, Clang can still use `ld`.

Fixes: #22500
2021-08-18 14:31:21 -04:00