1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-09 15:38:15 +08:00

85 Commits

Author SHA1 Message Date
Brad King
f106df8f96 cmGlobalVisualStudio8Generator: Remove unused Configure method override
It has not been needed since commit c85367f408 (VS: Compute project
GUIDs deterministically, 2015-06-02, v3.4.0-rc1~496^2)
2024-05-10 14:20:52 -04:00
Brad King
a4d532e998 VS: Restore Windows SDK selection with platform in generator name
Refactoring in commit e259063b0a (VS: Defer Windows SDK selection until
CMAKE_GENERATOR_PLATFORM is known, 2023-03-31, v3.27.0-rc1~206^2~5)
accidentally dropped the Windows SDK selection code path for VS
generators named with the old-style platform suffix.

Fixes: #25007
2023-06-22 11:22:08 -04:00
Brad King
f0a67b6291 VS: Parse comma-separated fields from CMAKE_GENERATOR_PLATFORM 2023-04-05 12:06:22 -04:00
Brad King
e259063b0a VS: Defer Windows SDK selection until CMAKE_GENERATOR_PLATFORM is known
Prepare to teach `CMAKE_GENERATOR_PLATFORM` to affect SDK selection.
2023-04-05 12:06:22 -04:00
NAKAMURA Takumi
0e58a5ea07 Source: Fix possible IWYU warnings in Windows generators 2021-11-20 00:50:33 +09:00
Brad King
f97f8537f3 VS: Model a default target framework
Add fields to the VS generator to select a target framework.
Migrate the existing default for VS 12 .NET CF for Windows CE.

Report the values in `CMAKE_VS_*` variables and use them for
the CSharp compiler id project too.

Issue: #22849
2021-11-06 06:08:54 -04:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Alexander Boczar
7c944da757 VS: Add target property to explicitly control solution deployment
Add a `VS_SOLUTION_DEPLOY` property to control solution deploy mark.

Fixes: #20346
2020-02-25 10:24:23 -05:00
Vitaly Stakhovsky
bbc07e4561 Source: use std::string in place of const char* 2020-01-29 14:31:01 -05:00
Sebastian Holtermann
735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02:00
Wil Stark
917c035ada VS: support suppressing deployment of selected targets
Add a `VS_NO_SOLUTION_DEPLOY` target property to explicitly specify for
each target whether to suppress VS solution deployment of the generated
target project.

Fixes: #18953
2019-02-25 09:14:15 -05:00
Brad King
40a732800d VS: Clarify global generator constructor interface
Make the constructors protected since they should be produced through
factories.  Also rename `platform{ => InGenerator}Name` to clarify
the meaning of the argument.
2019-01-10 09:38:35 -05:00
Brad King
6d99406e69 VS: Move ExpressEdition member to top-level generator
We no longer support any VS versions that pre-date introduction of
express editions.
2019-01-10 07:52:49 -05:00
Brad King
03f74a16cd VS: Convert GetIDEVersion to non-virtual table lookup 2019-01-10 07:52:48 -05:00
Vitaly Stakhovsky
77d83568e0 cmGlobalVisualStudioGenerator::GetIDEVersion(): const added 2019-01-02 08:25:49 -05:00
Vitaly Stakhovsky
94632087b2 Add missing override 2018-12-30 12:32:55 -05:00
Brad King
eb80af9093 Drop Visual Studio 8 2005 generator
This generator has been deprecated since CMake 3.9.  Remove it.
2018-04-02 10:08:10 -04:00
Vitaly Stakhovsky
cfe4e2db1f VS: Use 'override' keyword for overridden methods in generator classes
The corresponding 'virtual' removed.
2017-12-15 21:17:49 -05:00
Brad King
6e66fe5f97 cmGlobalVisualStudio8Generator: Drop unused GetDocumentation method
This has been moved to the factory.
2017-04-19 14:45:00 -04:00
Beeble
4cd815f0b3 VS: Pass whole target to WriteProjectConfigurations 2017-04-05 13:37:45 -04:00
Yves Frederix
427b6da9e5 VS: Teach cmake --build to reconfigure if needed before building
Visual Studio's build system does not cleanly handle itself being
re-generated during the build.  Teach `cmake --build` to check whether
the build system needs to be re-generated before launching the native
build tool.
2016-11-17 13:53:42 -05:00
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Kitware Robot
d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* 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.
2016-05-16 16:05:19 -04:00
Brad King
571bedec29 VS: Ignore USE_FOLDER property on VS versions that do not support it
Solution folders are supported on VS 8 and above in the full versions
and on VS 11 and above in the express versions.
2016-04-26 08:22:27 -04:00
Brad King
0c58d2d0fd VS: Detect VS 8 and 9 Express editions 2016-04-26 08:16:19 -04:00
Stephen Kelly
6cac952b9e VS: Port interface to cmGeneratorTarget 2015-10-24 09:24:43 +02:00
Stephen Kelly
b13e26e278 VS: Port ProjectDepends to cmGeneratorTarget. 2015-10-24 09:24:30 +02:00
Stephen Kelly
eac15298a8 cmState: Move TargetType enum from cmTarget.
Mostly automated:

 values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType")
 for i in "${values[@]}"; do     git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
