Commit Graph

24518 Commits

Author SHA1 Message Date
Yohann Benedic
b3baa97e80 Source_Group: Allow an empty prefix with the TREE syntax.
When calling

    source_group(TREE <root> PREFIX "" FILES ...)

the files located at the root directory were not assigned
to the correct source group: they were put in a default
group (e.g. "Source Files" in Visual Studio).

Fixes: #17608
2018-04-30 16:44:08 +02:00
Kitware Robot
81aeb065e9 CMake Nightly Date Stamp 2018-04-30 00:01:04 -04:00
Kitware Robot
1925fe9fed CMake Nightly Date Stamp 2018-04-29 00:01:04 -04:00
Kitware Robot
65a4b2aade CMake Nightly Date Stamp 2018-04-28 00:01:06 -04:00
Brad King
0036966c0b Merge topic 'vs-refactor-xml'
4465a27882 cmVisualStudio10TargetGenerator: XML refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2012
2018-04-27 08:24:51 -04:00
Brad King
ea8189ee55 Merge topic 'vs-managed-fastlink'
27b28c001f VS: Don't turn on /DEBUG:FASTLINK for managed C++ targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2011
2018-04-27 08:24:06 -04:00
Kitware Robot
48dcb2cacb CMake Nightly Date Stamp 2018-04-27 00:01:05 -04:00
Vitaly Stakhovsky
4465a27882 cmVisualStudio10TargetGenerator: XML refactoring 2018-04-26 13:45:29 -04:00
Calum Robinson
27b28c001f VS: Don't turn on /DEBUG:FASTLINK for managed C++ targets
FastLink is only supported for native C++ targets. Turning it off avoids
a warning when building managed C++.
2018-04-26 15:36:59 +01:00
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
cca8bc88ba Merge topic 'ninja-issue-17942'
ee44f390ce Ninja: Make assumed source dependencies order-only
625b8f9076 Ninja: Avoid empty phony edges for target ordering
ae6722483e Merge branch 'backport-ninja-issue-17942' into ninja-issue-17942
0826c20128 Ninja: Do not add empty custom command for file(GENERATE) outputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2010
2018-04-26 08:48:45 -04:00
Brad King
ee44f390ce Ninja: Make assumed source dependencies order-only
Since its beginning the Ninja generator has handled `GENERATED` source
files that have no custom command producing them by writing a dummy
custom command for them that depends on the target ordering phony edge.
Make the custom command's dependency order-only since the phony edge
also has only order-only dependencies.  The dummy custom command
should never be considered "dirty" by `ninja`.

Fixes: #17942
2018-04-26 08:40:59 -04:00
Brad King
625b8f9076 Ninja: Avoid empty phony edges for target ordering
Since commit v3.9.0-rc1~230^2~2 (ninja: break unnecessary target
dependencies, 2017-04-17) we unconditionally generate a phony edge for
target ordering.  It is needed in case a later target depends on it.
However, if the phony edge has no inputs then `ninja -d explain` prints:

    ninja explain: output ... of phony edge with no inputs doesn't exist

Furthermore the phony edge's output is considered dirty and can cause
dependents to be incorrectly considered dirty.  Avoid this by always
generating at least one input to the target ordering phony edges.
If we have no real dependencies just use a path that always exists.

Fixes: #17942
2018-04-26 08:40:57 -04:00
Brad King
ae6722483e Merge branch 'backport-ninja-issue-17942' into ninja-issue-17942 2018-04-26 08:40:49 -04:00
Brad King
0826c20128 Ninja: Do not add empty custom command for file(GENERATE) outputs
Internally we mark `file(GENERATE)` outputs as `GENERATED` in order
to tell custom command dependency tracing logic not to expect the
files to exist on disk yet.  This is because we do not generate the
files until after that tracing is done.

The Ninja generator also interprets the `GENERATED` property to mean
that it is expected that some build rule will generate the file if
another build rule depends on it.  If the generator does not know of a
custom command that generates the file then it adds an empty one so that
the `ninja` build tool does not complain about a dependency on a file
that does not exist and has no rule to generate it.  However, this step
is not necessary for `file(GENERATE)` outputs because there is no build
rule to generate them and they will exist before `ninja` runs.

Add an additional `__CMAKE_GENERATED_BY_CMAKE` property internally to
tell the Ninja generator that a `GENERATED` file will exist before the
build starts and is not expected to have a build rule producing it.

