24195 Commits

Author SHA1 Message Date
Brad King
316bd45439 CMake 3.11.4 2018-06-14 09:13:47 -04:00
Brad King
4e6ff0ae24 Windows: Restore support for running CMake through a symlink
The change in commit v3.11.3~3^2 (cmSystemTools: Revert GetRealPath
implementation on Windows, 2018-05-29) broke the feature added by commit
v3.11.0-rc1~64^2 (Windows: Add support for running CMake tools through a
symlink, 2018-01-21).  Use `GetRealPathResolvingWindowsSubst` in the
latter code path to restore it.

Fixes: #17882
2018-06-12 11:15:50 -04:00
Brad King
8738eba336 CMake 3.11.3 2018-05-31 09:04:20 -04:00
Brad King
f393602131 Merge branch 'cpack-wix-sources' into release-3.11
Merge-request: !2116
2018-05-30 09:53:54 -04:00
Brad King
ca49f1a8e4 CPack: Fix cross-compilation of WiX generator
Fix the case of the path to source files so it works on case-sensitive
filesystems.

Fixes: #18042
2018-05-30 09:39:16 -04:00
Brad King
83630d4918 cmSystemTools: Revert GetRealPath implementation on Windows
The use of `uv_fs_realpath` introduced by commit v3.11.0-rc1~445^2~1
(cmSystemTools: Implement GetRealPath on Windows, 2017-10-02) causes
`subst` drives to be expanded on Windows, breaking existing use cases.
Revert its use until an alternative implementation can be chosen.

Preserve the behavior introduced by commit v3.11.0-rc1~445^2
(cmTimestamp: For symlinks switch to timestamp of resolved path,
2017-10-02) by retaining use of `uv_fs_realpath` in a function of
a different name.

Fixes: #18033
Issue: #17206
2018-05-29 14:00:33 -04:00
Brad King
519427e32c CMake 3.11.2 2018-05-17 09:07:43 -04:00
Brad King
813bcc2997 Merge branch 'custom-command-expand-empty' into release-3.11
Merge-request: !2074
2018-05-14 11:59:51 -04:00
Brad King
6e59491659 add_custom_{command,target}: Fix crash on empty expanded command
Our custom command generation logic assumes that all command lines have
at least `argv0`.  In `add_custom_{command,target}` we already check
that at least a `COMMAND` was given, but using `COMMAND_EXPAND_LISTS` in
combination with a generator expression that expands to an empty string
may produce an empty command line.  In this case simply add an empty
string as a command to maintain our internal invariant.

Fixes: #17993
2018-05-14 11:54:27 -04:00
Brad King
7b62ec2451 Merge branch 'autogen_register_info_files' into release-3.11
Merge-request: !2071
2018-05-14 09:40:13 -04:00
Sebastian Holtermann
e461a136c1 Autogen: Register generated dependency files
For CMP0058 record that rcc info files are generated by CMake.

Fixes: #17985
2018-05-14 09:21:14 -04:00
Brad King
4f0c5d3775 Merge branch 'restore-imported-lib-alias-diagnostic' into release-3.11
Merge-request: !2058
2018-05-10 10:11:48 -04:00
Brad King
e567d7eb63 add_library: Restore error on alias of non-global imported target
In commit v3.11.0-rc1~433^2~1 (Add support for IMPORTED GLOBAL targets
to be aliased, 2017-09-14) we accidentally dropped the error on calling
`add_library` to alias an imported target that is not globally visible.
The `add_executable` command's equivalent check was properly updated.
Restore the check in `add_library` with the same update.  Also fix the
test case accordingly.

Fixes: #17982
2018-05-10 09:57:31 -04:00
Brad King
321442580e Merge branch 'cxx-checks-tolerate-more-warnings' into release-3.11
Merge-request: !2019
2018-04-30 09:18:58 -04:00
Brad King
2254b72061 C++ feature checks: Filter out warnings caused by local configuration
In some environments the linker produces warnings like

    warning: directory not found for option
    warning: object file compiled with -mlong-branch ...

