Commit Graph

25322 Commits

Author SHA1 Message Date
Frank Benkstein
6199637e95 configure_file: canonicalize input and output path in dependencies
Represent the input file path internally in canonical form.  Otherwise
multiple `configure_file` calls that share the same input file but specify
it relative to different directories (e.g. via `../`) result in multiple
copies of the dependency on the rule to re-run CMake.  This causes the
Ninja generator to emit duplicate phony build statements for these
dependencies, which generates an error with `-w dupbuild=err`, which
will be default in Ninja 1.9.

Also canonicalize the output path for consistency.

Add a test case.

Fixes: #18584
2018-11-13 15:01:17 -05:00
Brad King
65522e5e0e Merge topic 'cpack-improve-unknown-generator-error'
f29e2292c9 cpack: When given an unknown generator print out all valid generators
eba7273c20 cpack: Better error message when generator doesn't exist.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: David Cole <dlrdave@aol.com>
Merge-request: !2580
2018-11-09 10:37:14 -05:00
Kitware Robot
8db4bd115c CMake Nightly Date Stamp 2018-11-09 00:01:04 -05:00
Robert Maynard
f29e2292c9 cpack: When given an unknown generator print out all valid generators
This makes cpack behavior match cmake when passed an invalid generator
2018-11-08 19:07:24 -05:00
Robert Maynard
eba7273c20 cpack: Better error message when generator doesn't exist.
Currently the CPack error message when passed an invalid generator
name  reads like the generator failed to work, rather than the
name was invalid.
2018-11-08 09:32:18 -05:00
Brad King
17e98e00c4 Merge topic 'install-defaults'
fdcd559a8e Help: Add documentation and release notes for install
9fc20a4f3e install: Add sane set of defaults for DESTINATION and file type parameters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Acked-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Merge-request: !2558
2018-11-08 07:33:18 -05:00
Kitware Robot
4193430628 CMake Nightly Date Stamp 2018-11-08 00:01:08 -05:00
Kyle Edwards
9fc20a4f3e install: Add sane set of defaults for DESTINATION and file type parameters
If the user does not specify a DESTINATION for a target type, the
install() command checks to see if the appropriate variable from
GNUInstallDirs is set. If it is not, then it uses an appropriate
hard-coded guess.

In addition, for FILES and DIRECTORY, the user can specify a file
type instead of a DESTINATION, and the command will use the
appropriate variable from GNUInstallDirs, or a hard-coded guess if
it is not set.
2018-11-07 14:08:48 -05:00
Brad King
7e6b787599 Merge topic 'string_func_usage'
c67ab22cdc Using front() and back() instead of calculations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2571
2018-11-07 07:30:20 -05:00
Brad King
cf78a7df95 Merge topic 'fix-double-warn-uninitialized-in-script-mode'
53a5aec899 CMP0053: Fix double warning on uninitialized variables in -P mode
f92f93467e cmMakefile: Rename SuppressWatches to SuppressSideEffects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2565
2018-11-07 07:28:02 -05:00
Kitware Robot
df542558c6 CMake Nightly Date Stamp 2018-11-07 00:01:09 -05:00
Cengizhan Pasaoglu
c67ab22cdc Using front() and back() instead of calculations 2018-11-06 21:43:33 +03:00
Brad King
7bed050755 Merge topic 'autogen_origin_depends'
47f9c15c60 Autogen: Update <ORIGIN>_autogen target documentation
336893d9eb Autogen: Separate AUTOGEN_TARGET_DEPENDS tests into own tests suite
846043dd35 Autogen: Rename MocDepends test to AutogenOriginDependsOn
b71a9598a4 Autogen: Add test for AUTOGEN_ORIGIN_DEPENDS=OFF
f74c406501 Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS release notes
0669de5d36 Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS documentation
b5e895b5d4 Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2518
2018-11-06 11:38:23 -05:00
Brad King
1674a5b0a4 Merge topic 'rename-cpack-ext-generator'
20d5e77a27 CPack: Rename Ext generator to External

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2566
2018-11-06 11:30:27 -05:00
Kitware Robot
44760059fc CMake Nightly Date Stamp 2018-11-06 00:01:08 -05:00
R2RT
53a5aec899 CMP0053: Fix double warning on uninitialized variables in -P mode
When `CMP0053` is not set to OLD or NEW then we compute both variants
in case we need to warn about a behavior change.  Do not allow both
code paths to produce an uninitialized variable warning.

