summaryrefslogtreecommitdiffstats
path: root/Modules/Internal
Commit message (Collapse)AuthorAgeFilesLines
* CheckCompilerFlag: Revert 'Match the Clang "argument unused" output ...'Brad King2023-03-132-3/+8
| | | | | | | | | | | | | | Revert commit 5b45a3d0ce (CheckCompilerFlag: Match the Clang "argument unused" output for all languages, 2023-01-23, v3.26.0-rc1~38^2). It broke existing projects that were silently tolerating unrelated unused arguments in their checks for C and CXX. For example, using `CFLAGS=-nostdinc` or `CXXFLAGS=-nostdinc++` causes those flags to be used when driving the linker as well, and Clang warns they are unused in that case. Add a test case covering the now-restored behavior. Fixes: #24591
* CheckCompilerFlag: Match the Clang "argument unused" output for all languagesKOLANICH2023-01-242-8/+3
| | | | | | Improve detection of missing compiler flags: move "argument unused during compilation: .*" pattern from language-specific branches into the common list.
* Modules: Record system inspection steps in the configure logBrad King2023-01-181-2/+2
| | | | | | | | 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-183-33/+1
| | | | | | | | | | `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
* 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.
* Source: Fix a few typosVitaly Stakhovsky2023-01-171-2/+2
|
* CheckCompilerFlag: Add Swift SupportEvan Wilde2022-11-041-0/+2
| | | | | Plumb through Swift `check_compiler_flag` support. Add tests to check that valid flags work and invalid flags don't.
* CheckSourceCompiles: For Swift executable, name source 'main.swift'Evan Wilde2022-10-241-2/+6
| | | | | | | | | | | | | | | | Xcode uses its own heuristics to determine whether or not to accept top-level code in a source file while Ninja uses the swift driver heuristics. With the Swift driver, if the module contains a single file, that file will be parsed as a top-level code context. With Xcode, the single file will only be parsed as top-level code if the name of that file is 'main.swift'. To ensure more consistent behavior between the two generators, if we're building Swift and the try-compile target type is executable or undefined, we name the file `main.swift` to ensure that both will handle the single file as top-level code.
* CheckSourceCompiles: Add support for SwiftEvan Wilde2022-10-241-0/+3
| | | | | Plumb through swift `check_source_compiles` support. Add tests to check that valid swift sources compile and invalid sources don't.
* Merge topic 'cpack-nsis-uninstaller'Brad King2022-10-111-5/+14
|\ | | | | | | | | | | | | 8721658959 CPack/NSIS: Fix installer not waiting for uninstaller to finish Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7774
| * CPack/NSIS: Fix installer not waiting for uninstaller to finishMika Fischer2022-10-101-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit b795c96727 (CPack/NSIS: Fix uninstall command when run from installer, 2022-03-21, v3.23.0-rc5~9^2~1) we incorrectly removed the `_?` parameter when calling the uninstaller during installation. This parameter is however essential for ExecWait to actually wait for the uninstaller to finish. Without it, the uninstaller is started in the background and installer and uninstaller run at the same time. See https://nsis.sourceforge.io/Docs/Chapter3.html#installerusageuninstaller Add back the `_?` parameter to fix this regression. Use another approach to solve the problem motivating the original change. Fixes: #24041
* | Modules: Use new SOURCES_FROM_* try_compile (1/2)Matthew Woehlke2022-09-273-10/+9
| | | | | | | | | | | | | | | | | | | | | | Modify some modules that ship with CMake to use the new SOURCES_FROM_* arguments to try_compile / try_run as added by commits cb14ae2b87 (try_compile: Add SOURCE_FROM_{ARG,VAR}, 2022-09-21) and 611d801790 (try_compile: Add SOURCE_FROM_FILE, 2022-09-22). This covers users which previously either used an existing file (but sometimes needed to rename it), or which wrote out their source in entirety. It does NOT cover users that actually need configure_file functionality, as those will be more involved to update and will thus be tackled in part 2.
* | Modules: Use new keyword-dispatched try_compile signatureMatthew Woehlke2022-09-143-5/+3
| | | | | | | | | | | | | | | | | | | | | | Modify most of the modules that ship with CMake to use the new try_compile / try_run signatures added by commit aa9220d3a0 (try_compile: Add keyword-dispatched signature, 2022-09-02). This improves debugging by each invocation using its own directory so that the results of multiple invocations can be retained. This does not cover any invocations which provide an entire project, as that flavor of try_compile has not yet been updated.
* | CPack: re-use paths of tools discovered by CMakeFindBinUtilsMatteo Martelli2022-09-062-18/+18
| | | | | | | | | | | | | | | | `CMakeFindBinUtils.cmake` sets `CMAKE_<TOOL>` variables that in cross-compilation environments point to the toolchain specific executables: e.g. `CMAKE_OBJCOPY` might point to `<path_to_toolchain>/arm-poky-linux-gnueabi-objcopy`. Pass this information to CPack.
* | Merge topic 'cpack-nuget-components-on-windows'Brad King2022-05-191-1/+3
|\ \ | |/ | | | | | | | | | | 066ff258db CPack/NuGet: Restore component packaging on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7280
| * CPack/NuGet: Restore component packaging on WindowsAlex Turbov2022-05-181-1/+3
| | | | | | | | | | | | | | | | | | The change from `\` to `/` in commit dade75509f (CPack/NuGet: Fix nuspec file generation for UNIX-style OS, 2020-12-21, v3.20.0-rc1~243^2) does not work on Windows. Use `cmake_path` to form a path to an image directory with preinstalled files. Fixes: #22489
* | CPack/NSIS: Fix several typos in the NSIS templateSadie Powell2022-05-031-22/+22
| |
* | Merge topic 'CheckCompilerFlags-revert-linker-warnings'Brad King2022-04-221-0/+9
|\ \ | |/ | | | | | | | | | | | | | | 4941887d7d CheckCompilerFlags: Revert "Catch linker warning about ignored flags" c2341ece47 CheckLinkerFlag: Catch linker warning when the checked flag is ignored Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7190
| * CheckLinkerFlag: Catch linker warning when the checked flag is ignoredBrad King2022-04-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 219dde4ea8 (CheckPIESupported: now uses any SYSROOT settings, 2022-01-16, v3.23.0-rc1~110^2), the checks for `-pie` and `-no_pie` on macOS failed due to executing the compiler directly without any `-isysroot`, producing `ld: library not found for -lc++`. See issues #23053 and #19180. The failing check for `-pie` was a bug because it is supported on macOS, both for `x86_64` and `arm64`, and the commit fixed that check. However, `-no_pie` is not supported on macOS `arm64`. The above commit was only able to detect that due to commit f745e0497e (CheckCompilerFlags: Catch linker warning about ignored flags, 2022-01-03, v3.23.0-rc1~174^2), which we need to revert due to issue #23432. Instead, catch only the linker warning about the exact flag being checked.
* | Merge topic 'check-flag-fembed-bitcode-conflict'Brad King2022-04-111-0/+69
|\ \ | |/ | | | | | | | | | | a10fc754a6 CheckSourceCompiles: Avoid linker warning with -fembed-bitcode Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7156
| * CheckSourceCompiles: Avoid linker warning with -fembed-bitcodeCraig Scott2022-04-091-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the Apple linker sees -headerpad_max_install_names and bitcode is enabled with a flag like -fembed-bitcode, it issues a warning and ignores the -headerpad_max_install_names flag. This causes unrelated compiler and linker flag checks to fail for valid flags. In f745e0497e (CheckCompilerFlags: Catch linker warning about ignored flags, 2022-01-03), we started detecting linker warnings, which caused a regression for projects that were setting -fembed-bitcode in their CMAKE_CXX_FLAGS or similar. Prevent that regression by removing the -headerpad_max_install_names linker flag when we know it will warn and be ignored anyway. Fixes: #23390 Issue: #23408
* | Merge topic 'CheckCompilerFlag-restore-env'Brad King2022-04-081-2/+2
|\ \ | |/ | | | | | | | | | | | | 9dd585d12c CheckCompilerFlag: Fix regression in locale environment preservation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7153
| * CheckCompilerFlag: Fix regression in locale environment preservationBrad King2022-04-071-2/+2
| | | | | | | | | | | | | | Fix a typo from commit 660e0d80ae (internal/CheckCompilerFlag: rely on common configuration, 2022-01-12, v3.23.0-rc1~124^2~1) that caused locale environment variables to not be restored after they are set during the check.
| * Merge topic 'productbuild-rootVolumeOnly' into release-3.23Brad King2022-03-221-6/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | 2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains 95eb8cbcfc CPack: Avoid space / tab mix in productbuild distribution.xml template 28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7092
| * \ Merge topic 'cpack-nsis-fix-uninstall-quoting' into release-3.23Brad King2022-03-221-3/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5d2ceaada8 CPack/NSIS: Add support for unquoted (legacy) uninstaller strings b795c96727 CPack/NSIS: Fix uninstall command when run from installer Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7096
* | \ \ Merge topic 'productbuild-rootVolumeOnly'Brad King2022-03-221-6/+5
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | 2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains 95eb8cbcfc CPack: Avoid space / tab mix in productbuild distribution.xml template 28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7092
| * | | productbuild: Don't write rootVolumeOnly attribute if writing domainsCraig Scott2022-03-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The rootVolumeOnly attribute is deprecated. Apple docs say to use domains instead. Fixes: #23343
| * | | CPack: Avoid space / tab mix in productbuild distribution.xml templateCraig Scott2022-03-211-6/+6
| |/ /
* | | Merge topic 'cpack-nsis-fix-uninstall-quoting'Brad King2022-03-221-3/+5
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 5d2ceaada8 CPack/NSIS: Add support for unquoted (legacy) uninstaller strings b795c96727 CPack/NSIS: Fix uninstall command when run from installer Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7096
| * | CPack/NSIS: Add support for unquoted (legacy) uninstaller stringsMarc Jeanmougin2022-03-211-0/+4
| | |
| * | CPack/NSIS: Fix uninstall command when run from installerMarc Jeanmougin2022-03-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | The quoting introduced by commit eb3b3bacdc (CPack/NSIS: Fix uninstall on Windows using "Apps & Features", 2021-09-13, v3.22.0-rc1~136^2) created two errors in the uninstaller call: double quoting of the uninstaller executable, and quotes added to the `_?=` argument which does not support them. Simplify the command.
* | | CPack/RPM: Honor CPACK_RPM_<component>_PACKAGE_ variables when set OFFPhilip Bailey2022-02-081-1/+1
| |/ |/| | | | | Fixes: #23182
* | CPack/NSIS: Fix description not displayed for componentsJohnny Jazeix2022-01-291-2/+1
| | | | | | | | Fixes: #23151
* | Check{Compiler,Linker}Flag: Add possibility to retrieve check outputsMarc Chevrier2022-01-193-1/+24
| |
* | CheckLinkerFlag: rely now on internal implementationMarc Chevrier2022-01-141-0/+35
| | | | | | | | | | This internal implementation share the configuration with CheckCompilerFlag.
* | internal/CheckCompilerFlag: rely on common configurationMarc Chevrier2022-01-142-64/+79
| | | | | | | | | | Extract configuration step from the CheckCompilerFlag command to enable to share it with future CheckLinkerFlag implementation
* | FreeBSD: fix up the package nameAdriaan de Groot2021-12-211-1/+1
| | | | | | | | | | | | | | | | | | When using libpkg, the output filename is determined by libpkg itself, based on information in the manifest: package name and version, basically. This doesn't necessarily match the name that CMake has determined via CPACK_TEMPORARY_PACKAGE_FILE_NAME or CPACK_PACKAGE_FILE_NAME. So reset the CMake-determined list to match what libpkg will do.
* | CPack: Remove undocumented deprecated OSXX11 generatorBrad King2021-11-052-0/+0
| | | | | | | | | | | | | | | | This CPack generator was never documented, and has been deprecated since commit 2ed00e8ef8 (CPack: Deprecate OSXX11 generator, 2020-01-31, v3.17.0-rc1~45^2). Issue: #20235
* | CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecturemakise-homura2021-10-151-0/+8
|/ | | | | | | | | | | "OS Elbrus" (OSL for short), a reference Linux distro for E2K (Elbrus) platform may have broken dpkg-shlibdeps, that doesn't specify dependencies correctly. In this case, the only reliable way is to explicitly set dependencies of libc6 and lcc-libs, and then warn user to let him know this list may be incomplete. This commit does that. This fix has no effect on correctly working dpkg-shlibdeps, so when this bug will be fixed in new versions of OSL, CPack will work as expected with these distros.
* CPack/NSIS: Fix uninstall on Windows using "Apps & Features"Andras Lasso2021-09-141-1/+1
| | | | | | | | 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
* Merge topic 'host-distro-info'Brad King2021-08-242-0/+79
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * cmake_host_system_information: Can run fallback scriptsAlex Turbov2021-08-202-0/+79
| |
* | Merge topic 'nsis_ignore_license_page'Brad King2021-08-031-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 795e406e3b CPack/NSIS: Add option to not display license page Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6422
| * | CPack/NSIS: Add option to not display license pageJohnny Jazeix2021-08-011-1/+1
| |/ | | | | | | Fixes: #22215
* | Merge topic 'cpack-rpm-pre-semicolon'Brad King2021-08-031-3/+1
|\ \ | |/ |/| | | | | | | | | | | 3cdf23985f CPackRPM: avoid a spurious `;` in the `%pre` and other sections with scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !6415
| * CPackRPM: avoid a spurious `;` in the `%pre` and other sections with scriptsArtur Samarin2021-08-021-3/+1
| | | | | | | | | | | | | | This was accidentally added by commit 34c8a23044 (CPackRPM: add scriplets tags only if scripts exist, 2021-04-01, v3.21.0-rc1~387^2). Fixes: #22501
* | Merge topic 'cpack-deb-lib-multiarch'Brad King2021-07-131-2/+4
|\ \ | | | | | | | | | | | | | | | | | | 68b961d361 CPack/DEB: Add postinst/postrm ldconfig for multi-arch lib dirs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6341
| * | CPack/DEB: Add postinst/postrm ldconfig for multi-arch lib dirsAlex Turbov2021-07-121-2/+4
| | | | | | | | | | | | Fixes: #22411
* | | Merge topic 'cpack-deb-post-ops'Brad King2021-07-131-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 805fa791d1 CPack/DEB: Avoid overriding user-provided `postinst` and `postrm` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6335
| * | CPack/DEB: Avoid overriding user-provided `postinst` and `postrm`Alex Turbov2021-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user provides `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA` or `CPACK_DEBIAN_<comp>_PACKAGE_CONTROL_EXTRA` variables in `CMakeLists.txt` and the package contains dynamic libraries, the `CPackDeb.cmake` sets `CPACK_ADD_LDCONFIG_CALL` to `1`. Later it analyzes if defaulted `postinst`/`postrm` should be generated trying to check if the user provides any in `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA` variable. However, the `foreach` loop uses the invalid variable `PACKAGE_CONTROL_EXTRA` instead, so these files gonna be overridden. Fix the variable name. Fixes: #22410