These do not affect the availability of C++ features we're checking,
so filter them out.

Fixes: #17850, #17947
2018-04-30 09:18:15 -04:00
Brad King
a92ee4e30d Merge branch 'backport-ninja-issue-17942' into release-3.11
Merge-request: !2010
2018-04-26 08:41:18 -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
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
Brad King
fbe6cd1596 CMake 3.11.1 2018-04-17 08:33:46 -04:00
Brad King
d00306636b Merge branch 'backport-fix-explicit-CMakeLists.txt' into release-3.11
Merge-request: !1959
2018-04-13 09:49:51 -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
3c0fed488f Merge branch 'cpack-trace-nullptr' into release-3.11
Merge-request: !1950
2018-04-10 15:01:43 -04:00
Brad King
6f2701abf6 CPack: Fix crash on invalid generator name
In commit v3.11.0-rc1~68^2 (CPack: accept --trace and --trace-expand,
2017-12-09) a nullptr dereference was added that occurs when
`cpack -G NotAGenerator` is invoked.  Add the needed condition.

Fixes: #17900
2018-04-10 15:00:37 -04:00
Brad King
ef077c8ba4 Merge branch 'fix-crash-trace-exp-uninit-vars' into release-3.11
Merge-request: !1944
2018-04-09 12:01:10 -04:00
R2RT
aad360eb3d Fix crash with --trace-expand --warn-uninitialized together
Some code paths in `ExpandVariablesInString{New,Old}` were not checking
the `filename` parameter for a null pointer, but this can happen when
using the above flags together.  Add the checks and a test case.

Fixes: #17896
2018-04-09 11:59:07 -04:00
Sebastian Holtermann
b11e2c80b1 Autogen: Print moc/uic/rcc output to stdout
The output of moc/uic/rcc used to be discarded unless
the program failed. This lets moc/uic/rcc print their
output to stdout even on success.

Closes #17860
2018-04-03 17:20:30 +02:00
Sebastian Holtermann
1d2c9d8c6d Autogen: Use std::istreambuf_iterator for file so string reading
This adds a dedicated mutex for file reading and writing to
cmQtAutoGenerator::FileSystem. The purpose of the change is
to avoid that long files reads block cmsys based path computations,
which are protected by an other mutex.
2018-04-03 17:20:30 +02:00
Sebastian Holtermann
ccc38fa509 Autogen: Protected calls to cmFilePathChecksum
Closes #17861
Closes #17862
2018-04-03 17:20:30 +02:00
Sebastian Holtermann
719b24c872 Autogen: Protected calls to cmQtAutoGen::SubDirPrefix 2018-04-03 17:20:30 +02:00
Sebastian Holtermann
9a73615815 Autogen: Protected calls to cmSystemTools::GetFilenameWithoutLastExtension 2018-04-03 17:20:30 +02:00
Sebastian Holtermann
65203ce407 Autogen: Protected calls to cmSystemTools::Split/JoinPath 2018-04-03 17:20:30 +02:00
Sebastian Holtermann
14a86c9ea7 Autogen: Protected calls to cmSystemTools::CollapseCombinedPath 2018-04-03 17:20:29 +02:00
Brad King
61fd4c7420 CMake 3.11.0 2018-03-28 07:26:56 -04:00
Brad King
36881ee416 Merge branch 'ctest_update-memory-problems' into release-3.11
Merge-request: !1893
2018-03-27 08:51:01 -04:00
Brad King
27f033550a ctest_update: Fix crash when handling svn externals
Refactoring in commit v3.9.0-rc1~156^2 (c++: prefer vectors over lists,
2017-05-04) switched `cmCTestSVN::Repositories` from `std::list` to
`std::vector`.  This can cause re-allocation when svn externals are
processed and break the `RootInfo` pointer that is supposed to point at
the first repository element.  Switch back to `std::list` so that the
address remains stable.

