Teach the VS 2015 generator to produce a WindowsTargetPlatformVersion
value. Use the CMAKE_SYSTEM_VERSION to specify the version and if not
set choose a default based on available SDKs. Activate this behavior
when targeting Windows 10.
Co-Author: Brad King <brad.king@kitware.com>
Refactor the local generator creation API to accept a
cmState::Snapshot. Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent. Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.
This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
We never implemented them for VS 11 (2012), 12 (2013), or 14 (2015).
For VS 10 (2010) the reload macro does not work correctly when run from
inside a build launched through the IDE because stopping the build kills
the CMake that is driving the reload. Fortunately VS >= 10 know how to
reload the whole solution anyway.
The Ninja build system does not support a in-file verbositiy switch.
Instead teach 'cmake --build' to extract the CMAKE_VERBOSE_MAKEFILE
setting and pass it as an optional '-v' argument to Ninja. This can
serve as a reasonable fallback.
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
CMake requires both the Desktop SDK and the correct platform SDK
(Windows Phone or Windows Store) to be installed when targeting the
Windows mobile platforms. Verify that the right platform components are
installed and give a more detailed error message when something is
wrong.
Nsight Tegra 2.0 will be revision '8'. Generate this revision number
and add a NsightTegraUpgradeOnceWithoutPrompt element to tell newer
versions not to prompt when upgrading the generated project file.
When CMAKE_SYSTEM_NAME is 'Android', check for an installation of
'NVIDIA Nsight Tegra Visual Studio Edition' and generate .vcxproj
files for the "Tegra-Android" platform. Also make the installed
version available in a CMAKE_VS_NsightTegra_VERSION variable.
When CMAKE_SYSTEM_NAME is 'WindowsCE':
* Set the Subsystem and EntryPointSymbol accordingly.
* When CMAKE_SYSTEM_VERSION is 8.0 (Windows CE 2013),
select the CE800 toolset by default.
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.
Move handling of an empty toolset name into the implementation of the
method. This simplifies the VS 10 implementation of default toolset
selection because it has one code path that is always called.
Move the member from cmGlobalVisualStudio10Generator to
cmGlobalVisualStudio7Generator to make it useful for earlier
versions of VS. Set the member to true only starting with
cmGlobalVisualStudio8Generator since we will not implement
MASM support for versions less than VS 8.
Teach the VS >= 10 generators to recognize these system names and select
the appropriate default toolset for the system version. Report an error
when the version is not known to be supported by VS.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
Add boolean members to the VS >= 10 global generator to save
whether CMAKE_SYSTEM_NAME is WindowsPhone or WindowsStore
without having to repeat a string comparison.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
Add a virtual cmGlobalVisualStudio10Generator::InitializeSystem method
called from SetSystemName once the SystemName and SystemVersion members
have been populated. This will give VS version-specific generators a
chance to recognize and adapt to the target system.
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.
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.
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.
Delay use of CMAKE_GENERATOR_TOOLSET until the CMakeSystem.cmake
file has been configured and loaded during the first project() or
enable_language() command. This gives the toolchain file named by
CMAKE_TOOLCHAIN_FILE a chance to set CMAKE_GENERATOR_TOOLSET. This
point is still early enough to set the generator toolset prior to
the initialization of any languages that might use the toolset.
The cmake::GeneratorToolset member variable remains an indication
of what was specified by the -T option or loaded from the cache.
It does not need to be updated based on the toolchain file setting.
The cmMakefile::TryCompile can still pass cmake::GeneratorToolset
into the inner instance because the try-compiled project will do
platform and language initialization using the CMakeSystem module
configured for the outer project.
Extend the RunCMake.GeneratorToolset test with cases that use a
toolchain file to set CMAKE_GENERATOR_TOOLSET.
Divide the cmGlobalVisualStudio10Generator "PlatformToolset" member into
two members representing the generator-selected default toolset and the
user-specified CMAKE_GENERATOR_TOOLSET value. Prefer the user-specified
value, if any, and then fall back to the generator-selected default.
Since commit 5f5c92b9 (VS: Add internal APIs to find MSBuild,
devenv/VCExpress, and msdev, 2013-11-13) the VS generators have
known how to lookup the locations of their build tools directly.
Expose this information to CMake language code by defining new
variables to hold the paths to these tools.
Drop the "Modules/CMakeVS*FindMake.cmake" files. Override the
cmGlobalGenerator::FindMakeProgram method for VS generators to use their
internal APIs to locate the build tool. Set the CMAKE_MAKE_PROGRAM as a
normal variable for use by project code, but do not cache it. This will
allow CMake and CTest to select the proper tool at build time.
All cmGlobalGenerator::GenerateBuildCommand call sites that need to
produce a string now generate "cmake --build" commands. The remaining
call sites immediately pass the result to cmSystemTools::RunSingleCommand.
Avoid the intermediate string and argument parsing by directly producing a
vector of strings. Also drop the ignoreErrors argument because no call
sites remain that use it.
Rename the Visual Studio >= 10 generators to indicate the version year:
Visual Studio 10 => Visual Studio 10 2010
Visual Studio 11 => Visual Studio 11 2012
Visual Studio 12 => Visual Stduio 12 2013
Report the names with the year to the list of available generators so
that the cmake-gui drop-down shows the years. When selecting a
generator from the "-G" option or from an existing CMAKE_GENERATOR cache
entry, recognize names without the years for compatibility and map them
to the names with years.
Update the generator names in the cmake-generators.7 manual.
The MSBuild version for each Visual Studio generator isn't 4.0. With
Visual Studo 2013 the ToolsVersion moved from being tied to the .NET
framework and now has its own version number.
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().