Fixes: #18552
2018-11-05 08:31:09 -05:00
R2RT
f92f93467e cmMakefile: Rename SuppressWatches to SuppressSideEffects 2018-11-05 08:29:10 -05:00
Craig Scott
20d5e77a27 CPack: Rename Ext generator to External
Ext and External were used inconsistently in the code and the
docs. This change converts all uses of Ext to External, including
within variable names used by the generator.
2018-11-05 07:56:03 -05:00
Brad King
e5d298b8fd Merge topic 'lwyu-hides-link-error'
85aceda026 cmNinjaNormalTargetGenerator: don't use `|| true` for link-what-you-use

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2546
2018-11-05 07:50:20 -05:00
Brad King
259292ebcc Merge topic 'custom-command-work-dir-genex'
98d59417b0 add_custom_{command,target}: Fix WORKING_DIRECTORY leading genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2559
2018-11-05 07:42:47 -05:00
Kitware Robot
95894a605e CMake Nightly Date Stamp 2018-11-05 00:01:52 -05:00
Kitware Robot
112100da90 CMake Nightly Date Stamp 2018-11-04 00:01:06 -04:00
Brad King
98d59417b0 add_custom_{command,target}: Fix WORKING_DIRECTORY leading genex
Since commit v3.13.0-rc1~39^2 (add_custom_{command,target}:
WORKING_DIRECTORY generator expressions, 2018-09-22) the
`WORKING_DIRECTORY` option accepts generator expressions.
Fix support for the case of a leading generator expression
by deferring conversion to an absolute path until after
evaluation of the generator expression.

Fixes: #18543
2018-11-03 08:39:45 -04:00
Sebastian Holtermann
b5e895b5d4 Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS support
This adds

- the variable ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` which initializes
- the target property ``AUTOGEN_ORIGIN_DEPENDS``

which controls whether or not the origin target dependencies
should be forwarded to the corresponding ``_autogen`` target.

The default value of ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` is ``ON``
which corresponds to the behavior that is in place since CMake 3.9.

Closes: #18493
2018-11-03 12:14:40 +01:00
Kitware Robot
443c574a7c CMake Nightly Date Stamp 2018-11-03 00:01:09 -04:00
Ben Boeckel
85aceda026 cmNinjaNormalTargetGenerator: don't use || true for link-what-you-use
With the `|| true`, a linker error before running link-what-you-use
would also use the `|| true` fragment and unconditionally succeed. Just
skip the addition since `--lwyu=` ignores the return value anyways.

Fixes #18524
2018-11-02 10:25:56 -04:00
Brad King
a052479a5c Merge topic 'msvc-custom-rc-mt'
bd9bfc6449 MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe}
0033676796 CUDA: Enable RC language on Windows
02f566a559 MSVC: Factor out enable_language(RC) call into helper macro
b601bb6f1c CUDA: Find CMAKE_LINKER on Windows
3eebe28ef4 cmLocalNinjaGenerator: Simplify CreateRulePlaceholderExpander

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2424
2018-11-02 07:57:06 -04:00
Brad King
9578c3f0d1 Merge topic 'check-keywords-only-if-used'
4babc9058a cmTargetPropCommandBase: check keywords after parsing
45a49ae58a cmTargetPropCommandBase: simplify code path
9f64974f5e cmTargetPropCommandBase: skip property setting if there's nothing to add
4201a11c2b Tests: add tests for empty-value keyword arguments in target_*

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2514
2018-11-02 07:55:14 -04:00
Brad King
c384fc3ca4 Merge topic 'server-file-monitor-check'
eb52529ff4 server: Fix assertion failure on directory paths in file monitor

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2556
2018-11-02 07:48:34 -04:00
Kitware Robot
fa5e5550f3 CMake Nightly Date Stamp 2018-11-02 00:01:13 -04:00
Brad King
d955b4f753 Merge topic 'fix-custom-target-with-csharp'
9040df31e2 Merge branch 'backport-fix-custom-target-with-csharp'
1acd1c2b50 CSharp: Fix regression in VS project type selection for custom target
a56edad6d6 CSharp: Fix regression in VS project type selection for custom target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2549
2018-11-01 07:36:39 -04:00
Vladimir Penev
eb52529ff4 server: Fix assertion failure on directory paths in file monitor
Fixes: #18532
2018-11-01 07:25:17 -04:00
Kitware Robot
75b85133d8 CMake Nightly Date Stamp 2018-11-01 00:01:09 -04:00
Brad King
a56edad6d6 CSharp: Fix regression in VS project type selection for custom target
A target created by `add_custom_target` should always be a `.vcxproj`
file even if it has `.cs` sources involved in custom commands and such.
The latter case was broken by refactoring in commit v3.12.0-rc1~160^2~7
(remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget,
2018-03-19).  The reason is that the `HasLanguage` method added by
commit v3.12.0-rc1~239^2~6 (cmGeneratorTarget: add HasLanguage() as
wrapper for GetLanguages(), 2018-03-19) does not check the target type
and so is not a suitable check for deciding the project file extension.