Fixes: #17854
2018-03-27 08:46:20 -04:00
Brad King
75e8af3354 cmSystemTools: Fix ParseArguments out-of-bounds read
When checking for a Windows-style leading path, do not read past the
null terminator.

Issue: #17854
2018-03-27 08:46:20 -04:00
Brad King
70c50aa23c Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF"
Revert commit v3.8.0-rc1~305^2 (Remove CTestTestfile.cmake when BUILD_TESTING
is OFF, 2016-11-14) again.  We reverted it once in commit v3.8.0-rc3~22^2
(Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF", 2017-03-06) but
it was accidentally restored by commit v3.11.0-rc1~387^2 (server: add
"ctestInfo" request to get test info, 2017-10-25), perhaps due to conflict
resolution during rebase.

We cannot remove `CTestTestfile.cmake` when testing is off because it breaks
projects that never enable testing but create their own `CTestTestfile.cmake`
manually instead.  Revert the change again and add a test case.
2018-03-26 07:44:22 -04:00
Brad King
6b9172d759 CMake 3.11.0-rc4 2018-03-19 09:25:26 -04:00
Brad King
a039029e7c Merge branch 'genex-COMPILE_LANGUAGE-system-include' into release-3.11
Merge-request: !1844
2018-03-13 13:40:25 -04:00
Brad King
a54b56a10b Merge branch 'ccmake-stack-smashing' into release-3.11
Merge-request: !1836
2018-03-13 13:40:17 -04:00
Tianhao Chai
7899e53691 ccmake: fix status line buffer overflow on very wide terminals
A mistyped length calculation will memset across stack frame when
the user's terminal width is larger than 270.
2018-03-13 13:38:12 -04:00
Brad King
1b5e52fd65 Genex: Fix COMPILE_LANGUAGE propagation through try_compile
When evaluating include directories during export to a `try_compile`
test project, thread the compile language through to the generator
expression evaluator so it can support `$<COMPILE_LANGUAGE:...>`.

Issue: #17811
2018-03-12 13:30:14 -04:00
Brad King
2deb9b7f34 Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories
When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating
`INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the
compile language through to the generator expression evaluator so
that it can support `$<COMPILE_LANGUAGE:...>`.

Fixes: #17811
2018-03-12 11:45:01 -04:00
Brad King
c5541cf0da CMake 3.11.0-rc3 2018-03-09 08:33:11 -05:00
Brad King
9288abf567 Merge branch 'update-kwsys' into release-3.11
Merge-request: !1830
2018-03-07 07:39:16 -05:00
Brad King
2c5b4359f8 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2018-03-07 (2ad561e7)
2018-03-07 06:48:34 -05:00
Sebastian Holtermann
50b7be6d1f Autogen: Check if a file is empty before reading it
Calling `std::string::front()` on an empty string results
in an undefined behavior by the C++ standard.
In gcc8 it causes an assertion to fail.

This adds a check to `AUTOGEN` if a file to read is empty
and in case avoids the use of an empty `std::string` buffer.

Closes #17793
2018-03-06 08:35:08 -05:00
Brad King
ac925ec09e CMake 3.11.0-rc2 2018-02-27 09:34:35 -05:00
Brad King
72a85d9f0b Merge branch '14297-partial-xcode-zero-check' into release-3.11
Merge-request: !1790
2018-02-23 08:17:51 -05:00
Gregor Jasny
481420ee89 Xcode: Generate ZERO_CHECK generator target only once
In case CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY has been enabled
generate only the root-level ZERO_CHECK target so targets in
subdirectories pick up the root generator target of ZERO_CHECK.

For the case that CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY is not
enabled more investigation and a proper and final fix is still needed.

Issue: 14297
2018-02-22 21:15:48 +01:00