Commit Graph

4683 Commits

Author SHA1 Message Date
Brad King
d95ac61225 Merge topic 'cxx-module-extensions'
45d1925efc Treat '.ccm', '.cxxm', and '.c++m' files as C++ sources
8c96d145c1 Tests/RunCMake: Match 'Tried extensions' output more robustly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8308
2023-03-10 11:08:11 -05:00
Brad King
8c96d145c1 Tests/RunCMake: Match 'Tried extensions' output more robustly 2023-03-09 14:35:05 -05:00
Brad King
2c146a7fc5 FindCUDA: Add policy to remove this module
The `FindCUDA` module has been deprecated since CMake 3.10.
Add a policy to pretend it doesn't exist in order to encourage
projects to port away from it.
2023-03-09 07:39:36 -05:00
Brad King
e5845b25d2 Merge topic 'test-minver'
edf7888f70 Tests: Update RunCMake.include cmake_minimum_required version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8298
2023-03-08 09:02:31 -05:00
Brad King
edf7888f70 Tests: Update RunCMake.include cmake_minimum_required version
This was missed in commit 1edf138506 (Tests/RunCMake: Update
cmake_minimum_required versions, 2023-02-06).

Also tighten up some expected stderr content to catch these
cases during similar updates in the future.
2023-03-07 17:47:26 -05:00
Kyle Edwards
f1aedf2240 Tests/RunCMake: Add script to auto-generate RunCMake test suite stub 2023-03-07 14:30:29 -05:00
Brad King
2e8e5c2cf0 Merge topic 'Xcode-frameworks-consumption'
ce1bdec3a4 Xcode: Fix missing Frameworks search paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8288
2023-03-07 08:48:40 -05:00
Marc Chevrier
ce1bdec3a4 Xcode: Fix missing Frameworks search paths
Fixes: #24541
2023-03-06 09:15:48 -05:00
Brad King
5613d7ed9f Merge topic 'GoogleTest-type-param-suite'
9aa9032266 GoogleTest: Restore suite name for type-parametrized tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8282
2023-03-06 08:53:41 -05:00
Brad King
9aa9032266 GoogleTest: Restore suite name for type-parametrized tests
Fix a regression from commit 073dd1bd81 (GoogleTest: Change format for
typed tests, 2022-02-07, v3.23.0-rc1~4^2) in the suite name detection.

Co-authored-by: Evgeniy Shcherbina <ixsci@pm.me>
Fixes: #24563
2023-03-03 10:38:02 -05:00
Brad King
697ca5d51c Merge topic 'ExternalProject-revert-install'
771387523a ExternalProject: Restore driving install through build system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8279
2023-03-03 09:22:46 -05:00
Brad King
87330a10e2 Merge topic 'ninja-multi-output-path-prefix'
df38eaab2c Ninja Multi-Config: Write output path prefix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8280
2023-03-03 09:18:34 -05:00
Kyle Edwards
def618f1ae Merge topic 'TargetRunTimeDllDirs'
a2c9c4f202 Add test for the new TARGET_RUNTIME_DLL_PATHS genex
aa68de0a27 TARGET_RUNTIME_DLLS: minor refactoring of shared-check.cmake
2ce3d62ffb Help: add documentation for the new TARGET_RUNTIME_DLL_DIRS genex
c351dcd967 TARGET_RUNTIME_DLL_DIRS: add the new genex to cmGeneratorExpressionNode
064c3244da TARGET_RUNTIME_DLLS: fix test for this genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8247
2023-03-02 16:28:30 -05:00
Kyle Edwards
df38eaab2c Ninja Multi-Config: Write output path prefix
Fixes: #24566
2023-03-02 15:10:53 -05:00
Brad King
771387523a ExternalProject: Restore driving install through build system
Revert commit 66b5d51f38 (ExternalProject: Install CMake projects
using 'cmake --install', 2022-09-08, v3.25.0-rc1~150^2).
It changed the ExternalProject install step command from:

    cmake --build <dir> --target install --config <cfg>

to:

    cmake --install <dir> --config <cfg>

The latter command no longer runs the external project build system
during the install step.  We could consider using the commands:

    cmake --build <dir> --target all --config <cfg>
    cmake --install <dir> --config <cfg>

as the install step, but if `CMAKE_SKIP_INSTALL_ALL_DEPENDENCY` is
used in the external project, that can change semantics too.

Revert the original change pending further investigation on other ways
to support its motivating use case.  Add a test covering the
previously-regressed use case.

