42 Commits

Author SHA1 Message Date
Vitaly Stakhovsky
6ce56028d5 cmVisualStudioGeneratorOptions::Parse(): const std::string& argument 2018-08-13 18:22:11 -04:00
Vitaly Stakhovsky
7d407b438d cmVisualStudioGeneratorOptions: specify indentation with integer 2018-04-25 11:01:37 -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
5697c6ae03 cmVisualStudioGeneratorOptions: Factor out an OutputFlag helper 2018-03-20 14:10:04 -04:00
Vitaly Stakhovsky
8182ebca32 cmIDEOptions: use std::string 2018-02-26 11:24:45 -05:00
Vitaly Stakhovsky
b723fe3d7d VS: Convert loops to C++11, other C++ improvements 2018-02-21 21:18:59 -05:00
Marc Chevrier
3073bd1f3d VisualStudio generators: refactoring
Uniformize include directories handling.
Fix memory leaks in class cmVisualStudio10TargetGenerator:
OptionsMap uses now std::unique_ptr.
2018-01-23 10:25:03 +01:00
comicfans
3232f84c19 VS: Fix MANIFESTUAC link flag map to .vcxproj elements
Add special parsing of the flags given in `/MANIFESTUAC:"..."` in order
to map them correctly to `.vcxproj` elements.

Keep the old incorrect flag table entries for `uiAccess` and `level`
flags for compatibility even though they do not really exist.

Fixes: #16563
2017-09-18 11:53:22 -04:00
Daniel Pfeifer
ca2233e31f IWYU: Mark cmConfigure.h with pragma: keep
Also remove `#include "cmConfigure.h"` from most source files.
2017-08-26 07:41:04 +02:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Brad King
94255511a6 VS: Select CUDA code generation architectures
Parse the `-gencode=`, `-arch`, and `-code` flags and generate a
`CodeGeneration` field in the project file.
2017-03-10 10:19:57 -05:00
Brad King
253594d0ae VS: Select the CUDA runtime library
Parse the `-cudart=` option and add a corresponding `CudaRuntime`
field to the generated project file.  Also add a matching `.lib`
to the list of libraries linked.
2017-03-10 10:19:57 -05:00
Brad King
b64b4629ea VS: Add basic infrastructure for CUDA generation
Generate the `CudaCompile` elements in `.vcxproj` files.
2017-03-10 10:19:56 -05:00
Brad King
80e982d7ad VS: Add method to take a value out of the option parser flag map
Remove a flag from the map and return its value.
2017-03-10 10:19:55 -05:00
Brad King
f7bb40c92d VS: Add method to re-parse specific option parser fields
This will allow a client to parse flags, replace the flag tables, and
then re-parse a field in which flags for a secondary tool were
collected.
2017-03-10 10:19:54 -05:00
Brad King
a05fc93ee6 VS: Add method to clear flag tables of option parser 2017-03-10 10:19:54 -05:00
Brad King
109b8a6fd3 VS: Refactor AdditionalOptions generation
Store unknown flags directly in a flag map entry for `AdditionalOptions`
instead of having a separate member for them.  This avoids duplicating
the output generation logic for the entry.
2017-02-15 10:41:36 -05:00
Brad King
bd5ea6993c cmVisualStudioGeneratorOptions: Add PrependInerhitedString method 2017-02-15 10:37:35 -05:00
Evgeny Fimochkin
5ba2c9e5e0 VS: Add support for ASM_NASM language
Fixes: #16469
2017-02-07 13:20:52 -05:00
Michael Stürmer
e438693e95 VS: Teach option map IsDebug() method about C# projects 2016-12-07 11:49:43 -05:00
Daniel Pfeifer
66a7099993 iwyu: Fix VisualStudio specific issues 2016-11-28 14:06:40 -05:00
Michael Stürmer
f27492a4db VS: Add internal API for detecting "managed" projects
This is in preparation for adding CSharp language support to the VS
generator.
2016-10-19 11:14:19 -04:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Kitware Robot
d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Brad King
0ac18d40c8 Remove //------... horizontal separator comments
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:

    $ git ls-files -z -- \
        "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
      egrep -z -v "^Source/cmCommandArgumentLexer\." |
      egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmDependsJavaLexer\." |
      egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmExprLexer\." |
      egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmFortranLexer\." |
      egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmListFileLexer\." |
      egrep -z -v "^Source/cm_sha2" |
      egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
      egrep -z -v "^Utilities/(KW|cm).*/" |
      xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'

