Commit Graph

377 Commits

Author SHA1 Message Date
Brad King 4747b64fff VS: Restore include_external_msproject type detection
Refactoring in commit 3882718872 (VS: Decouple solution generation from
`.sln` file format, 2025-09-15) accidentally left out automatic
detection of the external project type id from its file extension.
2025-09-29 16:47:46 -04:00
Brad King d32b78f139 cmGlobalVisualStudio7Generator: Factor out computation of path to .sln 2025-09-18 11:56:37 -04:00
Brad King 6b1c101410 cmGlobalVisualStudioGenerator: Adopt more solution generation methods 2025-09-17 09:40:22 -04:00
Brad King 3882718872 VS: Decouple solution generation from .sln file format
Rewrite `.sln` generation using a structured intermediate representation.

Issue: #25887
2025-09-17 09:40:07 -04:00
Brad King 76266f9df6 cmGlobalVisualStudioGenerator: Adopt some solution generation methods
All versions of VS we still support use the Solution model.
2025-09-16 11:33:13 -04:00
Brad King 50f87b4bf2 cmGlobalGenerator: Simplify collection of targets under a project() 2025-09-16 11:32:27 -04:00
Brad King d48a9e1111 Merge topic 'vs-cleanup'
a5cb4fe1c6 cmGlobalVisualStudioGenerator: Remove unused code left from VS 7.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11149
2025-09-05 09:40:38 -04:00
Brad King a5cb4fe1c6 cmGlobalVisualStudioGenerator: Remove unused code left from VS 7.1
Since commit c94f1bcf92 (Drop Visual Studio 7 .NET 2003 generator,
2017-04-19, v3.9.0-rc1~248^2) we no longer need special solution-level
target dependencies.  We use `LinkLibraryDependencies` instead.
2025-09-04 12:30:02 -04:00
Brad King 54e7008e2d Merge topic 'vs-cleanup'
78d9564d50 cmGlobalVisualStudio7Generator: Inline short method at only call site
034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods
5004602715 cmGlobalVisualStudio7Generator: Factor folder collection out of write method
6ae4ed30d9 cmGlobalVisualStudio7Generator: Factor target collection out of write method
5582eb292e cmGlobalVisualStudio7Generator: Update outdated comment
2297ba9399 cmGlobalVisualStudio7Generator: Remove redundant C++ modules check
ccbd61dd53 cmGlobalVisualStudio7Generator: Remove unused member
93e34a5e0e cmGlobalGenerator: Constify GetTargetDirectDepends
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11130
2025-09-02 10:56:09 -04:00
Brad King 78d9564d50 cmGlobalVisualStudio7Generator: Inline short method at only call site 2025-09-01 15:25:19 -04:00
Brad King 034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods 2025-09-01 15:25:19 -04:00
Brad King 5004602715 cmGlobalVisualStudio7Generator: Factor folder collection out of write method 2025-09-01 15:25:19 -04:00
Brad King 6ae4ed30d9 cmGlobalVisualStudio7Generator: Factor target collection out of write method 2025-09-01 15:25:18 -04:00
Brad King 5582eb292e cmGlobalVisualStudio7Generator: Update outdated comment 2025-09-01 15:25:18 -04:00
Brad King 2297ba9399 cmGlobalVisualStudio7Generator: Remove redundant C++ modules check
In commit 386465bf83 (cmTarget: add support for C++ module fileset
types, 2022-04-08, v3.25.0-rc1~624^2~7) we added two calls to the same
check in the VS generators.  Remove one.
2025-09-01 15:25:18 -04:00
Brad King ccbd61dd53 cmGlobalVisualStudio7Generator: Remove unused member 2025-09-01 15:25:18 -04:00
Brad King fe9b7acc4a Merge topic 'vs7-generator-utility-target-typo'
93a83bcc00 cmGlobalVisualStudio7Generator: fix initialization typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11100
2025-08-27 10:48:18 -04:00
Ben Boeckel 93a83bcc00 cmGlobalVisualStudio7Generator: fix initialization typo
Typo introduced in b82a74d918 (generators: use GetSupportDirectory() in
more places, 2025-05-21) via !10812. Pointed out in a PVS-Studio blog
post.

See: https://pvs-studio.com/en/blog/posts/cpp/1277/ (N3)
2025-08-20 22:45:13 -04:00
Daniel Pfeifer ee1c32b6d7 source: Pass cmBuildOptions by value 2025-07-30 11:55:34 -04:00
Brad King b10daadd08 Deprecate Visual Studio 14 2015 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2025-06-26 09:27:24 -04:00
Ben Boeckel b82a74d918 generators: use GetSupportDirectory() in more places 2025-05-23 11:39:53 +02:00
Kitware Robot 1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot 0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Brad King 381c446ff7 VS: Remove support for appending a platform to the generator name
Compatibility with CMake versions prior to 3.1 is no longer supported.

