summaryrefslogtreecommitdiff
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'findopenssl-static-findpkg-fix' into release-3.26Brad King2023-02-081-2/+8
|\ | | | | | | | | | | | | | | 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
| * FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ONKyle Edwards2023-02-071-2/+8
| | | | | | | | Fixes: #24395
* | FetchContent: Bump documented example Catch2 to v3.0.1Eisuke Kawashima2023-02-071-3/+3
|/ | | | | | The previous Catch2 v2.13.4 does not compile on some platforms [1]. [1] https://github.com/catchorg/Catch2/issues/2326
* Merge topic 'android-ndk-legacy-toolchain' into release-3.26Brad King2023-02-072-1/+3
|\ | | | | | | | | | | | | cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8170
| * Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain fileBrad King2023-02-062-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge topic 'FindPython-CMP0007-NEW' into release-3.25Brad King2023-01-241-0/+2
| |\ | | | | | | | | | | | | | | | | | | 486b3c0850 FindPython: Policy CMP0007 must be set to NEW Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8104
* | \ Merge topic 'FindCUDAToolkit-nvrtc-builtins' into release-3.26Brad King2023-02-071-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 9688a8ebc2 FindCUDAToolkit: Fix `nvrtc_builtins_static` library name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8162
| * | | FindCUDAToolkit: Fix `nvrtc_builtins_static` library namePaul Taylor2023-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | | Help: CheckSource{Compiles,Runs}: fix typo and clarifyscivision2023-02-064-20/+62
|/ / /
* | | FindImageMagick: Fix documentation syntax in usage exampleBrad King2023-02-011-10/+4
| | |
* | | Merge topic '_hm_swift_threads_pthread'Brad King2023-02-011-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | FindThreads: Filter -pthread out for compatibility with Swift linkerHarry Mallon2023-01-311-1/+1
| | | |
* | | | Merge topic 'CMakePackageConfigHelpers-ARCH_INDEPENDENT'Brad King2023-01-315-68/+19
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 77982de955 CMakePackageConfigHelpers: only emit arch check if needed Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8133
| * | | CMakePackageConfigHelpers: only emit arch check if neededAndrea Pappacoda2023-01-295-68/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge topic 'msvc-showIncludes'Brad King2023-01-301-1/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Ninja: Fix detection of MSVC showIncludes prefix in ItalianBrad King2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prefix does not have two colons. Update our regex. Fixes: #24357
| * | | | Ninja: Record showIncludes detection in configure logBrad King2023-01-271-0/+6
| |/ / / | | | | | | | | | | | | Also avoid running the detection multiple times.
* | | | FindImageMagick: Define targets for specific componentshstejas2023-01-271-40/+77
|/ / / | | | | | | | | | | | | | | | | | | - 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.
* | | OpenWatcom: Add correct support for 16-bit WindowsJiri Malak2023-01-255-33/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge topic 'CheckCompilerFlag-clang'Brad King2023-01-253-8/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | CheckCompilerFlag: Match the Clang "argument unused" output for all languagesKOLANICH2023-01-243-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | Improve detection of missing compiler flags: move "argument unused during compilation: .*" pattern from language-specific branches into the common list.
* | | | Merge topic 'FindOpenMP-test-include-dir'Brad King2023-01-251-1/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6e53d74147 FindOpenMP: Use OpenMP_<lang>_INCLUDE_DIR Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8110
| * | | | FindOpenMP: Use OpenMP_<lang>_INCLUDE_DIRAndrey Alekseenko2023-01-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | OpenWatcom: Refactor population of standard include directoriesJiri Malak2023-01-246-61/+38
| | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | | Merge topic 'gen-pkg-example'Brad King2023-01-241-5/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfa61ccf64 Help: Modernize PackageConfigHelpers example Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8111
| * | | | | Help: Modernize PackageConfigHelpers exampleFeRD (Frank Dana)2023-01-231-5/+7
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge topic 'FindPython-CMP0007-NEW'Brad King2023-01-241-0/+2
|\ \ \ \ \ | |/ / / / |/| | | / | | |_|/ | |/| | | | | | | | | | 486b3c0850 FindPython: Policy CMP0007 must be set to NEW Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8104
| * | | FindPython: Policy CMP0007 must be set to NEWMarc Chevrier2023-01-211-0/+2
| | | | | | | | | | | | | | | | Fixes: #24306
* | | | Merge topic 'find_cudatoolkit_add_nvrtc_static'Brad King2023-01-231-1/+13
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2a94c762ed FindCUDAToolkit: Add support for CUDA::nvrtc_static Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8100
| * | | | FindCUDAToolkit: Add support for CUDA::nvrtc_staticRobert Maynard2023-01-201-1/+13
| | |/ / | |/| |
* | | | Merge topic 'FindOpenSP-pkg-config-hints'Brad King2023-01-231-34/+39
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| | | | | | | 3b1c19f00a FindOpenSP: Use pkg-config only as hints for main code path Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8097
| * | FindOpenSP: Use pkg-config only as hints for main code pathKefu Chai2023-01-201-34/+39
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * FindCUDAToolkit: Handle CUDA::nvToolsExt not existingRobert Maynard2023-01-161-1/+1
| | | | | | | | Fixes #24275
| * Merge topic 'implicit-includes' into release-3.25Brad King2023-01-131-2/+3
| |\ | | | | | | | | | | | | | | | | | | | | | 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
| * \ Merge topic 'IntelLLVM-msvc-no-cxx11' into release-3.25Brad King2023-01-131-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 88f9fdcb03 IntelLLVM: Avoid unnecessary -Qstd=c++11 flag on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8069
* | \ \ Merge topic 'configure-log'Brad King2023-01-201-2/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | cmake --system-information: Stop dumping CMake{Output,Error}.logBrad King2023-01-191-2/+0
| | | | | | | | | | | | | | | | | | | | CMake no longer logs system information to these files.
* | | | | Merge topic 'ninja-swift-exported-executables'Brad King2023-01-201-2/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4165eb3d0b Ninja: Emit swiftmodule from executable with exports Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8048
| * | | | | Ninja: Emit swiftmodule from executable with exportsEvan Wilde2023-01-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | CYGWIN: Drop pre-2.8.4 compatibility mode CMAKE_LEGACY_CYGWIN_WIN32Brad King2023-01-191-45/+0
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge topic 'configure-log'Brad King2023-01-1945-344/+97
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | Modules: Record system inspection steps in the configure logBrad King2023-01-1811-47/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-1835-260/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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
| * | | | | UsewxWidgets: Remove leftover debugging codeBrad King2023-01-181-29/+0
| | | | | |
| * | | | | FindQt4: Drop outdated advice to look at CMakeError.log on failureBrad King2023-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The find module does not write information to the log.
| * | | | | GHS: Drop debugging message from logBrad King2023-01-181-2/+0
| | | | | |
| * | | | | CompileFeatures: Warn explicitly when feature detection binary is not foundBrad King2023-01-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | This step is not normally expected to fail, so warn instead of logging it.
| * | | | | CompilerId: Restore logging of failed identificationsBrad King2023-01-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge topic 'FindLibLZMA_quote'Brad King2023-01-191-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b4be607701 FindLibLZMA: Fix failure when no include directories are needed Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8088
| * | | | | | FindLibLZMA: Fix failure when no include directories are neededEven Rouault2023-01-181-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | Quote the value of `INTERFACE_INCLUDE_DIRECTORIES` to ensure `set_target_properties` gets matching property/value pairs.