Commit Graph

196 Commits

Author SHA1 Message Date
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
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 e435f875ec VS: Move version information to global generator. 2015-05-19 11:02:33 -04:00
Stephen Kelly b5f093f096 VS: Simplify setting of flag table. 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
Robert Goulet a6e4e73da3 VS: Add option to put INSTALL target in .sln default build
Add a CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD variable to control
this behavior.
2015-05-06 10:31:39 -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
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +02:00
Brad King 7b8e7c4ac3 Deprecate Visual Studio 7 generator (.NET 2002)
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2015-04-15 09:21:24 -04:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04: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
Brad King 987d4a1240 VS: Do not generate a BOM in .sln files
Revert commit v3.2.0-rc1~165^2 (Encoding:  Write Visual Studio solution
file with BOM, 2014-12-26).  The BOM breaks the VS IDE version selector
when loading the .sln from Windows Explorer.
2015-02-24 13:30:50 -05:00
Clinton Stimpson 61cf781a62 Encoding: Write Visual Studio solution file with BOM.
When configured to use UTF-8 internally, add a UTF-8 BOM
to generated .sln files for Visual Studio to correctly
handle them.
Otherwise, some versions of Visual Studio will read them
as ANSI encoded files.
2014-12-26 21:15:29 -07: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 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 848fab9575 cmGlobalVisualStudio7Generator: Remove unused variable 2014-07-22 15:24:57 -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 cb67509b06 VS: Remove unused parameter of WriteTargetConfigurations
The cmGlobalVisualStudio7Generator::WriteTargetConfigurations
'root' parameter is no longer used, so remove it.
2014-06-13 08:57:34 -04:00
Brad King 790e167718 VS: Fix subproject .sln dependencies on custom targets
Each project listed in a .sln must be marked (or not) as part of the
"default build" for each configuration.  For targets created by the
add_custom_target() command we add them to the default build if they
are not excluded in some way or if another target depends on them.
In the top-level .sln, a custom target is excluded if it is not
created with the ALL option to add_custom_target.  In subdirectory
.sln files, a target may also be excluded if it is not within the
directory and is brought into the solution only due to a dependency
from another target in the solution.

Fix the "IsPartOfDefaultBuild" and "IsDependedOn" methods to check
every target to be included in the .sln for a dependency on the
custom target.  Otherwise transitive dependencies through targets
not in the current subdirectory will not be considered.

Extend the SubProject test with a custom target to cover this case.

Reported-by: William Deurwaarder <William.Deurwaarder@tomtom.com>
Reported-by: Dirk Steenpass <dirk.steenpass@gmail.com>
2014-06-12 11:14:06 -04:00
Brad King 5fba44cf41 VS: Move VS-only API out of cmGlobalGenerator
Move the IsDependedOn method to cmGlobalVisualStudio7Generator
since that is the only caller.
2014-06-12 10:26:35 -04:00
Brad King 177d0ef15e Merge topic 'vs-vcproj-bool-case'
b684ce58 VS: Use lower-case boolean values in VS 7-9 (#14927)
2014-05-29 09:58:43 -04:00
Mark Salisbury b684ce58dd VS: Use lower-case boolean values in VS 7-9 (#14927)
The VS 7-9 IDEs parse .vcproj file boolean values in lower or upper
case.  The .NET XML parsing chokes on anything but "true", "false", "0",
"1".  Teach our generators to use lower-case names since they will work
for both parsers.  Our VS >= 10 flag tables already use lower-case.
2014-05-28 16:32:56 -04:00
Clinton Stimpson ee8cef8725 Encoding: If configured, write Visual Studio project files as UTF-8. 2014-03-14 08:48:42 -06: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 b3bf31a548 stringapi: Miscellaneous char* parameters 2014-03-08 13:05:37 -05:00
Ben Boeckel 84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -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
David Golub a79cbdc068 VS: Teach include_external_msproject about non-C++ projects (#14661)
Teach CMake to guess the project type guid based on the project file
extension.  This allows non-C++ projects like *.vbproj or *.csproj
to be included.
2013-12-20 11:02:11 -05:00
Stephen Kelly ef25ba8d06 Constify handling of target dependencies. 2013-12-11 15:30:11 +01:00
Clinton Stimpson 0b9906c2fb Windows: Use wide-character system APIs
Make CMake compile with -DUNICODE.  Make it possible for the 8 bit
encoding to eventually be UTF-8 instead ANSI.
2013-12-09 10:29:43 -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 0bfcb450e6 INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.
As an INTERFACE_LIBRARY has no direct link dependencies, we can
short-circuit in cmGeneratorExpressionEvaluator and
in cmGlobalGenerator::CheckLocalGenerators.

As they do not generate any output directly, any generate- or install-
related code acn also be short-circuited. Many of the local generators
already do this.

Because only INTERFACE related properties make sense on INTERFACE_LIBRARY
targets, avoid setting other properties, for example via defaults.
2013-11-25 16:17:50 +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
Brad King af40e8c312 VS: Detect Intel Fortran compiler id and version
Teach CMakeDetermineCompilerId to use a .vfproj project file to
build the Fortran compiler id source file under the Visual Studio
generators.
2013-10-18 09:55:59 -04:00
Brad King b8522a8c8a VS: Expose Intel Fortran .vfproj format version to CMake language
Lookup the Intel VS plugin version on demand in the VS global generator,
compute the corresponding .vfproj format version number, and memoize it.
Add it as a CMAKE_VS_INTEL_Fortran_PROJECT_VERSION platform definition.
2013-10-18 09:55:50 -04:00
Brad King 0c39a757da Drop the 'Full' field from cmDocumentationEntry
We need only 'Brief' for usage documentation.  We no longer have builtin
'Full' documentation, which is now in Help/*/*.rst files.
2013-10-16 09:22:37 -04:00
Stephen Kelly fe732264e9 Add the INTERFACE_LIBRARY target type.
This target type only contains INTERFACE_* properties, so it can be
used as a structural node. The target-specific commands enforce
that they may only be used with the INTERFACE keyword when used
with INTERFACE_LIBRARY targets. The old-style target properties
matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
this target type.

The name of the INTERFACE_LIBRARY must match a validity generator
expression. The validity is similar to that of an ALIAS target,
but with the additional restriction that it may not contain
double colons. Double colons will carry the meaning of IMPORTED
or ALIAS targets in CMake 2.8.13.

An ALIAS target may be created for an INTERFACE library.

At this point it can not be exported and does not appear in the
buildsystem and project files are not created for them. That may
be added as a feature in a later commit.

The generators need some changes to handle the INTERFACE_LIBRARY
targets returned by cmComputeLinkInterface::GetItems. The Ninja
generator does not use that API, so it doesn't require changes
related to that.
2013-10-07 19:56:31 -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