1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-20 11:47:23 +08:00

554 Commits

Author SHA1 Message Date
Brad King
e52cf1034f Merge topic 'csharp_reference_imported_targets'
de549083e3 cmVisualStudio10TargetGenerator: warn if /clr flag is set manually
59ec7d50bd cmVisualStudio10TargetGenerator: fix for backward compatibility
663f5120f4 cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced()
359544a907 add tests for using target_link_libraries() with imported managed targets
43571073e0 cmVisualStudio10TargetGenerator: store managed reference information in maps
16fec7e2fc cmVisualStudio10TargetGenerator: make some methods config aware
f3c6828876 cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt
f9042d807d remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1805
2018-04-26 08:55:19 -04:00
Brad King
5858267df6 Merge topic 'vs-refactor-xml'
dfff12c808 VS: Add Elem::Content() helper and usage demo
1f29777798 cmVisualStudio10TargetGenerator: refactoring (continued)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2005
2018-04-26 08:36:44 -04:00
Vitaly Stakhovsky
dfff12c808 VS: Add Elem::Content() helper and usage demo 2018-04-26 08:35:43 -04:00
Vitaly Stakhovsky
7d407b438d cmVisualStudioGeneratorOptions: specify indentation with integer 2018-04-25 11:01:37 -04:00
Brad King
5a6c629289 Merge topic 'vs-dedup-custom-commands'
f59c33a763 VS: Generate a custom command only in the least dependent target
d58d4daa6b cmVisualStudio10TargetGenerator: Use cmLocalVisualStudio10Generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1889
2018-04-25 08:56:16 -04:00
Vitaly Stakhovsky
1f29777798 cmVisualStudio10TargetGenerator: refactoring (continued) 2018-04-24 12:01:19 -04:00
Jeremiah van Oosten
8d1ccbc693 VS: Add VS_SHADER_OBJECT_FILE_NAME source file property 2018-04-24 11:29:16 -04:00
Michael Stürmer
de549083e3 cmVisualStudio10TargetGenerator: warn if /clr flag is set manually 2018-04-24 07:05:19 +02:00
Michael Stürmer
59ec7d50bd cmVisualStudio10TargetGenerator: fix for backward compatibility 2018-04-24 07:05:18 +02:00
Michael Stürmer
663f5120f4 cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced() 2018-04-24 07:05:17 +02:00
Michael Stürmer
43571073e0 cmVisualStudio10TargetGenerator: store managed reference information in maps 2018-04-24 07:05:14 +02:00
Michael Stürmer
16fec7e2fc cmVisualStudio10TargetGenerator: make some methods config aware 2018-04-23 07:31:23 +02:00
Michael Stürmer
f3c6828876 cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt 2018-04-23 07:31:22 +02:00
Michael Stürmer
f9042d807d remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget 2018-04-23 07:31:21 +02:00
Fujii Hironori
f59c33a763 VS: Generate a custom command only in the least dependent target
If a custom command is assigned to multiple targets, generate the build
rule only in the least-dependent `.vcxproj` file.  Otherwise MSBuild
will run the command on the first build of a dependent target even if
its dependencies already brought the command up to date (in order to
populates its build log).

Generate targets in least-to-most-dependent order, and assign a custom
command to the least dependent target.

Added cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst to call
cmVisualStudio10TargetGenerator::Generate in least-dependent order.

Moved SourcesVisited from cmVisualStudio10TargetGenerator to
cmLocalVisualStudio10Generator to avoid attaching a custom command to
multiple targets among the local generator.

Fixes: #16767
2018-04-23 13:31:28 +09:00
Brad King
fe0082875a Merge topic 'vs-sdk-dirs'
6ec3e880e7 VS: Add variables to set SDK directories in vcxproj files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1965
2018-04-20 07:52:02 -04:00
Bastien Schatt
6ec3e880e7 VS: Add variables to set SDK directories in vcxproj files
Create `CMAKE_VS_SDK_*_DIRECTORIES` variables to tell the VS generator
how to populate fields in `.vcxproj` files that specify SDK directories.