2015-10-15 00:41:39 +02:00
Stephen Kelly
21f428f4c0 VisualStudio: Replace Compute override with AddExtraIDETargets override. 2015-10-05 18:43:18 +02:00
Stephen Kelly
5edb335485 cmGlobalGenerator: Virtualize the Compute step and override it. 2015-07-30 08:28:31 +02:00
Stephen Kelly
c7b79aa16a cmGlobalGenerator: Require a cmake instance in ctor.
It is required anyway, so this makes it explicit.
2015-05-27 09:18:31 -04:00
Brad King
2f4bb4e9b0 VS: Do not accumulate configurations globally (#15577)
Drop the VS >= 7 generator's global Configurations member and instead
lookup configurations using cmMakefile::GetConfigurations where needed.
This avoids accumulating all CMAKE_CONFIGURATION_TYPES values ever
encountered by a project() or enable_language() command and allows
the final value to be used in each directory.  We don't officially
support per-directory CMAKE_CONFIGURATION_TYPES values but we certainly
should not generate configurations not in the final value in the top
level directory.
2015-05-21 09:06:49 -04:00
Stephen Kelly
dad8b03fbe VS: Remove obsolete methods.
Base class implementations for these are identical.
2015-05-19 11:02:34 -04:00
Stephen Kelly
a48aebcb67 cmLocalGenerator: Require a parent in the constructor.
Pass the parent though cmGlobalGenerator::CreateLocalGenerator.

This will make it easy to initialize state scopes independent of
cmMakefile.
2015-04-28 07:50:52 +02:00
Brad King
b97736a23d VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
For VS generator names that do not specify the platform name, read
CMAKE_GENERATOR_PLATFORM to get it.

Extend the RunCMake.GeneratorPlatform test with a case covering
use of the x64 platform when the test generator is a Visual Studio
generator whose name does not specify a platform.
2014-09-05 15:03:56 -04:00
Gilles Khouzam
fe161dc30d VS: Refactor logic deciding to add "Deploy" to the .sln file
Move the condition to a "NeedsDeploy" virtual method that can be
overridden by more recent VS generators.
2014-07-31 10:46:00 -04:00
Brad King
f5c0efdbe4 cmGlobalGenerator: Create a non-virtual 'DoGenerate' method
Make the virtual 'Generate' method protected.  Make 'DoGenerate'
the main entry point to generation.  This gives cmGlobalGenerator
a chance to do some early operations before the individual
generator-specific implementations take over.
2014-07-22 15:05:36 -04:00
Brad King
6e176e6d9e VS: Delay platform definitions until system name is known
Move the definition of CMAKE_VS_PLATFORM_NAME and other variables that
are not needed by CMakeDetermineSystem out of the AddPlatformDefinitions
method and into a SetSystemName method.  The latter may later use
CMAKE_SYSTEM_NAME to decide what platform-specific definitions to add.
2014-07-17 16:34:21 -04:00
Brad King
eeb60102e8 VS: Refactor CMAKE_FORCE_*64 platform definitions
Remove the general infrastructure for these additional platform
definitions and hard-code the only two special cases that used
it.  They are only for historical reasons so no new such cases
should be added.
2014-07-17 16:17:35 -04:00
Ben Boeckel
1a1b737c99 stringapi: Use strings for generator names 2014-03-08 13:05:38 -05:00
Ben Boeckel
c3833c7da4 stringapi: Use strings for VS project names 2014-03-08 13:05:33 -05:00
Stephen Kelly
ef25ba8d06 Constify handling of target dependencies. 2013-12-11 15:30:11 +01:00
Brad King
5f5c92b9a2 VS: Add internal APIs to find MSBuild, devenv/VCExpress, and msdev
Teach the VS generators to compute the locations of these tools directly
from registry entries.  Add internal APIs to get the locations on demand.
2013-11-18 08:26:24 -05:00
Brad King
e478f03469 VS: Fix CMAKE_SUPPRESS_REGENERATION bad ZERO_CHECK dependency (#14378)
When CMAKE_SUPPRESS_REGENERATION tells us not to create the ZERO_CHECK
target we should not add dependencies on it from other targets either.

Reviewed-by: Mateusz Loskot <mateusz@loskot.net>
2013-08-28 08:57:12 -04:00
Patrick Gansterer
b02f09d434 VS: Replace ArchitectureId with PlatformName
Since we do not need the information about the target architecture
we can use the PlatformName only to specify the this information.
This also removes setting of the MSVC_*_ARCHITECTURE_ID variable
which is not required, because this variable gets set by the
compiler detection code in CMAKE_DETERMINE_COMPILER_ID_CHECK().
2013-08-05 13:38:26 +02:00
Patrick Gansterer
4b15dc855d VS: Set CMAKE_VS_PLATFORM_NAME for VS7 and VS71 too
Move the code which sets CMAKE_VS_PLATFORM_NAME from
cmGlobalVisualStudio8Generator to cmGlobalVisualStudio7Generator.
2013-08-05 13:38:23 +02:00
Patrick Gansterer
3a1006e41f VS: Added "Deploy" at project configuration for WindowsCE targets 2012-11-27 08:31:20 -05:00
Patrick Gansterer
038df9e49e VS: Allow setting the name of the target platform
Since the name for a target platform is independent of its cpu
architecture an additional option is required to set it correctly.
2012-11-27 08:31:18 -05:00
Patrick Gansterer
6fe4fcba78 VS: Add parser for WCE.VCPlatform.config to read WinCE platforms
Parse the WCE.VCPlatform.config file, which contains the installed
WindowsCE SDKs in XML format, and add possibility to generate
Visual Studio generators for them.
2012-11-27 08:31:17 -05:00