Commit Graph

13110 Commits

Author SHA1 Message Date
Brad King
a1140b61db Merge topic 'LLVMFlang-post-preprocessed'
3f1e58c5b9 LLVMFlang: Fix post-preprocess compile for fixed-form Fortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Andrzej Warzyński <andrzej.warzynski@gmail.com>
Merge-request: !8205
2023-02-15 08:19:32 -05:00
David Truby
3f1e58c5b9 LLVMFlang: Fix post-preprocess compile for fixed-form Fortran
LLVM Flang's preprocessor output is always valid fixed form Fortran with
a fixed line length of 72. If an application tries to use fixed form
with a different line length, this will fail in the
post-preprocessing compilation step as they will pass a flag asking for
a different fixed line length.

To fix this we can pass -ffixed-line-length-72 to the post-preprocess
compilation stage. This will be ignored when the input is free form
Fortran, and force to a 72 line length when the input is fixed.
2023-02-14 09:22:12 -05:00
Brad King
aec5dd482f Merge topic 'lcc-major-version'
2a75edb342 LCC: Fix extraction of __LCC__ version components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8199
2023-02-14 08:46:18 -05:00
Brad King
2a75edb342 LCC: Fix extraction of __LCC__ version components
Previously the logic only worked for major versions of the form `1.xx`.
Fix it to work with versions `2.xx` and above.
2023-02-13 09:29:32 -05:00
Brad King
d00613786f Merge topic 'findopenssl-static-findpkg-fix'
652f34eab9 FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ON

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8174
2023-02-08 11:38:00 -05:00
Brad King
4ce614eb5a Merge topic 'findopenssl-static-findpkg-fix' into release-3.26
652f34eab9 FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ON

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8174
2023-02-08 11:37:59 -05:00
Brad King
6736743f09 Merge topic 'doc-FetchContent-catch2'
6d48f48d5d FetchContent: Bump documented example Catch2 to v3.0.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8172
2023-02-08 11:36:26 -05:00
Eisuke Kawashima
6d48f48d5d FetchContent: Bump documented example Catch2 to v3.0.1
The previous Catch2 v2.13.4 does not compile on some platforms [1].

[1] https://github.com/catchorg/Catch2/issues/2326
2023-02-07 10:54:25 -05:00
Kyle Edwards
652f34eab9 FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ON
Fixes: #24395
2023-02-07 10:38:20 -05:00
Brad King
8c61f15cdc Merge topic 'avoid-cmake-cfg-intdir'
2b17b6da6a cmGlobalGenerator: Avoid referencing CMAKE_CFG_INTDIR
f34876561f Tests: Remove or silence instances of ${CMAKE_CFG_INTDIR}
78cf427157 RULE_LAUNCH_*: Add support for generator expressions
cabad8a37f ExternalProject: Always use $<CONFIG> for source files
62e8884d3f CTestTargets: Use $<CONFIG> instead of ${CMAKE_CFG_INTDIR}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8169
2023-02-07 09:52:32 -05:00
Brad King
9492ca9a3f Merge topic 'KateImprovements'
e7f7bff4f5 Kate: improve the way the VCS-specific files are searched
96389b4cd3 Kate: add support for hg and fossil
4c32623f5f Help: fix typo in docs for set_property()
9a7612d2d0 Kate: make it possible to force a mode for the "files" entry
8a7aa2642b Help: add documentation for Kate-related variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8154
2023-02-07 09:48:23 -05:00
Brad King
60911f4ebc Merge topic 'android-ndk-legacy-toolchain'
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8170
2023-02-07 09:32:20 -05:00
Brad King
5d40cf45fa Merge topic 'android-ndk-legacy-toolchain' into release-3.26
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8170
2023-02-07 09:32:19 -05:00
Brad King
da5c90ae2e Merge topic 'FindCUDAToolkit-nvrtc-builtins'
9688a8ebc2 FindCUDAToolkit: Fix `nvrtc_builtins_static` library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8162
2023-02-07 09:00:36 -05:00
Brad King
7aee115ff4 Merge topic 'FindCUDAToolkit-nvrtc-builtins' into release-3.26
9688a8ebc2 FindCUDAToolkit: Fix `nvrtc_builtins_static` library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8162
2023-02-07 09:00:35 -05:00
Brad King
6cb6a2fabe Merge topic 'docfix'
d3ece40602 Help: cmake (1): remove -E server as not available
b19036d8b3 Help: CheckSource{Compiles,Runs}: fix typo and clarify

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8164
2023-02-07 08:57:46 -05:00
Brad King
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file
This variable has been provided since commit 746906242d (Android: Detect
NDK version number, 2021-02-26, v3.20.0-rc3~1^2~3) when using CMake's
NDK support or the modern NDK toolchain file.  Since commit 005e2cdfb0
(Android: Do not use gold for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2)
we need the value in our compiler/platform information files, so provide
it when using the NDK legacy toolchain file too.

Revert commit 1c86e397fe (Android/Clang: Tolerate undefined
CMAKE_ANDROID_NDK_VERSION, 2022-09-16, v3.25.0-rc1~118^2) since the
variable should now always be defined.