Fixes: #17908
2018-04-19 09:39:34 -04:00
Brad King
d41e767f2b Merge topic 'vs-conditional-reference-assembly'
c8e98974d8 VS: Disallow ReferenceOutputAssembly in ProjectReference if not possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1956
2018-04-17 07:32:11 -04:00
Fujii Hironori
d58d4daa6b cmVisualStudio10TargetGenerator: Use cmLocalVisualStudio10Generator
Change the type of a member variable `LocalGenerator` from
`cmLocalVisualStudio7Generator` to `cmLocalVisualStudio10Generator`.
2018-04-17 11:03:17 +09:00
Brad King
5099af044f Merge topic 'vs-cuda-pdb'
134e795fa9 VS: Add workaround for CUDA compiler PDB location

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1960
2018-04-16 09:14:05 -04:00
Bastien Schatt
c8e98974d8 VS: Disallow ReferenceOutputAssembly in ProjectReference if not possible
Explicitly turn off `ReferenceOutputAssembly` in `ProjectReference`
elements naming other project files whose types do not produce
assemblies.  We already do this for `C#` but it makes sense for other
languages too.

Fixes: #17906
2018-04-13 13:11:09 -04:00
Brad King
134e795fa9 VS: Add workaround for CUDA compiler PDB location
The CUDA Toolkit Visual Studio Integration does not honor the
`ClCompile.ProgramDataBaseFileName` field when telling `nvcc` how to
invoke `cl`.  Work around this problem by passing `-Xcompiler=-Fd...`
ourselves through `AdditionalOptions`.

Fixes: #17647
2018-04-13 12:56:36 -04:00
Brad King
0a122393d7 Merge branch 'backport-fix-explicit-CMakeLists.txt' 2018-04-13 09:46:54 -04:00
Brad King
8480c2afc0 Restore support for explicitly referenced CMakeLists.txt sources
Since commit v3.11.0-rc1~467^2 (VS,Xcode: Add CMakeLists.txt sources
without mutating targets, 2017-10-18) we do not add `CMakeLists.txt` to
target sources but instead generate references to them directly.  This
broke projects that explicitly specify their `CMakeLists.txt` file as a
source file because the explicit entry is no longer consolidated with
the generated one.

Teach the relevant generators to avoid duplicating `CMakeLists.txt`
source references and add test cases.