Fixes: #24567
Issue: #23946
2023-03-02 14:28:26 -05:00
Brad King
5fe186ade7 Merge topic 'target_sources-backtrace'
b909be9e23 target_sources: Fix backtrace on missing source
4a3e79048b Tests: Add RunCMake.target_sources case covering missing source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8268
2023-03-02 10:07:31 -05:00
Brad King
1d7fb31778 Merge topic 'Apple-handle-Text-Stubs'
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
fcbd723a50 Enhance support functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !8204
2023-03-02 09:53:03 -05:00
Marc Chevrier
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
Fixes: #24123
2023-03-01 12:23:28 +01:00
Brad King
b909be9e23 target_sources: Fix backtrace on missing source
If a source file is not found, the error message reports a backtrace.
Previously the backtrace pointed at where the target was created.
In the case of `target_sources`, the missing source may have been
named elsewhere.

Fixes: #24538
2023-02-28 18:07:36 -05:00
Brad King
4a3e79048b Tests: Add RunCMake.target_sources case covering missing source 2023-02-28 17:50:31 -05:00
Brad King
2e469212c8 Dart,FindDart: Add policy to remove these modules
These modules and the "DART" tool they support have long been replaced
by CTest.
2023-02-28 08:43:45 -05:00
Brad King
12d041b8f7 Merge topic 'target_sources-file_set-no-exist'
7e3f9aa1b2 target_sources: give a hint when a file named `FILE_SET` is not found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8253
2023-02-28 08:32:04 -05:00
Brad King
40539096fd Merge topic 'dll-name-soversion'
a7f9c7da26 Add option to add SOVERSION to DLL names
9694504adc Tests: Simplify RunCMake.TargetArtifacts spec
3cd34eb279 Tests: Rename RunCMake.{ArtifactOutputDirs => TargetArtifacts}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8021
2023-02-28 08:29:20 -05:00
Ralf Habacker
a7f9c7da26 Add option to add SOVERSION to DLL names
Add variable/target property `[CMAKE_]DLL_NAME_WITH_SOVERSION`.

Fixes: #24251
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2023-02-27 09:18:34 -05:00
Brad King
9ae0402198 Merge topic 'install-prefix-genex-install-code-script'
18e02ace5b install(CODE|SCRIPT): Support $<INSTALL_PREFIX> genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8251
2023-02-27 09:06:20 -05:00
Alexander Neundorf
a2c9c4f202 Add test for the new TARGET_RUNTIME_DLL_PATHS genex
For one of the shared libraries the RUNTIME_OUTPUT_PATH
is set to a subdir and the test is supposed to check that
those directories appear in TARGET_RUNTIME_DLL_PATHS genex
2023-02-26 16:37:37 +01:00
Alexander Neundorf
aa68de0a27 TARGET_RUNTIME_DLLS: minor refactoring of shared-check.cmake
Renamed variables and text which mentions dlls to items, since
we can use this check also for testing the directories.
2023-02-26 16:37:37 +01:00
Craig Scott
57f09a818c Merge topic 'fetchcontent-reject-CMAKE_TOOLCHAIN_FILE-env-var'
c15674a9cb FetchContent: Reject CMAKE_TOOLCHAIN_FILE env var in sub-build
31ef93f19f FetchContent: Only use @-@ replacements for sub-build CMakeLists.txt

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8248
2023-02-25 17:16:37 -05:00
Ben Boeckel
7e3f9aa1b2 target_sources: give a hint when a file named FILE_SET is not found
`FILE_SET` is only supported within `target_sources()` and only directly
after a visibility keyword or another `FILE_SET`. Give a hint as to what
might be wrong if a file named `FILE_SET` cannot be found for any
reason.

Fixes: #24539
2023-02-24 17:43:22 -05:00
Brad King
9694504adc Tests: Simplify RunCMake.TargetArtifacts spec 2023-02-24 15:23:10 -05:00
Brad King
3cd34eb279 Tests: Rename RunCMake.{ArtifactOutputDirs => TargetArtifacts}
Generalize the name so we can add other kinds of artifact checks.
2023-02-24 15:00:32 -05:00
Kyle Edwards
18e02ace5b install(CODE|SCRIPT): Support $<INSTALL_PREFIX> genex
Fixes: #24534
2023-02-24 10:17:45 -05:00
Brad King
88b75204e5 Merge topic 'PATH-genex-handle-list-of-paths'
e395310a21 PATH-genex: handle lists for path decomposition and transformations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8238
2023-02-24 08:35:19 -05:00
Brad King
7552276e6e Merge topic 'GenerateExportHeader-Fix-Clang-support-on-Windows'
1e19936320 GenerateExportHeader: Fix Clang support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Adrien De Coninck <deconinck.adrien@gmail.com>
Merge-request: !8221
2023-02-24 08:33:23 -05:00
Craig Scott
c15674a9cb FetchContent: Reject CMAKE_TOOLCHAIN_FILE env var in sub-build
The sub-build should never try to use a toolchain file. The toolchain file
may itself be getting downloaded by FetchContent. If the
CMAKE_TOOLCHAIN_FILE environment variable is set, CMake uses it to
initialize the CMake variable of the same name. We need to explicitly
clear them before the first project call of the sub-build.

