Teach the VS 2015 generator to support WindowsStore 10.0 applications.
Add target properties to customize them:
* VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION: Specifies the minimum version
of the OS that the project can target.
* VS_DESKTOP_EXTENSIONS_VERSION, VS_MOBILE_EXTENSIONS_VERSIONS,
VS_IOT_EXTENSIONS_VERSION: Add a reference to the version of the SDK
specified to the target allowing to target the extended functionality in
a universal project.
* VS_IOT_STARTUP_TASK: Specifies that the target should be
built as an IOT continuous background task.
When we generate a ".rule" file to attach a custom command in a VS IDE
project, set the file timestamp to be old enough to prevent the rule
from re-running due to its timestamp.
Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
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.
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.
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.
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.
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).
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
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.
* 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>
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>
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.
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.
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.
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.
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.
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'.
Factor a WriteMSToolConfigurationValues helper method out of the
cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues method
to isolate the configuration settings specific to MS tools.
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.
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.
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.
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.
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.
Most CMake generators produce relative paths within the build tree and
full paths to files outside the build tree. Make VS 10 and VS 11
project files consistent with this approach except for paths forced to
be relative to work around a VS 10 bug.
Remove the duplicate source file classification logic used to generate
the filter files. Instead record during the main vcxproj file
generation the source files generated for each tool. Also record
whether or not each source file is converted to a relative path. Use
the recorded result during filter generation to ensure consistency
between the project file and filter file.
Combine WriteCLSources and WriteObjSources into a single method. Use
the cmGeneratorTarget source classification to simplify tool selection
for each source file. Extend the classification to handle .idl files.
VS_WINRT_EXTENSIONS: Boolean property that correspond to "Enable
Tailored Features" in Visual Studio 11 IDE.
VS_WINRT_REFERENCES: Semicolon-delimited list of *.winmd references to
add to the project, which creates a new <ItemGroup>.
VS_GLOBAL_PROJECT_TYPES: A string containing UUIDs to embed in the
Visual Studio project file under <ProjectTypes>.
VS_GLOBAL_KEYWORD: Allows specification of a keyword like "ManagedCProj"
instead of the default "Win32Proj", under <Keyword>
VS_DOTNET_REFERENCES: Semicolon-delimited list of .NET references to add
to the project, which creates a new <ItemGroup>.
In targets with no non-header files the linker language cannot be
determined. Since the target project file cannot be generated at all in
this case, give up as soon as it is detected. Otherwise the generation
code may try to run with uninitialized information.
This commit teaches the VS 10 generator to detect the -D_UNICODE option
in preprocessor definitions and set the CharacterSet attribute to the
value 'Unicode'. This was already done for other VS IDE versions.
See issue #9769
This converts the CMake license to a pure 3-clause OSI-approved BSD
License. We drop the previous license clause requiring modified
versions to be plainly marked. We also update the CMake copyright to
cover the full development time range.
Visual Studio 10 uses MSBuild to drive the build. Custom commands
appear in MSBuild files inside CustomBuild elements, which appear inside
ItemGroup elements. The Outputs and AdditionalInputs elements of each
CustomBuild element are evaluated according to timestamps on disk.
MSBuild does not use inputs/outputs to order CustomBuild steps within a
single ItemGroup or across multiple ItemGroup elements. Instead we must
put only unrelated CustomBuild elements in a single ItemGroup and order
the item groups from top to bottom using a topological order of the
custom command dependency graph.
This fixes CustomCommand and ExternalProject test failures, so we remove
the expectation of these failures.