Fixes: #17828
2018-04-13 09:41:06 -04:00
Brad King
498be66fd7 Merge topic 'add_support_for_clr_targets'
312527de47 document COMMON_LANGUAGE_RUNTIME target properties
4b7a82b4ed cmVisualStudio10TargetGenerator: set /clr compiler flag from property
20e31fb4c9 cmExportFileGenerator: add target property for managed targets
411a22706a cmGeneratorTarget: add handling of managed assemblies to HasImportLibrary()
fb433ff283 cmGeneratorTarget: Make import library checks config-aware
4c1f33961f cmGeneratorTarget: add GetManagedType() and CheckManagedType() methods
6c517a9f8d cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1916
2018-04-12 11:36:28 -04:00
Brad King
aa5bedc52b Merge topic 'attr-escape'
ff18dce5ed cmVisualStudio10TargetGenerator: Properly escape attributes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1937
2018-04-12 11:29:24 -04:00
Brad King
607b0ac2f3 Merge topic 'minor-cleanups'
acda926a04 Replace some uses of sprintf with std::to_string
418541035f cmCTestCurl: Fix UploadFile declared parameter names
1519628e60 cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned
2f87d00803 cmMacroCommand: Fix format string to match type of argument
b0676cc5d4 Add in-class initialization of some members
966dba5b68 cmAlgorithms: Remove unnecessary typename keyword
12a145534a gitignore: Ignore a .vs directory in the source tree

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1932
2018-04-06 10:29:38 -04:00
Vitaly Stakhovsky
ff18dce5ed cmVisualStudio10TargetGenerator: Properly escape attributes
In addition to common XML escape characters, attributes require escaping
the double quote character. A new function, cmVS10EscapeAttr is added and
used where appropriate.
2018-04-05 21:20:16 -04:00
jrp2014
1519628e60 cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned
It's used in unsigned contexts, such as with format strings.
2018-04-05 13:42:49 -04:00
Michael Stürmer
4b7a82b4ed cmVisualStudio10TargetGenerator: set /clr compiler flag from property 2018-04-05 06:36:53 +02:00
Vitaly Stakhovsky
30bbb4f2ac cmVisualStudio10TargetGenerator: extend DOM-like generation
The local Elem class is extended with more XML-generating functions.
WriteGroups() is rewritten to use these new functions,
avoiding BuildFileStream.
2018-03-30 22:55:30 -04:00
Vitaly Stakhovsky
80767dd50e VS: Simplify XML code
Get rid of suffix arguments
2018-03-27 17:39:19 -04:00
Vitaly Stakhovsky
a0d9429bd7 cmVisualStudioGeneratorOptions: Move XML code to subclasses 2018-03-26 09:35:58 -04:00
Vitaly Stakhovsky
b82ad18fe0 cmVisualStudio10TargetGenerator: fix indentation
Added printing empty string to get the right indentation.
2018-03-19 09:56:44 -04:00
Brad King
60299bc6f0 Merge topic 'vs-debugger-command'
5a7113d8fb VS: Add target property VS_DEBUGGER_COMMAND

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1842
2018-03-19 08:26:33 -04:00
Vitaly Stakhovsky
a74d5a5c8b cmVisualStudio10TargetGenerator: improved XML nesting
Introduce an `Elem` helper class to track XML element state.  This
simplifies code in a few places, particularly OutputSourceSpecificFlags.
2018-03-16 08:50:19 -04:00
Hannes Mezger
5a7113d8fb VS: Add target property VS_DEBUGGER_COMMAND
Fixes: #17819
2018-03-14 13:27:15 -04:00
Vitaly Stakhovsky
59d8cfb85e cmVisualStudio10TargetGenerator: Use helpers for XML tags
Make the XML generating code smaller, more structured, and less
error-prone.  This is a step towards future XML refactoring.
2018-03-07 08:51:30 -05:00
Vitaly Stakhovsky
8182ebca32 cmIDEOptions: use std::string 2018-02-26 11:24:45 -05:00
Brad King
1f7ad8ab5c Merge topic 'project-references-csharp-17678'
076a356c VS: Support C# project references

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1752
2018-02-26 08:57:25 -05:00
Robert Dailey
076a356cd1 VS: Support C# project references
When specifying a pure C# target in the `target_link_libraries()` call to
another C++ target, a `<ProjectReference>` was setup for it (we wanted this)
but also a corresponding `.lib` was added under `<AdditionalDependencies>`
(we didn't want this).

This change introduces a check that prevents `.lib` linker options from
being used when the corresponding target for that library is a C# target.

Fixes: #17678
2018-02-23 08:53:17 -06:00
Vitaly Stakhovsky
b723fe3d7d VS: Convert loops to C++11, other C++ improvements 2018-02-21 21:18:59 -05:00
Vitaly Stakhovsky
b721b9a381 cmVisualStudio10TargetGenerator: Make some data members const; simplify 2018-02-05 19:50:54 -05:00
Vitaly Stakhovsky
6d148d6d53 cmVisualStudio10TargetGenerator: Limit scope of ConvertToWindowsSlash()
It is no longer used outside this class, so its scope can be limited to file.
2018-02-01 19:09:34 -05:00
Brad King
4499cc8bb6 Merge topic 'msvc_cuda_files_use_consistent_obj_names'
fa583869 CUDA: Use MSVC default pattern for naming object files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1722
2018-01-31 08:36:24 -05:00
Brad King
0a37b515af Merge topic 'vs-restore-order'
1fe66c46 VS: Restore the order of the AdditionalIncludeDirectories tag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1719
2018-01-31 08:33:00 -05:00
Robert Maynard
fa583869f7 CUDA: Use MSVC default pattern for naming object files
The default that CUDA uses causes failures when you try to embed
CUDA obj's into another target.
2018-01-30 09:14:02 -05:00
Vitaly Stakhovsky
1fe66c462b VS: Restore the order of the AdditionalIncludeDirectories tag
Move the `AdditionalIncludeDirectories` tag back to the VS-preferred
location in `.vcxproj` files.

Fixes: #17691
2018-01-30 08:53:04 -05:00
Robert Dailey
b07b1aa416 VS: Use newline for empty DebugInformationFormat tags
Previously, code wrote out empty tags for `<DebugInformationFormat>`
like so:

    <DebugInformationFormat></DebugInformationFormat>

This gets corrected by Visual Studio 2017 when saving the solution. The
correction appears as:

    <DebugInformationFormat>
    </DebugInformationFormat>

In the spirit of keeping the XML structure as close to what Visual
Studio expects as possible, a newline is inserted after the opening tag
in the empty case.
2018-01-26 09:52:59 -06:00
Brad King
76f5a87cf1 Merge topic 'sourceFile-new-properties'
04483111 sourceFile properties: add property INCLUDE_DIRECTORIES
3073bd1f VisualStudio generators: refactoring
78b1c2e0 sourceFile properties: add property COMPILE_OPTIONS
3f935e69 LocalGenerator: refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1596
2018-01-25 08:33:35 -05:00