Issue: #21772
Fixes: #24386
2023-02-06 17:17:25 -05:00
Alexander Neundorf
9a7612d2d0 Kate: make it possible to force a mode for the "files" entry
By default, kate will try to autodetect whether the project is
a svn or git checkout or not.
In case this does not give a satisfying result, the user can now
set CMAKE_KATE_FILES_MODE to the mode he wants.
2023-02-06 10:21:19 -05:00
scivision
b19036d8b3 Help: CheckSource{Compiles,Runs}: fix typo and clarify 2023-02-06 09:55:23 -05:00
Paul Taylor
9688a8ebc2 FindCUDAToolkit: Fix nvrtc_builtins_static library name
Update the change from commit 2a94c762ed (FindCUDAToolkit: Add support
for CUDA::nvrtc_static, 2023-01-20, v3.26.0-rc1~55^2).  The lib is named
`libnvrtc-builtins_static.a`, not `libnvrtc_builtins_static.a`.
2023-02-06 09:36:43 -05:00
Brad King
bfe24f1764 Merge topic 'compiler-id-flags-with-quotes'
7201bc072c CompilerId: Fix handling of CMAKE_<LANG>_FLAGS with quotes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8158
2023-02-06 09:25:37 -05:00
Alexander Neundorf
8a7aa2642b Help: add documentation for Kate-related variable 2023-02-03 23:19:13 +01:00
Kyle Edwards
cabad8a37f ExternalProject: Always use $<CONFIG> for source files 2023-02-03 11:23:32 -05:00
Kyle Edwards
62e8884d3f CTestTargets: Use $<CONFIG> instead of ${CMAKE_CFG_INTDIR} 2023-02-03 11:15:44 -05:00
Russell Greene
7201bc072c CompilerId: Fix handling of CMAKE_<LANG>_FLAGS with quotes
Use `separate_arguments` to correctly parse arguments with quotes.

Fixes: #24385
2023-02-03 10:39:22 -05:00
Lisanna
5e8e5d4744 FindOpenCL: Add default install locations on Windows
Add the default install locations when OpenCL is built and installed
from source on Windows.
2023-02-03 09:05:13 -05:00
Lisanna
9b6eb2c909 FindPNG: Add default install locations on Windows
Add the default install locations when PNG is built and installed
from source on Windows.
2023-02-03 09:02:31 -05:00
Brad King
71f9c1943d FindImageMagick: Fix documentation syntax in usage example 2023-02-01 13:58:23 -05:00
Brad King
ce0139a1df Merge topic '_hm_swift_threads_pthread'
d7963aa9ee FindThreads: Filter -pthread out for compatibility with Swift linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8142
2023-02-01 09:09:52 -05:00
Brad King
2f5b0ac34e Merge topic 'CMakePackageConfigHelpers-ARCH_INDEPENDENT'
77982de955 CMakePackageConfigHelpers: only emit arch check if needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8133
2023-01-31 09:33:53 -05:00
Harry Mallon
d7963aa9ee FindThreads: Filter -pthread out for compatibility with Swift linker 2023-01-31 09:11:08 +00:00
Brad King
1c4825066b Merge topic 'msvc-showIncludes'
8f82e755f3 Ninja: Fix detection of MSVC showIncludes prefix in Italian
d6e7e4d4a1 Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languages
9596305c0b Tests: Generalize RunCMake.Ninja ShowIncludes test infrastructure
c6dd4fa21d Tests: Extend RunCMake.Ninja ShowIncludes case with sample path
a9d97492fd Ninja: Record showIncludes detection in configure log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8129
2023-01-30 10:23:31 -05:00
Andrea Pappacoda
77982de955 CMakePackageConfigHelpers: only emit arch check if needed
Before this patch, the write_basic_package_version_file() function of
the CMakePackageConfigHelpers module always emitted an architecture
check, even if the ARCH_INDEPENDENT option was specified. While this is
not an issue when configuring builds, as the check is skipped, this can
create issues when the "arch independent" version files are installed in
the datadir (e.g. /usr/share) in a MultiArch environment like Debian,
where different architecture packages of the same libraries can be
coinstalled; as the amd64 version of a given library contains "8 * 8"
in the file, while the i386 one contains "4 * 8", there's a conflict, as
files in /usr/share are expected to be identical across architectures.

This patch fixes this issue by only emitting the architecture check code
if needed; when ARCH_INDEPENDENT is specified, no code is written at
all.

Here's a diff between the version files generated before and after this
patch:

    diff -u old/indep.cmake new/indep.cmake
    --- old/indep.cmake	2023-01-29 13:43:04.840671117 +0100
    +++ new/indep.cmake	2023-01-29 13:57:28.475191551 +0100
    @@ -52,19 +52,3 @@
     endif()

    -# if the installed project requested no architecture check, don't perform the check
    -if("TRUE")
    -  return()
    -endif()
    -
    -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
    -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
    -  return()
    -endif()
    -
    -# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
    -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
    -  math(EXPR installedBits "8 * 8")
    -  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
    -  set(PACKAGE_VERSION_UNSUITABLE TRUE)
    -endif()
    diff -u old/no-indep.cmake new/no-indep.cmake
    --- old/no-indep.cmake	2023-01-29 13:42:05.010710508 +0100
    +++ new/no-indep.cmake	2023-01-29 13:57:40.914237219 +0100
    @@ -52,13 +52,8 @@
     endif()

    -# if the installed project requested no architecture check, don't perform the check
    -if("FALSE")
    -  return()
    -endif()
    -
     # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
    -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
    +if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "")
       return()
     endif()

Fixes: #24375
2023-01-29 14:00:13 +01:00
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