The `HasLanguage` method was an attempt at an abstraction that turns
out not to work very well.  Replace it with a dedicated `IsCSharpOnly`
method that considers the target type, sources, and non-transitive
`LINKER_LANGUAGE`.

Fixes: #18515
2018-10-31 09:13:19 -04:00
Kitware Robot
69aaf0d076 CMake Nightly Date Stamp 2018-10-31 00:01:12 -04:00
Brad King
1d4b1a5853 Merge topic 'cuda_device_linking_drop_dynamic_libs'
e8cc8d22d8 Merge branch 'backport-cuda-filter-device-link-libs'
3f5bfb425a CUDA: Filter out non-static libraries during device linking
3c31ec7a0a CUDA: Filter out non-static libraries during device linking

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Merge-request: !2536
2018-10-30 11:03:03 -04:00
Brad King
87dfd53b27 Merge topic 'set_directory_properties-script-mode'
50572d638b set_directory_properties: Restore in script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2544
2018-10-30 11:01:36 -04:00
Kitware Robot
9330afea04 CMake Nightly Date Stamp 2018-10-30 00:01:08 -04:00
Mateusz Zych
bd9bfc6449 MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe}
CMake commands vs_link_dll and vs_link_exe, performing linking on MSVC,
are responsible for calling resource compiler and manifest tool.

Before this commit, both of these tools were called directly, with the
expectation that they are available in the `PATH`. This has been fixed
by respecting CMake variables `CMAKE_RC_COMPILER` and `CMAKE_MT`
defining paths to these tools.

Fixes: #17804
2018-10-29 13:40:47 -04:00
Robert Maynard
3c31ec7a0a CUDA: Filter out non-static libraries during device linking
Since commit v3.12.0-rc1~278^2 (CUDA: Pass more link libraries to device
linking, 2018-03-27) we consider every link library during device
linking and use `-Xnvlink` to pass those that do not end in `.a`.
However, nvlink breaks on versioned shared library names such as
`.so.1`.  Work around this problem by not passing library paths that do
not end in `.a` or `.lib`.  nvlink would not find device symbols in them
anyway.

Fixes: #18504
2018-10-29 11:57:29 -04:00
Brad King
50572d638b set_directory_properties: Restore in script mode
Since commit v3.10.0-rc1~391^2~3 (Add directory property 'LABELS' and
CMAKE_DIRECTORY_LABELS variable, 2017-06-23) this command was
accidentally not allowed in script mode.  It was dropped because
`ctest -S` mode needs to start with CMake's normal script mode and
then replace the `set_directory_properties` implementation.  Restore
the normal `set_directory_properties` in script mode and then add
special logic to replace it in ctest.  Also add a test case.

Fixes: #18523
2018-10-29 11:37:32 -04:00
Brad King
bcd61da350 Merge topic 'graphviz-fix-alias'
50c4dec072 graphviz: dereference ALIAS targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2521
2018-10-29 09:56:25 -04:00
Brad King
4eb77958d2 Merge topic 'minusCparse'
379e5f93a9 Tests: Add cases for -{C,D,U} without a source tree
5873815fef cmake: distinguish '-Cpath' from '-C path' in source dir parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2517
2018-10-29 09:29:34 -04:00
Brad King
0f84db3af4 Merge topic 'appdef-stdstring'
b2c85cb698 cmLocalGenerator::AppendDefines: Remove const char* overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2533
2018-10-29 09:27:23 -04:00
Kitware Robot
01c6f99c2d CMake Nightly Date Stamp 2018-10-29 00:01:16 -04:00
Kitware Robot
7523c1dcd9 CMake Nightly Date Stamp 2018-10-28 00:01:07 -04:00
Kitware Robot
bae85447b8 CMake Nightly Date Stamp 2018-10-27 00:01:11 -04:00
Ben Boeckel
4babc9058a cmTargetPropCommandBase: check keywords after parsing
The following was disallowed:

   add_library(iface INTERFACE)
   target_link_libraries(iface PUBLIC)

just due to the mention of the `PUBLIC` keyword. Instead, only error if
there are actually `PUBLIC` dependencies specified (and analogously for
other restrictions).

Update tests to expect this new behavior.
2018-10-26 12:09:41 -04:00
Ben Boeckel
45a49ae58a cmTargetPropCommandBase: simplify code path
The outside of the loop does the same return expression.
2018-10-26 12:08:45 -04:00
Ben Boeckel
9f64974f5e cmTargetPropCommandBase: skip property setting if there's nothing to add
Some target types don't allow setting certain properties even if there
is no value being set there. Guard against this by avoiding property
setting when there is nothing to add.
2018-10-26 12:08:16 -04:00