Commit Graph

279 Commits

Author SHA1 Message Date
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 5365c9ac37 VS: Map Nsight Tegra file types in .vcxproj files
Map ".java" to JCompile, ".asm" and ".s" to ClCompile, and a few
Android-specific source file names to AndroidBuild.  This allows
Nsight Tegra 1.6 and above to check up-to-dateness of such sources.
Bump NsightTegraProjectRevisionNumber to 7 to allow these fields.
2014-09-30 08:45:35 -04:00
Brad King a62894998f VS: Generate ANDROID_GUI executables as app packages
When an executable is marked with ANDROID_GUI, generate an AntBuild
step in the .vcxproj file and point it at the directory found to
contain AndroidManifest.xml.  Assume it also contains build.xml.
2014-09-30 08:45:34 -04:00
Brad King c12e46991e Add 'ANDROID_API' target property to set Android Target API
Also add a 'CMAKE_ANDROID_API' variable to set the property default.
2014-09-30 08:45:34 -04:00
Brad King cb9e86706c Merge topic 'vs-minor-cleanups'
c655f0c4 VS: Drop GenerateManifest from .vcxproj files for non-MS tools
227a3367 VS: Use case-insensitive check for hlsl,jpg,png,xml file extensions
4a24015a Tests: Always detect VS and SDK availability on Windows
2014-09-29 16:26:07 -04:00
Brad King ef0fd4f0ce VS: Teach vcxproj generation about the Tegra-Android platform
Complete the basic implementation of the VS Tegra-Android generators
by replacing parts of vcxproj files that are specific to MS tools
with settings defined for the NVIDIA Nsight Tegra tools.

Current limitations include:

* We have no "flag table" so flags will be passed in the additional
  options fields instead of mapped to the vcxproj elements defined
  by Nsight Tegra msbuild platform definition files.

* We have no interface to set the AndroidArch, AndroidStlType, or
  AndroidTargetAPI fields so defaults will be used.

* The Nsight Tegra msbuild platform definition files do not provide
  a working "Utility" target type so for add_custom_target we need
  to use a "StaticLibrary" target type and leave out ClCompile rules.

* There is also no target type for plain command-line executables
  so for add_executable we need to use a "DynamicLibrary" target.
  Full application bundles will likely require new CMake target
  properties (like WIN32_EXECUTABLE for Windows GUI executables).
