1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-16 00:49:26 +08:00

532 Commits

Author SHA1 Message Date
Cengizhan Pasaoglu
c67ab22cdc Using front() and back() instead of calculations 2018-11-06 21:43:33 +03:00
Vitaly Stakhovsky
b8bb6ba653 cmGeneratorTarget::GetExportMacro: return const std::string* 2018-10-16 11:12:19 -04:00
Brad King
ec9ef691fe Merge topic 'provide_explicit_source_and_build_command_line_options'
638f00117a Add release note for the -S and -B options.
de962cc00d CMake: Internally uses -S instead of -H to specify source directory
a10d63d578 cmake: -S and -B can be used to specify source and build directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2358
2018-09-19 10:38:19 -04:00
Vitaly Stakhovsky
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& 2018-09-18 11:16:46 -04:00
Robert Maynard
de962cc00d CMake: Internally uses -S instead of -H to specify source directory 2018-09-15 11:25:47 -04:00
Brad King
1b57f49586 genex: Simplify cmGeneratorExpressionInterpreter
All callers were constructing with a non-empty target name using the
target whose pointer was passed anyway.  Drop this argument.  Simplify
logic accordingly.  Re-order constructor arguments to match the
cmCompiledGeneratorExpression::Evaluate arguments.

Also remove unnecessary getters.
2018-09-07 09:23:43 -04:00
Vitaly Stakhovsky
4d89830d71 cmMakefile: Make GetRequiredDefinition return std::string
In all cases the return value is converted to std::string anyway.

Also remove unnecessary `c_str()` calls in arguments to
`GetRequiredDefinition`.
2018-09-05 15:15:55 -04:00
Brad King
9da844d8cb Merge topic 'lg-directory'
50fbfee3a0 cmLocalGenerator: return directories as const std::string&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2309
2018-08-28 13:43:48 -04:00
Vitaly Stakhovsky
50fbfee3a0 cmLocalGenerator: return directories as const std::string& 2018-08-27 15:48:57 -04:00
Marc Chevrier
974de0e199 static library: add property STATIC_LIBRARY_OPTIONS
issue: #18251
2018-08-15 15:20:18 +02:00
Vitaly Stakhovsky
6ce56028d5 cmVisualStudioGeneratorOptions::Parse(): const std::string& argument 2018-08-13 18:22:11 -04:00
Frank Goyens
b771b2c300 VS: extended OutputDeploymentDebuggerTool for AdditionalFiles
The `OutputDeploymentDebuggerTool` function now also retrieves a target
property that is used for setting the `AdditionalFiles` attribute of
`DeploymentTool`.
2018-07-09 07:39:39 -04:00
Frank Goyens
2f4075fa45 VS: moved EscapeForXML function higher up and made static 2018-07-06 11:30:23 -04:00
Marc Chevrier
c1f5a44b28 LINK_OPTIONS: Add new family of properties
This family enable to manage link flags

Three new properties:
* directory property: LINK_OPTIONS
* target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS

Two new commands
* add_link_options(): to populate directory property
* target_link_options(): to populate target properties

Fixes: #16543
2018-06-06 17:22:39 +02:00
Vitaly Stakhovsky
7d407b438d cmVisualStudioGeneratorOptions: specify indentation with integer 2018-04-25 11:01:37 -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
d308e9442e Merge topic 'glob_configure_depends'
6c4f8b4596 Adjust help documentation for file(GLOB), add topic notes
20612978c8 Add tests for `file(GLOB)` CONFIGURE_DEPENDS flag
3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators
ca0befc2e1 Add `CONFIGURE_DEPENDS` flag support to cmFileCommand::HandleGlobCommand
599c93e22d Add cmGlobVerificationManager class, integrate with cmake and cmState

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1767
2018-04-06 10:25:08 -04:00
Shane Parris
3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators 2018-04-01 23:16:12 -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
8182ebca32 cmIDEOptions: use std::string 2018-02-26 11:24:45 -05:00
Shane Parris
b6ef4bc329 Document and extend the CMAKE_SUPPRESS_REGENERATION variable
Fixes: https://gitlab.kitware.com/cmake/cmake/issues/16815
2018-02-23 11:20:15 -05:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03: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
Marc Chevrier
0448311179 sourceFile properties: add property INCLUDE_DIRECTORIES 2018-01-24 15:10:10 +01:00
Vitaly Stakhovsky
25243014e5 cmMakefile: use std::string in more methods; cleanup c_str()s
Follow up commit 969c1f94ae (cmSourceGroup: code improvements; use
std::string and C++11 loops, 2017-01-10).
2018-01-23 11:10:04 -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
Marc Chevrier
78b1c2e09e sourceFile properties: add property COMPILE_OPTIONS
Add the support of per-source property COMPILE_OPTIONS,
including generator expressions support.