Fixes: #17942
2018-04-26 08:39:44 -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
Brad King
caf6d93acd Merge topic 'numeric-indent'
7d407b438d cmVisualStudioGeneratorOptions: specify indentation with integer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2008
2018-04-26 08:31:09 -04:00
Kitware Robot
52ae29e63b CMake Nightly Date Stamp 2018-04-26 00:01:04 -04:00
Vitaly Stakhovsky
7d407b438d cmVisualStudioGeneratorOptions: specify indentation with integer 2018-04-25 11:01:37 -04:00
Brad King
22e4837442 Merge topic 'fix-CMAKE_DISABLE_SOURCE_CHANGES-top-dir'
60cb75e4a1 Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build tree

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2001
2018-04-25 08:57:08 -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
Brad King
e5d15848ca Merge topic 'vs-hlsl-object-name'
8d1ccbc693 VS: Add VS_SHADER_OBJECT_FILE_NAME source file property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1997
2018-04-25 08:53:54 -04:00
Brad King
52c11e4f64 Merge topic 'file_install_always_out_of_date_fix'
6dcd1bfa39 file(INSTALL): Preserve file time when writing NTFS alternate stream

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1992
2018-04-25 08:52:15 -04:00
Kitware Robot
7e4e14219d CMake Nightly Date Stamp 2018-04-25 00:01:06 -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
Brad King
195400cab7 Merge topic 'Genex-TARGET_GENEX_PROPERTY'
4d15046edd Genex: Add $<TARGET_GENEX_EVAL:...> and $<GENEX_EVAL:...>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1984
2018-04-24 11:06:19 -04:00
Brad King
b928be62fa Merge topic 'reorder-sys-includes'
76ad2ecb50 Order SYSTEM include directories after non-system directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1968
2018-04-24 11:05:12 -04:00
Marc Chevrier
60cb75e4a1 Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build tree
The change in commit v3.11.0-rc1~480^2 (UseJava: add_jar OUTPUT_DIR
option used only for jar generation, 2017-10-12) added code of the form
`file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR})`.  This exposed an existing
bug in `CMAKE_DISABLE_SOURCE_CHANGES` in which it does not recognize
that the top of the build tree itself is in the build tree.  Fix that
now.

Fixes: #17933
2018-04-24 10:42:00 -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
Kitware Robot
3db4092329 CMake Nightly Date Stamp 2018-04-24 00:01:03 -04:00
Ephi Sinowitz
76ad2ecb50 Order SYSTEM include directories after non-system directories
An effect of the `-isystem` flag is to search the directory after those
specified via `-I` flags.  Make behavior more consistent on compilers
that do not have any `-isystem` flag by explicitly moving system include
directories to the end.
2018-04-23 11:47:52 -04:00
Yves Frederix
6dcd1bfa39 file(INSTALL): Preserve file time when writing NTFS alternate stream
When cross-compiling on a Windows host, we use a `:cmake_mode_t` NTFS
alternate stream to store the file mode for use during packaging.
Writing to this stream changes the file modification time, so save and
restore the original modification time since we are not modifying the
real file content.

Fixes: #17922
2018-04-23 11:37:36 -04:00
Brad King
f9b3b5a773 Merge topic 'fortran-submodule-depends'
b1f95e5b14 Fortran: Extend submodule test with great-grandchild
402735314e Fortran: Add support for submodule dependencies
62538b2c4c Fortran: Refactor to treat .mod extension as part of module name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Izaak Beekman <contact@izaakbeekman.com>
Merge-request: !1989
2018-04-23 10:28:50 -04:00
Brad King
97ecefa73b Merge topic 'grammar_typo_fixes'
8e841a473f Cleanup: Fix typos and grammar in docs and code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1996
2018-04-23 10:22:00 -04:00
Brad King
ba234392b1 Merge topic 'add_compile_definitions'
cb83314e65 add_compile_definitions: add new command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1988
2018-04-23 10:16:24 -04:00
Marc Chevrier
4d15046edd Genex: Add $<TARGET_GENEX_EVAL:...> and $<GENEX_EVAL:...>
Fixes: #17884
2018-04-23 11:13:52 +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
Michael Stürmer
709277640b cmExportFileGenerator: set IMPORTED_COMMON_LANGUAGE_RUNTIME for CSharp target 2018-04-23 07:31:20 +02:00
Michael Stürmer
2418232586 cmGeneratorTarget: change GetManagedType() result if language is CSharp 2018-04-23 07:31:19 +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
Kitware Robot
1f372ac4e5 CMake Nightly Date Stamp 2018-04-23 00:01:12 -04:00
Craig Scott
8e841a473f Cleanup: Fix typos and grammar in docs and code
No functional changes, just docs, comments and error messages.
2018-04-23 07:48:03 +10:00
Kitware Robot
1fa4e8abca CMake Nightly Date Stamp 2018-04-22 00:01:04 -04:00