Fixes: #24535
2023-02-24 17:17:36 +11:00
Brad King
df9c4b1872 find_package: Use <PACKAGENAME>_ROOT variables as search prefixes
Extend commit eb35d8884b (find_package: Use PackageName_ROOT variables
as search prefixes, 2018-03-15, v3.12.0-rc1~349^2) to also check
upper-case `<PACKAGENAME>_ROOT` variables.  Add policy `CMP0144` to
enable the behavior in a compatible way.

Fixes: #24403
2023-02-23 09:15:14 -05:00
Corentin Damman
1e19936320 GenerateExportHeader: Fix Clang support on Windows
When using Clang with Visual Studio, the GenerateExportHeader function
generates the DEPRECATED definition "__attribute__ ((__deprecated__))",
because Clang can compile such instruction. However, if a user wants to compile
the library with this generated header with MSVC, the declaration is not valid.

We suggest to always use the DEPRECATED definition "__declspec(deprecated)" on
Windows, which is valid for both Clang and MSVC.
2023-02-23 09:19:06 +01:00
Alexander Neundorf
064c3244da TARGET_RUNTIME_DLLS: fix test for this genex
In a95cbf38 multiple files were renamed, and check.cmake slipped
through, and the test did actually not work correctly since then.
This patch renames check.cmake to its correct name shared-check.cmake.
2023-02-22 23:59:58 +01:00
Marc Chevrier
e395310a21 PATH-genex: handle lists for path decomposition and transformations
Fixes: #24371
2023-02-21 19:34:43 +01:00
Abdelmaged Khalifa
ea2a05f402 Add variable CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY
Add CMake variable `CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY` to enable
option `DEPENDS_EXPLICIT_ONLY` on all uses of `add_custom_command`.

Fixes: #17097
2023-02-17 17:12:12 +02:00
Brad King
51c7917072 Merge topic 'deprecate-extra-generators'
ef5a4d964b Deprecate "extra" generators in favor of cmake-file-api(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8211
2023-02-16 11:44:05 -05:00
scivision
848f7b0a81 cmake -E time: use C++11 chrono and better format output
fixes #24415
2023-02-15 10:53:14 -05:00
Brad King
ef5a4d964b Deprecate "extra" generators in favor of cmake-file-api(7)
The "extra" generators were created in CMake's early years to provide
support for users of specific IDEs by directly generating their project
files alongside make or ninja files.  Nowadays the file-api provides a
more generic, maintainable, well-tested, and robust way for IDEs to view
CMake project build trees.  Deprecate the legacy "extra" generators to
encourage the corresponding IDEs to use the file-api.

Fixes: #19090
2023-02-15 10:48:26 -05:00
Brad King
b297b63f17 Merge topic 'AutoExport-vftable'
f513781bc5 WINDOWS_EXPORT_ALL_SYMBOLS: Export vftable symbol

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8201
2023-02-15 08:58:44 -05:00
Brad King
e2ed34abf8 Merge topic 'ninja-custom-command-depends'
082ccd7530 add_custom_command: Add DEPENDS_EXPLICIT_ONLY option for Ninja

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8198
2023-02-15 08:57:32 -05:00
Malcolm Bechard
f513781bc5 WINDOWS_EXPORT_ALL_SYMBOLS: Export vftable symbol
`pybind11` requires access to this symbol to link in some cases.
Include this symbol when generating automatic exports via
`CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS`.

Fixes: #24406
2023-02-14 09:11:45 -05:00
Abdelmaged Khalifa
082ccd7530 add_custom_command: Add DEPENDS_EXPLICIT_ONLY option for Ninja
Add option `DEPENDS_EXPLICIT_ONLY` to `add_custom_command` to indicate
that implicit dependencies coming from users of the output are not
needed, and only consider dependencies explicitly specified in the
custom command.

Fixes: #17097
2023-02-14 08:56:59 -05:00
Brad King
6cf281b108 Tests: Add dedicated RunCMake.ExtraGenerators test
The `Simple_${extraGenerator}` tests do not actually need to compile
because they only smoke test CMake's generation of the extra project
files.
2023-02-13 18:15:29 -05:00
Brad King
93edb4d0c0 Merge topic 'deprecate-pre-3.5'
3a4791548d Deprecate compatibility with CMake versions older than 3.5
1edf138506 Tests/RunCMake: Update cmake_minimum_required versions
65a1c379ee Tests/CTestTest*: Update cmake_minimum_required versions
589e6fdcd1 Tests: Update cmake_minimum_required versions in a few tests
3092b14ed0 Tests: Teach RunCMake to optionally ignore policy version deprecation warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8192
2023-02-13 09:08:23 -05:00
Brad King
49f32b27ed Merge topic 'test-https-connections'
3350c17451 ci: Enable file(DOWNLOAD) TLS_VERIFY test case in CI jobs
17b47da3d8 Tests: Add test for file(DOWNLOAD) with TLS_VERIFY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8194
2023-02-11 06:33:20 -05:00