Related: #17507
2018-01-23 10:24:56 +01:00
Brad King
506fda1cf0 Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and Xcode
The set of compile flags used for a target's C and C++ sources is based
on the linker language.  By default this is always the C++ flags if any
C++ sources appear in the target, and otherwise the C flags.  Therefore
we can define the `COMPILE_LANGUAGE` generator expression in
`INCLUDE_DIRECTORIES` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of include directories for C and C++ is frequently similar but may
be distinct from those for other languages like CUDA.

Fixes: #17435
2018-01-12 14:27:37 -05:00
Brad King
c2f79c9867 Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode
The set of compile flags used for a target's C and C++ sources is based
on the linker language.  By default this is always the C++ flags if any
C++ sources appear in the target, and otherwise the C flags.  Therefore
we can define the `COMPILE_LANGUAGE` generator expression in
`COMPILE_DEFINITIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of definitions for C and C++ is frequently similar but may be
distinct from those for other languages like CUDA.

Issue: #17435
2018-01-12 14:27:37 -05:00
Brad King
1ab4d186a7 cmLocalVisualStudio7Generator: Clarify variable name of compiled language 2018-01-11 10:55:20 -05:00
Brad King
07e1a74361 cmLocalVisualStudio7Generator: Clarify condition for target that compiles 2018-01-11 10:54:06 -05:00
Vitaly Stakhovsky
92c7b52607 VS: Use range-based 'for' loops in generator code
Use `auto` for complex types.
2017-12-21 14:52:49 -05:00
Brad King
4bc5c08476 Merge topic 'per-source-COMPILE_LANGUAGE-genex-support'
10f58b27 Genex: Per-source $<COMPILE_LANGUAGE:...> support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1575
2017-12-14 08:21:52 -05:00
Marc Chevrier
10f58b27ac Genex: Per-source $<COMPILE_LANGUAGE:...> support
Fixes: #17542
2017-12-13 16:35:22 +01:00
Vitaly Stakhovsky
c62ffdcd4f cmIDEOptions: use std::string instead of const char*
Revise method signatures to save a few c_str() conversions.
2017-12-08 22:30:16 -05:00
Marc Chevrier
9432f686e6 Add generator expression support to per-source COMPILE_DEFINITIONS
This allows users to specify different genex-based compile definitions for each file in a target.

Fixes: #17508
2017-12-05 14:47:39 +01:00
Brad King
729dda5420 Merge topic 'src-genex-refactoring'
6bffc13e Refactor per-source generator expression evaluation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1550
2017-12-05 08:15:40 -05:00
Brad King
21541bb5cc Use CM_FALLTHROUGH in Windows-specific code
Some cases were missed by earlier sweeps due to not compiling
Windows-specific code.
2017-12-04 10:58:15 -05:00
Marc Chevrier
6bffc13ef1 Refactor per-source generator expression evaluation
Prepare to add generator expression support to more source properties.
Factor out some duplicated code into a helper to avoid further
duplication.
2017-12-04 09:10:09 -05:00
Brad King
c871446abc cmSourceGroup: Return strings from GetName and GetFullName 2017-11-15 10:47:07 -05:00
Brad King
344d149ae4 VS,Xcode: Add CMakeLists.txt sources without mutating targets
Rather than injecting `CMakeLists.txt` files into each target's
`SOURCES`, teach the generators to add them during generation using
dedicated code.  This avoids mutating the original targets, and avoids
polluting `$<TARGET_PROPERTY:foo,SOURCES>` with generator-specific
content.

This also avoids listing the `CMakeLists.txt` sources in the results of
`CMAKE_DEBUG_TARGET_PROPERTIES==SOURCES` so the `RunCMake.TargetSources`
test no longer needs a separate case for IDEs.
2017-10-18 14:24:07 -04:00
Brad King
303cd7037a VS,Xcode: Fix TARGET_PROPERTY genex in source COMPILE_FLAGS property
This already worked in other generators.  Also add a test case.

Fixes: #17314
2017-10-03 08:03:33 -04:00
Brad King
068effa4d8 Merge topic 'auto_ptr'
f0489856 Retire std::auto_ptr and its macro CM_AUTO_PTR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !1300
2017-09-27 07:25:11 -04:00
Fredrik Orderud
b3e6514c2a VS: Adapt project parsers to support "ProjectGUID" without curly brackets
This is needed to correctly parse Windows Installer "wiproj" projects,
that by default contain "ProjectGUID" tags with GUID values without
surrounding curly brackets.  Otherwise CMake truncates the first & last
character from the GUID value for these projects.
2017-09-26 08:56:20 -04:00
Matthias Maennich
f0489856e3 Retire std::auto_ptr and its macro CM_AUTO_PTR
Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-26 00:07:19 +02:00
Pavel Solodovnikov
37d9387be3 Replace empty-string comparisons with checking against empty(). 2017-09-21 11:23:19 +03:00
Pavel Solodovnikov
5db3aac111 Meta: replace empty-string assignments with clear(). 2017-09-16 02:26:49 +03:00
Minmin Gong
bc7c94fe13 MSVC: Add support for ARM64 architecture
Visual Studio 15.4 adds support for this architecture.

Fixes: #17213
2017-09-12 09:54:29 -04:00