Commit Graph

87 Commits

Author SHA1 Message Date
Stephen Kelly ff8ac8ee6a cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
2015-08-28 18:44:39 +02:00
Stephen Kelly 9b6a743b80 cmLocalGenerator: Remove Parent pointer. 2015-08-28 18:44:38 +02:00
Stephen Kelly 5edb335485 cmGlobalGenerator: Virtualize the Compute step and override it. 2015-07-30 08:28:31 +02:00
Stephen Kelly 3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
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.
2015-05-27 09:18:32 -04: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
Stephen Kelly e435f875ec VS: Move version information to global generator. 2015-05-19 11:02:33 -04:00
Stephen Kelly 34c9ee2ed7 cmLocalGenerator: Require a global generator in the constructor.
Port generator factory methods to pass it.
2015-05-14 20:36:27 +02: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
Stephen Kelly 54d6a9187f cmMakefile: Rename GetCurrent{Output,Binary}Directory.
Match names used in CMake code.
2015-04-21 00:12:52 +02:00
Brad King 885ab9ab37 VS: Drop reload macros for VS >= 10 (#11258,#14680)
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.
2015-04-15 09:58:42 -04:00
Brad King 1e3843373f cmake: Show in --help how to select VS target platform (#15422)
* Re-order VS generators from newest to oldest.

* Show how to specify a VS generator with a target platform

* Increase the option output indentation to avoid extra wrapping
  with longer generator names.
2015-04-07 16:47:53 -04:00
Stephen Kelly 7916d7bac6 Include cmAlgorithms where it is used. 2015-03-11 00:17:29 +01:00
Gregor Jasny ce935ebe50 cmake: Teach --build to honor CMAKE_VERBOSE_MAKEFILE for Ninja
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>
2015-02-26 09:51:11 -05:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Gilles Khouzam b20a32ac73 VS: Improve error messages when compiler is not detected (#15228)
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.
2014-11-14 09:13:27 -05:00
Brad King 69e198dc3f VS: Generate Nsight Tegra project revision number
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.
2014-09-30 08:45:35 -04:00
Brad King 2f071466eb VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android'
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.
2014-09-29 16:05:52 -04:00
Pascal Bach a3298f7790 VS: Teach VS >= 10 generator about Windows CE
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.
2014-09-15 10:37:40 -04: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
Brad King 68d4280ac4 VS: Refactor internal default platform name selection
Rename the 'PlatformName' member to 'DefaultPlatformName' and make
sure it is only read through a 'GetPlatformName()' call.  This will
allow non-default names to be chosen later.
2014-09-05 14:02:58 -04:00
Brad King ad2a4776aa cmGlobalVisualStudio10Generator: Re-order some methods
Order SetSystemName and SetGeneratorToolset method declarations
and definitions as they are called.
2014-09-05 13:43:52 -04:00
Brad King 03b7b6cda1 cmGlobalGenerator: Call SetGeneratorToolset even for empty toolset
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.
2014-09-05 13:41:54 -04:00
Brad King a43f44000d VS: Move internal MasmEnabled member up to VS 7 generator
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.
2014-08-20 10:21:12 -04:00
Brad King d7938bff37 VS: Select WindowsPhone and WindowsStore default toolsets
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>
2014-07-31 14:08:46 -04:00
Brad King 3abd150ce9 VS: Save WindowsPhone and WindowsStore system internally
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>
2014-07-31 14:08:43 -04:00
Brad King 38065563b6 Merge topic 'vs10-system-hook'
e58f9753 VS: Add a hook to adapt to SystemName and SystemVersion
d0dd28fa VS: Save system name and version in global generator members
2014-07-29 08:52:24 -04:00
Brad King e58f97531a VS: Add a hook to adapt to SystemName and SystemVersion
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.
2014-07-28 16:26:00 -04:00
Brad King d0dd28fa92 VS: Save system name and version in global generator members
Add to cmGlobalVisualStudio10Generator members for SystemName and
SystemVersion and populate them in SetSystemName.
2014-07-28 16:25:08 -04:00
Gilles Khouzam 99e14a3865 cmGlobalVisualStudio10Generator: Fix typo KHLM => HKLM 2014-07-28 16:23:54 -04:00
Brad King 7a526c35f6 VS: Delay getting platform name in local generator
Ask the global generator during generation instead of trying
to store it up front.  Later the global generator may not know
the platform name when it is creating the local generator.
2014-07-17 16:59:53 -04:00
Brad King e7fdb44b1b VS: Delay detection of VS 10 Express 64-bit tools
Wait until SetSystemName when the CMAKE_SYSTEM_NAME is known.
Later the decision to use 64-bit tools may depend on it.
2014-07-17 16:35:41 -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
Brad King eaa9f2f8ee VS: Refactor internal generator factory logic
Consume the space before the platform name as soon as possible
instead of including it in the comparison.
2014-06-09 10:59:55 -04:00
Brad King 528e8af19f Allow a toolchain file to specify a generator toolset
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.
2014-06-04 14:27:02 -04:00
Brad King 98afb4549f VS: Split user- and generator-provided PlatformToolset
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.
2014-06-04 13:16:37 -04:00
Stephen Kelly c725bb3cbd Constify some APIs in generators. 2014-03-13 15:27:23 +01:00
Ben Boeckel 6557382dcf stringapi: Use strings for program paths 2014-03-08 13:05:38 -05:00
Ben Boeckel 1a1b737c99 stringapi: Use strings for generator names 2014-03-08 13:05:38 -05:00
Ben Boeckel 24b5e93de2 stringapi: Use strings for directories 2014-03-08 13:05:38 -05:00
Ben Boeckel 84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Ben Boeckel c3833c7da4 stringapi: Use strings for VS project names 2014-03-08 13:05:33 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Brad King 520ead7200 Merge topic 'cleanup-build-commands'
e420124 CMakeDetermineCompilerId: Use CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND
0c55729 VS: Add CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND variables
2013-12-05 09:24:59 -05:00
Brad King 0c55729c13 VS: Add CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND variables
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.
2013-12-04 11:05:05 -05:00
Stephen Kelly 4fe963f656 Use new cmHasLiteralPrefix function 2013-11-21 20:53:15 +01:00
Brad King 558c74d0ab VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
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.
2013-11-18 11:30:50 -05:00
Brad King 123a0608df Teach GenerateBuildCommand to find its own make program
Add a cmGlobalGenerator::SelectMakeProgram method to select a
caller-provided make program, the CMAKE_MAKE_PROGRAM cache entry, or a
generator-provided default.  Call it from all implementations of the
GenerateBuildCommand method with the corresponding generator's default,
if any.
2013-11-18 11:30:48 -05: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 8904d1410b cmGlobalGenerator: Cleanup GenerateBuildCommand API
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.
2013-11-18 08:26:21 -05:00