In VS <= 9 we already convert include paths to use backslashes
but the conversion was left out of the VS >= 10 generator.
Add the conversion now for consistency. VS 11 and 12 now require
it because they mistakenly interpret forward-slash options that
happen to occur in paths:
http://connect.microsoft.com/VisualStudio/feedback/details/778367
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.
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.
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.
Fix generation of the AdditionalIncludeDirectories element content to
escape for XML syntax. We already escape content of other elements,
this one was simply missing by accident.
Use the WIN32_EXECUTABLE target property only to set the SubSystem build
attribute default. When user-specified flags are later parsed they may
then override it.
9a76d83 VS12: Find proper MSBuild for VSProjectInSubdir test
4e5cb39 Merge branch 'master' into vs12-generator
78fdbbc FindBoost: Add -vc120 mangling for VS 12
e99d7b1 VS12: Generate flag tables from MSBuild v120 tool files
77ac9b8 VS12: Add Visual Studio 12 generator (#14251)
Run cmparseMSBuildXML.py on cl.xml, lib.xml, and link.xml to generate
our flag tables:
python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/v120/1033/cl.xml" > cmVS12CLFlagTable.h
python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/v120/1033/lib.xml" > cmVS12LibFlagTable.h
python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/v120/1033/link.xml" > cmVS12LinkFlagTable.h
Fix up the declaration names at the top of each file. Finally, teach
cmVisualStudio10TargetGenerator to select the version of the table
matching the version of VS.
In my project group we are using CMake to generate c++/cli winform
projects and I noticed the work done in commit 79ec7868 (VS: Add Windows
Forms Support, 2013-04-29) was in the right direction for solving some
of the problems we were facing.
The changes as submitted was breaking some functionality in our
projects, so I made some changes that fixes our problems and I believe
that it will also work for others.
* Resx files did not link correctly with the winform h-file so I added
the Resx configuration to the vcxproj file.
* I removed the functionality for setting <CLRSupport> true for the
project based on if an resx-file is pressent. This is preventing
us from using native cpp code. Also this do not address that some
projects will need to set other options like clr:pure, clr:safe.
This could be implemented as a cmake option, so it is possible to
specify exactly what is needed. Existing VSWindowsFormsResx Test
project is updated so it will be working with my changes.
Replace the cmLocalGenerator GetCompileOptions method with an
AddCompileOptions method since all call sites of the former simply
append the result to a flags string anyway.
Add a "lang" argument to AddCompileOptions and move the
CMAKE_<LANG>_FLAGS_REGEX filter into it. Move the call sites in each
generator to a location that has both the language and configuration
available. In the Makefile generator this also moves the flags from
build.make to flags.make where they belong.
Currently it only adds the contents of the COMPILE_FLAGS target
property, but it can be extended to handle a new COMPILE_OPTIONS
generator expression enabled property.
Generate the default AssemblerListingLocation through the flag map so
that it can be overridden by a user /Fa flag. Also teach the VS 7-9
generators to map /Fa to AssemblerListingLocation.
While at it, fix the AssemblerListingLocation default value to have a
trailing slash after the configuration name. This ensures it will be
treated as a directory and not a file name.
Add support to maintain designer functionality for Visual Studio C++
Windows Forms projects. Also add a test project showing how to use
the CMakeLists.txt file and, when successfully configured, will allow
use of the designer for the included form.
The MS tools create two types of PDB files as explained here:
http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspxhttp://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspxhttp://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspxhttp://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx
One is created by the compiler (/Fd) and the other by the linker (/pdb).
The two options should not specify the same file. Split them up.
In the VS IDE generators, simply drop ProgramDataBaseFileName to
take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb".
In the Makefile generators, set "/Fd" on the compile line to be
the directory containing object files (with a trailing slash the
compiler will add the "vc$(PlatformToolsetVersion).pdb" filename
automatically). Drop the /Fd option from the exe link command
line and add "/pdb" instead (already done for dll linking).
Update these rules for both MSVC and Intel tools.
Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC
libraries because the generated .pdb files are only from /Fd
and not real linker-generated .pdb files. Update documentation to
clarify that the PDB_* properties are only for linker .pdb files.
This regresses the PDBDirectoryAndName test for STATIC libraries.
Since it is not clear at this time what should be done for STATIC
library .pdb files, comment out the relevant portion of the test
and leave a TODO comment.
The API for retrieving per-config COMPILE_DEFINITIONS has long
existed because of the COMPILE_DEFINITIONS_<CONFIG> style
properties. Ensure that the provided configuration being generated
is also used to evaluate the generator expressions
in cmTarget::GetCompileDefinitions.
Both the generic COMPILE_DEFINITIONS and the config-specific
variant need to be evaluated with the requested configuration. This
has the side-effect that the COMPILE_DEFINITIONS does not need to
be additionally evaluated with no configuration, so the callers can
be cleaned up a bit too.
Use the /STACK: flag to pass the value through flag parsing so that the
generator converts it to the StackReserveSize project file option. The
option was accidentally left out by commit 7491f529 (first pass at VS
10, 2009-06-25).
Suggested-by: goatboy160@yahoo.com
Since commit 9a6ff950 (Fix for bug where VS2010 did not use .obj files as
part of the build, 2011-04-01) and commit b291d9e7 (VS10: Fix external
objects generated outside target, 2012-03-19) we try to detect whether an
external object file is also a custom command output in the same target.
This is because VS10 includes .obj custom command outputs on the link line
by default.
VS 11 supports a "<LinkObjects ...>false</LinkObjects>" setting in custom
command rules to tell VS not to link the outputs. From the VS help:
Specify whether the Inputs and output files with specific extensions (.obj,
.lib, .res, .rsc) are passed to the linker.
Treat all external object files the same and add "<Object>" settings for them.
This is not ambiguous to the compiler, but it may seem ambiguous to
the reader.
From reading 3a53005f (Build object library targets in VS), 5484550a
(Detect and set Unicode character set in VS 10), and 9e01aefd (VS:
Add support for WinRT project properties (#12930)), this appears to
be the intentional semantic.
Fix the VS 10 link flag map to name the project file entries correctly.
The VS 11 link flag map already has the correct names. Generate the
entries in the <PropertyGroup> along with incremental linking options.
Drop them from the <Link> element because VS does not use them.
Avoid collecting the link options twice. Collect them once in a
LinkOptions member and use it from both places. We already do this for
compiler options with the ClOptions member.
Commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect
assumption that CMAKE_BUILD_TYPE was set on the makefile for each
generated configuration in multi-config generators. Fix that by making
the GetIncludeDirectories API depend on the config.