2014-09-29 16:05:53 -04:00
Brad King c655f0c417 VS: Drop GenerateManifest from .vcxproj files for non-MS tools
The .vcxproj file content generated by OutputLinkIncremental is
specific to MS tools, so drop it when using other tools.
2014-09-29 16:05:52 -04:00
Brad King 227a336714 VS: Use case-insensitive check for hlsl,jpg,png,xml file extensions
These "extra" sources should map to the proper tool even when they
are not in lower case.
2014-09-29 16:05:52 -04:00
Pascal Bach e7aeb79f08 VS, WINCE: Only set EntryPointSymbol for executables 2014-09-22 10:23:16 -04:00
Gilles Khouzam d4ca8fb2bd VS: Add Certificates to .vcxproj files
After certificates were moved into their own category in
cmGeneratorTarget, that category was not added for output by the VS 10
generator.  Add it now.
2014-09-19 13:46:00 -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 bfc81c5934 Merge topic 'vs-windows-apps'
39fefde2 VS: Add test case for Windows Phone and Windows Store
89da8465 MSVC: Define 'WIN32' for Windows Store and Windows Phone
ed7f085f Help: Add notes for topic 'vs-windows-apps'
dd11ae8f VS: Do not compile C sources as WinRT (#15100)
b8e40538 VS: Mark Windows Phone and Store targets as App Containers
0432f062 VS: Always ignore ole32 on Windows Phone 8.0
e6ff2f8b VS: Generate Windows Metadata for WinRT components
ee48f4c7 VS: Generate Windows Phone and Windows Store projects as Unicode
cb1aceed VS: Add VS_WINRT_COMPONENT property to enable CompileAsWinRT
401269e4 VS: Handle .pfx files explicitly in generator
23782171 VS: Handle AppxManifest sources explicitly in generator
bc373c6d VS: Set Window Phone/Store app type in CMake-generated targets
d89b2889 VS: Mark CMake-generated targets as Utility in .vcxproj files
03ad8f28 CMakeDetermineCompilerABI: Link with standard libraries on MSVC
2014-09-02 10:16:37 -04:00
Brad King dd11ae8f0f VS: Do not compile C sources as WinRT (#15100)
The MSVC /ZW flag is valid only for C++ sources.  Whenever we enable
CompileAsWinRT for the whole target, disable it for all C sources.
Update the documentation of VS_WINRT_COMPONENT to drop the statement
about undefined behavior for non-C++ sources, because it is now
defined as expected.
2014-09-02 10:17:02 -04:00
Gilles Khouzam b8e405387e VS: Mark Windows Phone and Store targets as App Containers
* Add AppContainerApplication to non-UTILITY targets
* Generate app manifest and related files if project does not provide them.
  Place them in a per-target directory to avoid clashes.
* Mark WinRT components with WinMDAssembly
* Import Windows Phone 8.0 targets in .vcxproj files when necessary,
  and reference platform.winmd.

Inspired-by: Paul Annetts <paul@lightunobscured.com>
2014-09-02 10:17:02 -04:00
Brad King 8c30014982 Merge topic 'vs-masm'
cbd1d42b Help: Add notes for topic 'vs-masm'
0f8522a6 VS: Add MASM support to VS 8 and 9 (#8170, #14984)
a43f4400 VS: Move internal MasmEnabled member up to VS 7 generator
df3b007d VS: Add test for MASM support
e8727449 VS: Populate MASM tool build settings in .vcxproj files
0271a5f9 VS: Manually fix MASM flag table entries
1d662e48 VS: Generate MASM flag tables from MSBuild tool files
4f6940df VS: Fix ASM_MASM support in VS >= 10
d7866c52 ASM_MASM: Fix selection of ml64
0374abdb ASM_MASM: Add preprocessor definitions to compile lines
5b0a46e1 ASM_MASM: Do not require compiler to be a full path
802dbe52 cmLocalVisualStudio7Generator: Rename local 'lang' var
2014-08-22 10:37:55 -04:00
Gilles Khouzam 0432f0620d VS: Always ignore ole32 on Windows Phone 8.0
Inspired-by: Paul Annetts <paul@lightunobscured.com>
2014-08-21 09:28:21 -04:00
Gilles Khouzam e6ff2f8bb4 VS: Generate Windows Metadata for WinRT components
Inspired-by: Paul Annetts <paul@lightunobscured.com>
2014-08-21 09:28:20 -04:00
Gilles Khouzam ee48f4c7ae VS: Generate Windows Phone and Windows Store projects as Unicode 2014-08-21 09:28:20 -04:00
Gilles Khouzam cb1aceed8c VS: Add VS_WINRT_COMPONENT property to enable CompileAsWinRT
Deprecate VS_WINRT_EXTENSIONS and document VS_WINRT_COMPONENT as for VS
generators only.  Also define _WINRT_DLL in SHARED libraries in order to
get a .lib produced.

Inspired-by: Paul Annetts <paul@lightunobscured.com>
2014-08-21 09:28:20 -04:00
Gilles Khouzam 401269e43b VS: Handle .pfx files explicitly in generator
Teach cmGeneratorTarget to classify .pfx files as package
certificate key files.  Teach cmVisualStudio10TargetGenerator
to write them as PackageCertificateKeyFile in .vcxproj files.

Inspired-by: Minmin Gong <minmin.gong@gmail.com>
2014-08-21 09:28:20 -04:00
Gilles Khouzam 23782171ad VS: Handle AppxManifest sources explicitly in generator
Teach cmGeneratorTarget to extract .appxmanifest sources separately.
Teach cmVisualStudio10TargetGenerator to write them with the
AppxManifest tool in .vcxproj files.  This will allow us to detect
whether the project provides an application manfiest explicitly.
2014-08-21 09:28:20 -04:00
Brad King bc373c6d32 VS: Set Window Phone/Store app type in CMake-generated targets
Generate the ApplicationType and ApplicationTypeRevision elements in
.vcxproj files for CMake-generated targets like 'INSTALL' and
'RUN_TESTS'.  This was accidentally left out of commit 709cebde (VS:
Generate WindowsPhone and WindowsStore application types, 2014-07-31).
2014-08-21 09:28:19 -04:00
Brad King d89b28893d VS: Mark CMake-generated targets as Utility in .vcxproj files
Targets like 'INSTALL' and 'RUN_TESTS' are Utility targets.
Fix the VS >= 10 generator to set this correctly.  We already
do so for VS < 10.
2014-08-21 09:28:19 -04:00
Brad King 9f4701bde9 Merge topic 'vs-refactor-includes'
5fcb42ab VS: Refactor include directory generation in .vcxproj files
8e026aa7 VS: Refactor include directory slash conversion
9633d112 cmIDEOptions: Add HasFlag method to test if a flag is set
84100102 cmIDEOptions: Add an AppendFlag overload to append multiple values
2014-08-19 09:48:33 -04:00
Brad King e872744990 VS: Populate MASM tool build settings in .vcxproj files 2014-08-13 14:48:03 -04:00
Brad King 4f6940df8c VS: Fix ASM_MASM support in VS >= 10
Fix a typo introduced by commit ce511435 (stringapi: Use strings for the
languages, 2014-02-03) to check the language name correctly.
2014-08-13 14:47:56 -04:00
Brad King 5fcb42ab69 VS: Refactor include directory generation in .vcxproj files
Use the cmVisualStudioGeneratorOptions flag map to add the
AdditionalIncludeDirectories element to the project file.
Move appending of %(AdditionalIncludeDirectories) to the
locations that populate the flag vectors instead of where
they are written out.
2014-08-13 14:09:24 -04:00
Brad King 8e026aa7f2 VS: Refactor include directory slash conversion
Convert each include directory to windows slashes once instead of
repeating it each time they are written out to the project file.
2014-08-13 14:08:42 -04:00
Brad King 6fe770e163 VS: Add a source file property to set the hlsl shader type
Create a VS_SHADER_TYPE source file property.

Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2014-08-12 10:08:49 -04:00
Brad King 9b4dc2ad4a VS: Add a source file property to mark content for Windows App deployment
Create a VS_DEPLOYMENT_CONTENT source file property, supporting
generator expressions, to compute whether a source file should be marked
as DeploymentContent or ExcludedFromBuild in Windows Phone and Windows
Store projects.

Inspired-by: Minmin Gong <minmin.gong@gmail.com>
2014-08-12 10:08:47 -04:00
Brad King f063a914c6 VS: Re-arrange WriteExtraSource to support tool configuration
Add a code path to write the tool open and close elements separately
so that we can add content in between to configure it.
2014-08-12 10:08:44 -04:00
Gilles Khouzam 2dfcf0ed07 VS: Fix generation of desktop applications for ARM
Add WindowsSDKDesktopARMSupport to the .vcxproj to avoid 'error MSB8022:
Compiling Desktop applications for the ARM platform is not supported.'
from VS.
2014-08-12 10:08:40 -04:00
Gilles Khouzam 401a00d9f9 VS: Set WindowsPhone and WindowsStore min VS version required
Generate the MinimumVisualStudioVersion element in the .vcxproj file
based on the version of WindowsPhone or WindowsStore to be targeted.
2014-07-31 14:09:05 -04:00
Gilles Khouzam 709cebde66 VS: Generate WindowsPhone and WindowsStore application types
Generate the ApplicationType and ApplicationTypeRevision elements in
.vcxproj files.
2014-07-31 14:09:03 -04:00
Brad King c1580a9217 VS: Always add IgnoreSpecificDefaultLibraries to .vcxproj files
Append %(IgnoreSpecificDefaultLibraries) to any user-specified
libraries so that the system-default list of libraries to ignore
is honored even when the user specifies more.
2014-07-31 14:08:41 -04:00
Gilles Khouzam 66edd06587 VS: Add missing newline after .vcxproj user prop import line 2014-07-31 10:39:21 -04:00
Brad King 0ac28adc01 VS: Map .jpg and .png sources to Image tool
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2014-07-29 15:06:37 -04:00
Brad King 58bb14d4ac VS: Map .xml to XML tool
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2014-07-29 15:06:35 -04:00
Brad King 972cf1d7af VS: Map .appxmanifest sources to AppxManifest tool
Inspired-by: Minmin Gong <minmin.gong@gmail.com>
2014-07-29 15:06:32 -04:00
Brad King 15fb102278 VS: Refactor handling of resx headers
Move generation of the ClInclude element to WriteHeaderSource.
2014-07-29 15:06:30 -04:00
Brad King c2ef6d238a VS: Refactor handling of "header" sources in VS >= 10
Create a WriteHeaderSource method to handle writing of sources
classified by cmGeneratorTarget as header files.  This will be
useful to add special VS-specific handling for some headers.
2014-07-29 15:06:28 -04:00
Brad King 2df389115e VS: Refactor handling of "extra" sources in VS >= 10
Create a WriteExtraSource method to handle writing of sources not
classified by cmGeneratorTarget for any particular purpose.  This
will be useful to add special VS-specific handling for some sources.
2014-07-29 15:06:26 -04:00
Brad King 143b40051a VS: Convert 'WriteSource' tool argument to std::string 2014-07-29 15:06:24 -04:00
Brad King 09164c637b VS: Encode more content correctly in vcxproj files (#15031)
In cmVisualStudio10TargetGenerator, add missing cmVS10EscapeXML
calls around paths to source and object files, custom command
dependencies and outputs, and platform name/version values.
2014-07-23 15:14:47 -04:00
Brad King 1c209ac165 cmIDEOption: Store mapped flag values as a vector<string>
Some FlagMap entries are ;-lists.  Store values as vector<string> so
that individual values may contain ';' characters.  Delay the
construction of the final ;-list until writing to the VS project file.
With this approach the generated file may contain ;-separated values
that contain encoded ';' characters.
2014-07-23 14:18:53 -04:00
Brad King 91c933546d cmVisualStudio10TargetGenerator: Remove dupilcate line 2014-07-23 13:23:10 -04:00
Brad King 7a9909db86 VS: Make MS-tool-specific options conditional
Make blocks adding MS-tool-specific options conditional on a
new "MSTools" boolean member of cmVisualStudio10TargetGenerator.
Hard-code the member to true for now to preserve existing behavior.
2014-07-17 13:37:55 -04:00
Martin Mitas 5d8738468f VS: Fix handling of non-preprocessor flags in CMAKE_RC_FLAGS
Teach the VS >= 10 generator to honor flags other than -I and -D
in the CMAKE_RC_FLAGS[_<CONFIG>] variable.  Place them within the
ResourceCompile .vcxproj element under AdditionalOptions.

Also add a rudimentary flag map to map '-n' to 'NullTerminateStrings'.
2014-07-10 14:33:27 -04:00
Brad King d96b3f68f4 VS14: Generate flag tables from MSBuild v140 tool files
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/V140/1033/cl.xml" > cmVS14CLFlagTable.h
 python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/V140/1033/lib.xml" > cmVS14LibFlagTable.h
 python cmparseMSBuildXML.py -x ".../MSBuild/Microsoft.Cpp/v4.0/V140/1033/link.xml" > cmVS14LinkFlagTable.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.

Co-Author: Pawel Stopinski <diokhan@go2.pl>
2014-06-25 14:51:21 -04:00
Brad King 1edaef39f1 VS: Factor MS-tool-specific vcxproj settings into helper
Factor a WriteMSToolConfigurationValues helper method out of the
cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues method
to isolate the configuration settings specific to MS tools.
2014-06-09 11:00:03 -04:00
Brad King 808f4b1fa4 VS: Re-order logic to group MS-tool-specific options together 2014-06-09 11:00:01 -04:00
Brad King 13e6d5595f VS: Set some options directly instead of using flag map
Instead of passing /TC, /TP, and /STACK: as strings to be parsed through
the flag map, directly set the results in the options map.
2014-06-09 10:59:59 -04:00
Brad King 8f4bdcc6cb VS: Remove always-true condition on compile options block
The cmVisualStudio10TargetGenerator::ComputeClOptions method is
only called when the target type compiles, so do not duplicate
that check in the implementation.
2014-06-09 10:59:57 -04:00
Brad King 2b3e7b6f94 VS: Fix vcxproj specification of empty output file extension
When a binary output file is to have no extension, the TargetExt
element in the vcxproj cannot be left empty because VS will choose
a default extension.  Instead use "." because the Windows filesystem
will treat that as an empty extension.
2014-06-09 10:59:53 -04:00
Brad King 39af06e7f7 VS: Fix vcxproj elements specifying binary output locations
Fix generation of OutDir, IntDir, TargetName, and TargetExt element
values to encode the values for XML.
2014-06-09 10:59:51 -04:00
Brad King ee329d543c VS: Refactor flag table lookup
In cmVisualStudio10TargetGenerator, convert the static functions
currently used to lookup the flag table for each tool into class
methods.  This avoids passing the this->LocalGenerator member and
gives the methods access to other information that may be useful
in the future.
2014-06-09 10:59:48 -04:00
Brad King 0d04838469 VS: Use full path to sources to allow deeper trees with VS >= 10
As explained in cmVisualStudio10TargetGenerator::WriteSource comments,
VS tools append relative paths to the current directory, e.g.

 c:\path\to\current\dir\..\..\..\relative\path\to\source.c

and fail if this is over 250 charaters or so.  Previously we used a full
path only if no relative path could be constructed with a leading "../"
sequence that does not escape the source or build tree.  This means that
long relative paths can be generated when the build tree is inside the
source tree, and can cause build failures due to the above path
concatenation problem.

Teach cmVisualStudio10TargetGenerator::ConvertPath to ask the Convert
method to honor CMAKE_USE_RELATIVE_PATHS.  This will cause it to use
full paths by default but still give users the option of getting the
relative paths when possible.

Suggested-by: Josh Green <inbilla@gmail.com>
2014-04-15 11:52:48 -04:00
Stephen Kelly e6971df6ab cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.

Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.

Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.

Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
2014-04-02 23:14:02 +02:00
Stephen Kelly e5da9e51d0 cmTarget: Allow any generator expression in SOURCES property.
Remove use of UseObjectLibraries from Makefile and Ninja generators. It
is not needed now because those generators use GetExternalObjects
which already contains the objects from object libraries.

The VS10 generator calls both the UseObjectLibraries and the GetExternalObjects
methods. Ensure that duplicates are not created by skipping objects
from object libraries in handling of GetExternalObjects.

Similarly, fix VS6, VS7 and Xcode object handling by skipping
external objects from OBJECT_LIBRARY usage as appropriate.

The error message in the BadSourceExpression1 test is now reported
by the generator expression evaluator, so it has different text.
2014-04-02 23:12:56 +02:00
Brad King b16f26f5f9 Merge topic 'target-objects-refactor'
6c9dd0ec cmGlobalGenerator: Make ComputeTargetObjects non-virtual
c481fadc cmGeneratorTarget: Don't store ObjectSources for object libraries.
f6da0440 cmLocalGenerator: Add ComputeObjectFilenames interface.
9ad804ac cmGeneratorTarget: Constify cmSourceFile* in containers.
c725bb3c Constify some APIs in generators.
dcfcd23e cmGeneratorTarget: Make GetSourceDepends const.
04cf50ff cmOSXBundleGenerator: Make MacOSXContentGeneratorType arg const.
6132d979 cmGeneratorTarget: Constify the AddExplicitObjectName API.
bc512211 cmGeneratorTarget: Constify the AddObject API.
cd43433d cmGlobalGenerator: Extract a ComputeTargetObjectDirectory interface.
d5b2e33b Makefiles: Compute local object files on demand.
2014-03-17 10:00:43 -04:00
Clinton Stimpson ee8cef8725 Encoding: If configured, write Visual Studio project files as UTF-8. 2014-03-14 08:48:42 -06:00
Stephen Kelly 9ad804ac7b cmGeneratorTarget: Constify cmSourceFile* in containers.
Some of them will be used with other APIs which require value_type
to be cmSourceFile const*.
2014-03-13 15:27:23 +01:00
Stephen Kelly c725bb3cbd Constify some APIs in generators. 2014-03-13 15:27:23 +01:00
Brad King bc993f277e Generalize cmCustomCommandGenerator to more fields
Until now the cmCustomCommandGenerator was used only to compute the
command lines of a custom command.  Generalize it to get the comment,
working directory, dependencies, and outputs of custom commands.  Update
use in all generators to support this.
2014-03-12 10:44:01 -04:00
Ben Boeckel 84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Ben Boeckel ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Brad King 6223621e9a Merge topic 'msvc-compiler-pdb-files'
fba51b09 MSVC: Add properties to configure compiler PDB files (#14762)
3737860a cmTarget: Add per-config compilation info
718a9532 cmTarget: Refactor ComputePDBOutputDir interface
aae5184c Help: Refactor PDB_NAME and PDB_OUTPUT_DIRECTORY docs
b4aac0ca Makefile: Fix per-config linker PDB output directory
2014-02-26 09:38:51 -05:00
Brad King fba51b096e MSVC: Add properties to configure compiler PDB files (#14762)
Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files
2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY
properties.  Those properties now exclusively handle linker PDB files.
Since STATIC libraries do not link their compiler PDB file becomes more
important.  Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and
"COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB
file location and pass the value to the MSVC /Fd option.
2014-02-26 09:34:38 -05:00
Stephen Kelly d3682d8647 cmGeneratorTarget: Use a method to access the definition file. 2014-02-24 16:43:25 +01:00
Stephen Kelly bf1e1bf1d0 cmMakefile: Make FindSourceGroup const.
Return a pointer instead of a reference.  This allows making the accessor
const with the least impact.
2014-01-22 21:28:41 +01:00
Brad King e56530f612 Merge topic 'minor-cleanups'
531e40b cmTarget: Make GetSourceFiles populate an out-vector parameter.
38de54c cmGeneratorTarget: Add methods to access source file groups.
f579fe0 Help: Fix link to MAP_IMPORTED_CONFIG_<CONFIG>
590d238 cmTarget: Handle NO_SYSTEM_FROM_IMPORTED.
2014-01-09 13:54:23 -05:00
Stephen Kelly 531e40b95e cmTarget: Make GetSourceFiles populate an out-vector parameter.
In a future patch, this will also be populated with extra
sources from the linked dependencies.
2014-01-09 19:38:08 +01:00
Stephen Kelly 38de54cf6f cmGeneratorTarget: Add methods to access source file groups.
These methods and others will be able to get a config parameter
later to implement the INTERFACE_SOURCES feature.
2014-01-09 19:38:07 +01:00
Brad King f3a9eb4560 Merge topic 'vs10-include-backslashes'
c131107 VS: Convert include path to backslashes for VS >= 10
2014-01-09 09:37:15 -05:00
Brad King c1311077b8 VS: Convert include path to backslashes for VS >= 10
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
2014-01-08 08:58:20 -05:00
Clinton Stimpson 5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Stephen Kelly ef25ba8d06 Constify handling of target dependencies. 2013-12-11 15:30:11 +01: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
Stephen Kelly 50d152035d cmTarget: Make custom command accessors API const.
Add specific mutators instead of providing non-const refs.
2013-11-19 20:40:31 +01:00
Clinton Stimpson 58e3d4948d MSVC: Fix encoding of Visual Studio 10+ project files.
Use Windows-1252, which is the same encoding as older
Visual Studio project files.
2013-11-14 11:24:06 -05:00
Stephen Kelly 07f5788385 Move TraceDependencies to cmGeneratorTarget. 2013-10-30 21:29:45 +01: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
Robert Maynard 3064f80d25 VS: Generate ToolsVersion matching each VS version
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.
2013-08-26 10:21:16 -04:00
Patrick Gansterer 28e770cf6e VS10: Add support for assembler code (#11536)
Use the masm BuildCustomizations, which are part of the Visual
Studio installation to allow compilation of asm files.
2013-08-05 16:34:10 +02:00
Brad King e7bcdf856e VS10: Escape include paths in XML project files (#14331)
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.
2013-08-01 15:00:28 -04:00
Brad King b64e8f22a4 VS10: Honor user-specified /SUBSYSTEM: flag (#14326)
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.
2013-07-31 10:17:17 -04:00
Patrick Gansterer 14bbf8340a Unify the way the flags of a static library are read
Introduce cmLocalGenerator::GetStaticLibraryFlags() to have a central
function for getting the linker flags for a given target.
2013-07-31 08:41:07 -04:00
Stephen Kelly 184121538c Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.
Refactor to create AddCompileDefinitions.
2013-07-11 08:23:56 +02:00
Brad King 8a08ab051a Merge topic 'vs12-generator'
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)
2013-07-01 09:27:33 -04:00
Brad King be9a80a088 Merge topic 'vs-windows-forms'
6c9712c VS: Add Resx configuration to the vcxproj file
2013-07-01 09:18:06 -04:00
Brad King 4e5cb398ae Merge branch 'master' into vs12-generator
Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping
the side from 'master'.
2013-06-28 18:29:54 -04:00
Brad King e99d7b1c1f VS12: Generate flag tables from MSBuild v120 tool files
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.
2013-06-28 18:13:59 -04:00
Jonas Andersen 6c9712c47b VS: Add Resx configuration to the vcxproj file
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.
2013-06-28 09:23:41 -04:00
Brad King d221eac812 Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling
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.
2013-06-27 12:57:32 -04:00
Brad King 059be4ba3b Merge topic 'add-whitespace'
2331b57 Add whitespace after colons in error messages.
2013-06-24 08:38:12 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Christian Maaser cfe6300a41 VS: Add support for .NET target framework version
Teach CMake to generate the TargetFrameworkVersion XML node as
documented at

 http://msdn.microsoft.com/en-us/library/vstudio/ff770576.aspx

from target property VS_DOTNET_TARGET_FRAMEWORK_VERSION.
2013-06-14 08:09:00 -04:00
Brad King e57b6a2521 Merge topic 'target-COMPILE_OPTIONS'
24466f2 Add target_compile_options command.
80ca9c4 Add COMPILE_OPTIONS target property.
7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries
47f80d9 cmTarget: Rename struct to be more re-usable.
1319a14 Add <LANG>_COMPILER_ID generator expressions.
3549676 Add cmLocalGenerator::GetCompileOptions.
f3ad863 VS6: Rename some variables to correspond to config values.
2013-06-03 09:57:44 -04:00
Brad King 90441b289d Merge topic 'vs-RootNamespace'
cca955a VS: Add VS_GLOBAL_ROOTNAMESPACE target property
2013-06-03 09:57:32 -04:00
Stephen Kelly 35496761a5 Add cmLocalGenerator::GetCompileOptions.
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.
2013-06-02 11:56:36 +02:00