Commit Graph

305 Commits

Author SHA1 Message Date
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +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
Stephen Kelly 55d80d0a85 cmMakefile: Rename GetCurrent{,Source}Directory.
Match the names used in cmake code.
2015-04-21 00:12:52 +02:00
Gilles Khouzam 01a9ab0def VS: Add support for XAML source files
XAML files are by default of type Page in the vcxproj and can be
overriden by setting the VS_XAML_TYPE property.  The .cpp and .h file
of the same name are automatically added as depending on the XAML file.

New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013.
2015-04-03 13:40:35 -04:00
Stephen Kelly 0b945ea9a6 Genex: Allow COMPILE_LANGUAGE when processing compile definitions.
Issue an error if this is encountered by an IDE generator.
2015-03-09 20:49:16 +01:00
Brad King 4ee9005d73 cmVisualStudio10TargetGenerator: Wrap long line 2015-02-24 10:34:15 -05:00
Tim Blechmann 0b54e8366e VS: Specify absolute output directory for the Midl tool
Generate the OutputDirectory element value as an absolute path
to the same location as the existing relative path.  Somehow
this addresses an occasional failure in a large/complex build,
and should not hurt basic use cases.
2015-02-23 13:22:07 -05:00
Robert Goulet 500794b0db VS: Set default language in generated Windows Phone and Store projects
Otherwise building such projects gives:

 warning APPX1901: The DefaultLanguage property is either missing from
                   the project file or does not have a value
2015-01-29 14:30:29 -05:00
Robert Goulet 4c5574a15d VS: Add missing newlines to .vcxproj generation 2015-01-29 14:29:01 -05:00
Robert Goulet 4775c90145 VS: Add source file property to set extra hlsl shader flags
Create a VS_SHADER_FLAGS source file property so that we can set all
other Visual Studio .hlsl shader file compilation flags.
2015-01-28 09:29:50 -05:00
Dmitry Polyanitsa eeaa25e521 Add 'ANDROID_API_MIN' target property to set Android Target MIN API
Also add a 'CMAKE_ANDROID_API_MIN' variable to set the property
default.  Teach the VS generator to write the MIN API value into
Nsight Tegra project files.
2014-12-17 11:17:28 -05:00
Brad King f545eb0b0b VS: Inherit target-level "-wd" flags in source files (#15284)
If a source file COMPILE_FLAGS option adds "-wd", the .vcxproj file
will have a DisableSpecificWarnings setting for the source file.
Add to the setting a reference to %(DisableSpecificWarnings) to
inherit any such flags set for the whole target.
2014-12-04 15:40:04 -05:00
Brad King 09f797c19c Merge topic 'vs-hlsl-typo'
955fbf29 VS: Fix typo in VS_SHADER_MODEL lookup comment
2014-12-04 10:23:21 -05:00
Brad King ba98442610 Merge topic 'vs-phone-store-deployment-location'
352f246f VS: Add source file property to specify Windows App deployment location
2014-12-04 09:10:05 -05:00
Brad King 955fbf29c7 VS: Fix typo in VS_SHADER_MODEL lookup comment 2014-12-03 14:12:32 -05:00
Brad King cebce135c0 Merge topic 'fix-wince-unicode-entry-point'
681cda02 VS, WINCE: Fix entry point for Unicode builds
2014-12-03 10:02:01 -05:00
Brad King b9eac05fb6 Merge topic 'vs-hlsl-settings'
2a224b4c VS: Add source file properties to set the hlsl shader entry point and model
2014-12-03 10:01:49 -05:00
Gilles Khouzam 352f246f3e VS: Add source file property to specify Windows App deployment location
Add a VS_DEPLOYMENT_LOCATION source file property to specify where to
put files that are part of the package.  For example:

  set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "assets")

Without this, sources marked with VS_DEPLOYMENT_CONTENT cannot be
located properly.
2014-12-03 09:31:59 -05:00
Cedric Perthuis 2a224b4ce3 VS: Add source file properties to set the hlsl shader entry point and model
Create properties VS_SHADER_ENTRYPOINT and VS_SHADER_MODEL.  Without
these many .hlsl source files may not be possible to use.  Extend the
VSWinStorePhone test project to cover them.
2014-12-03 09:30:59 -05:00
Pascal Bach 681cda02bf VS, WINCE: Fix entry point for Unicode builds
When _UNICODE is defined VS uses wmain instead of main as the entry function.
To make this correctly work on WindowsCE EntryPointSymbol needs to be set to
mainWCRTStartup instead of mainACRTStartup for console applications and to
wWinMainCRTStartup instead of WinMainCRTStartup for GUI applications.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
2014-12-03 09:07:11 -05:00
Brad King d526ebc603 Merge topic 'vs-check-phone-store-tools'
689cd0d4 VS: Do not produce WinMD file for OBJECT libraries (#15228)
b20a32ac VS: Improve error messages when compiler is not detected (#15228)
2014-11-18 09:12:34 -05:00
Brad King c61efbd684 Merge topic 'fix-vs2015-warnings'
b138be07 cmVisualStudio10TargetGenerator: fix a narrowing warning
8d379cd7 cmCallVisualStudioMacro: fix a shadowing warning
2014-11-17 09:40:47 -05:00
Gilles Khouzam 689cd0d43e VS: Do not produce WinMD file for OBJECT libraries (#15228)
They are implemented as static libraries for the IDE so treat them the
same.
2014-11-17 08:57:14 -05:00
Dmitry Polyanitsa bb3c87f1da VS: Change Nsight Tegra 2.0 Project Revision Number from 8 to 9
A hotfix to Nsight Tegra 2.0 needed to increase the project number.
Teach CMake to generate the newer number for this version.
2014-11-13 14:05:12 -05:00
Ben Boeckel b138be07b4 cmVisualStudio10TargetGenerator: fix a narrowing warning
0xAA literals are integers which doesn't fit into a char array. C++11
says this is an error and VS2015 now warns about it.
2014-11-13 13:28:08 -05:00
Brad King 34d035e70e Merge topic 'vs-nsight-tegra-generator'
df84281d Help: Add notes for topic 'vs-nsight-tegra-generator'
69e198dc VS: Generate Nsight Tegra project revision number
5365c9ac VS: Map Nsight Tegra file types in .vcxproj files
178f56a5 VS: Fix Tegra-Android platform linking of libraries by name
7115702f Tests: Add test for VS Nsight Tegra generator support
a6289499 VS: Generate ANDROID_GUI executables as app packages
c12e4699 Add 'ANDROID_API' target property to set Android Target API
9a4df52a Add 'ANDROID_GUI' target property to mark Android applications
16569abf cmTarget: Track internally whether platform is Android
ef0fd4f0 VS: Teach vcxproj generation about the Tegra-Android platform
d09b60f5 VS: Detect compiler id of Nsight Tegra-Android toolchains
2f071466 VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android'
2014-09-30 08:46:27 -04: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 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