This avoids modifying third-party sources and generated sources.
2016-05-09 09:41:43 -04:00
Stephen Kelly
e435f875ec VS: Move version information to global generator. 2015-05-19 11:02:33 -04:00
Zack Galbreath
17b0fe0305 Fix incremental linking setting for Fortran + VS
This commit fixes a bug where it was impossible to specify
/INCREMENTAL to Fortran projects built with Visual Studio.

The problem was due to the fact that .vfproj files expect
the value of this flag to be "linkIncremental{No,Yes},
whereas .vcproj files expect this value to be 0, 1, or 2.

The implementation of this fix adds a new data structure for
Visual Studio linker flags specific to Fortran.  This can
easily be extended in the future if more such discrepencies
between C/C++ and Fortran linking are discovered.
2014-11-21 13:32:45 -05: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
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
Brad King
e872744990 VS: Populate MASM tool build settings in .vcxproj files 2014-08-13 14:48:03 -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
Ben Boeckel
ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Patrick Gansterer
5e0252ce68 Improve const-correctness in cmVisualStudioGeneratorOptions
Add const qualifier to IsDebug(), UsingSBCS() and UsingUnicode().
2013-08-05 21:23:50 +02:00
Aaron C. Meadows
ba89e92ba6 Visual Studio: Allow setting Single Byte Character Set (#12189)
For Visual Studio using the Preprocessor Define _SBCS. This behavior
is similar to the way that _UNICODE and _MBCS work already.

Added tests to confirm this behavior.
2012-02-17 11:30:23 -05:00
Brad King
1be4b6f463 Order VS local generator Version ivar values consistently
Move the Version member to the top cmLocalVisualStudioGenerator class
and set it consistently for instances created by all the global
generator versions.  Use an enumeration type with values scaled by a
factor of 10 so we can handle VS 7.1 without out-of-order numbers.

VS 7.1 support for SuppressStartupBanner was broken by commit 25116a3c
(Fix CMAKE_VERBOSE_MAKEFILE for VS10 vcxproj files, 2011-10-11) because
it assumed comparison of VS version numbers works.  Now it does.
2011-11-14 09:47:31 -05:00
David Cole
662756036e VS10: Escape double quote chars in defines for rc files (#11695)
To get rc defines to work in the VS10 IDE requires \" when
constructing PreprocessorDefinitions strings. This is different
than defines for cl.

Also, per-file rc defines were not being generated. Fix that, too.
2011-01-25 19:01:13 -05:00
Brad King
22aec406e6 Set Intel .vfproj RuntimeLibrary attribute
Look for the "/threads", "/libs:dll", and "/dbglibs" flags and convert
them to the proper RuntimeLibrary attribute value in the IDE.  This is
a 3-to-1 flag mapping and such needs special handling in the parser.
2010-11-09 17:54:40 -05:00
Brad King
96afb12087 Convert CMake to OSI-approved BSD License
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.
2009-09-28 11:43:28 -04:00
Brad King
5b85a581a8 ENH: Separate option mapping from VS generators
Split cmVisualStudioGeneratorOptions core functionality out into a
base class cmIDEOptions.  It will be useful for other generators.
2009-07-29 11:29:08 -04:00
Brad King
e339f3133f ENH: Separate VS flag table type
Move the cmVS7FlagTable type out of the VS generators and rename it to
cmIDEFlagTable.  It will be useful for other generators.
2009-07-29 11:28:55 -04:00
Bill Hoffman
7491f52992 ENH: first pass at VS 10, can bootstrap CMake, but many tests still fail 2009-06-25 16:41:57 -04:00