Fixes: #26481
2025-01-21 08:08:22 -05:00
Lauri Vasama 0bb13ba0e6 VS: Add support for Visual Studio solution items
Files listed in the `VS_SOLUTION_ITEMS` directory property of a project
directory are added as solution items in the 'Solution Items' solution
directory.

If `source_group` is applied to the files listed in `VS_SOLUTION_ITEMS`,
solution groups matching the names of the source groups are created
outside of the default 'Solution Items' group.  If not items are placed
into the default group, it is not created.

Solution items added to subprojects are not included in the top-level
project.

Closes: #26409
2024-11-22 09:12:19 -05:00
Lauri Vasama f1bcb7276a VS: Refactor solution folder creation
* Add cmVisualStudioFolder struct containing names of projects within
  that folder.
* Separate folder creation out of WriteTargetsToSolution into a new
  CreateSolutionFolders function.
2024-11-20 18:10:25 +02:00
Brad King 241f923a6f Drop Visual Studio 12 2013 generator
This generator has been deprecated since CMake 3.28.  Remove it.
2024-08-28 14:13:05 -04:00
Brad King 03c31b0395 Drop Visual Studio 9 2008 generator
This generator has been deprecated since CMake 3.27.  Remove it.
2024-05-08 10:37:34 -04:00
Brad King 88c70dde34 cmGlobalVisualStudioGenerator: Use member 'Version' more directly 2024-05-08 10:37:34 -04:00
Vitaly Stakhovsky 1a49b439a5 Source: Use cmValue::IsOn and IsOff
Speed up a bit by calling members directly.
2024-03-17 19:05:37 -04:00
Brad King 5c77facd78 VS: Fix Intel plugin version detection fallback
Do not read a value that was not parsed.
2023-11-22 09:53:26 -05:00
Ben Boeckel 197a6bf171 cxxmodules: rework control logic for scanning regular C++ sources
Now that scanning support is no longer experimental, the logic for
whether or not to scan C++ 20 sources is now important because all
projects are now exposted to the logic. Make the scanning rules explicit
in the documentation and rework the queries to localize all of the
associated logic.

A policy to handle the ultimate fallback logic will be implemented in a
following commit.
2023-10-02 10:17:31 -04:00
Brad King 863891adb2 Merge topic 'modules-better-messages'
571b5e1f2c cxxmodules: improve error messages for C++ module setup
8b4d32c18b cmStandardLevelResolver: add query for the effective standard level
17ddc4ac76 cmStandardLevelResolver: compare with static string literals
6f1dae2b01 cmStandardLevelResolver: use `cmStrCat` where possible
0d45d40e13 cmStandardLevelResolver: use character literals where possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8755
2023-08-25 11:27:27 -04:00
Ben Boeckel 571b5e1f2c cxxmodules: improve error messages for C++ module setup
Make it clear that:

- the quoted string is a target name; and
- C++ sources that export modules is the important detail.
2023-08-23 16:47:29 -04:00
Ben Boeckel 809248a0c9 strings: use character literals where possible 2023-07-27 20:00:59 -04:00
Ben Boeckel 7137b17835 cmStrCat: use in Windows-specific sources 2023-07-27 20:00:59 -04:00
Ben Boeckel 3f1378fbca strings: compare to static string_view instances in Windows-only code 2023-07-27 19:10:39 -04:00
Brad King 75b573a628 Deprecate Visual Studio 12 2013 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2023-06-26 12:41:18 -04:00
Brad King 536c1de1d4 Drop Visual Studio 11 2012 generator
This generator has been deprecated since CMake 3.25.  Remove it.
2023-06-13 14:20:48 -04:00
Brad King 04b0d5c862 codespell: Fix typos 2023-05-22 16:51:15 -04:00
Marc Chevrier e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Brad King d7f440c5db Deprecate Visual Studio 9 2008 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2023-02-08 11:49:27 -05:00
Kitware Robot 33abef7416 Revise C++ coding style using clang-format-15
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 15.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #24315
2023-01-18 16:20:47 -05:00
Ben Boeckel 707172c66e clang-tidy: fix readability-use-anyofallof lints 2022-11-29 12:39:45 -05:00
Ben Boeckel 362d6cd234 clang-tidy: fix modernize-raw-string-literal lints 2022-11-29 12:39:45 -05:00
Ben Boeckel 4deab0a75c clang-tidy: fix readability-braces-around-statements lints 2022-11-29 12:39:45 -05:00
Ben Boeckel 714a466eeb clang-tidy: fix readability-container-size-empty lints 2022-11-29 12:39:45 -05:00
Ben Boeckel 6d2aa54d62 clang-tidy: fix performance-unnecessary-copy-initialization lints 2022-11-29 12:39:44 -05:00
Ben Boeckel b72c45e39f clang-tidy: fix readability-else-after-return lints 2022-11-29 12:39:29 -05:00
Ben Boeckel 07172aa31e clang-tidy: fix readability-redundant-string-cstr lints 2022-11-29 12:39:29 -05:00