Commit Graph

26507 Commits

Author SHA1 Message Date
Brad King
0af57a1852 Merge topic 'autogen_cache'
7d50e1c611 Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data caching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3290
2019-05-08 12:41:15 -04:00
Craig Scott
4aace9b015 Merge topic 'ctest-update-version-override'
2a34d0ac36 ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE
7ddac95121 Help: cross-ref and wording of docs related to ctest_update()
a0d04d8810 testing: Update terminology in ctest_update tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Merge-request: !3277
2019-05-08 08:49:34 -04:00
Kitware Robot
afd7df9d1c CMake Nightly Date Stamp 2019-05-08 00:01:05 -04:00
Brad King
fa077acba5 Merge topic 'enforce-explicit-use-of-project'
1527defbfe cmMakefile: Enforce explicit use of project() command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3245
2019-05-07 11:17:26 -04:00
Brad King
1628e4677a Merge topic 'touch-after-ranlib'
f83e4359f2 Apple: Preserve high resolution mtime for static libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3283
2019-05-07 11:12:38 -04:00
Zack Galbreath
2a34d0ac36 ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE
Set this in a CTest script to explicitly define what the current revision
will be reported as in Update.xml.
2019-05-07 10:45:47 -04:00
Sebastian Holtermann
7d50e1c611 Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data caching
New features
------------

CMake's `AUTOMOC` and `AUTOUIC` now cache information extracted when parsing
source files in `CMakeFiles/<ORIGIN>_autogen.dir/ParseCache.txt`.
This leads to faster `<ORIGIN>_autogen` target rebuilds, because source files
will be parsed again only if they're newer than the `ParseCache.txt` file.
The parse cache will be recomputed if it is older than the CMake executable.

`AUTOMOC` and `AUTOUIC` now check if `moc` or `uic` output files are older
than the `moc` or `uic` executable.  If an output file is older than the
compiler, it will be regenerated.  Therefore if a new `moc` or `uic` version
is installed, all output files will be regenerated.

`AUTOMOC` and `AUTOUIC` error and warning messages are more detailed.

Internal changes
----------------

`moc` and `uic` output file names are not computed in the `_autogen`
target anymore but in `cmQtAutoGenInitializer`.  This makes the available at
the configuration stage for improved dependency computations (to be done).

In `AutogenInfo.cmake`, equally sized lists for "source file names",
"source file flags" and "compiler output file names" are passed to the
`_autogen` target.  This replaces the separate file lists for
`AUTOMOC` and `AUTOUIC`.

Files times are read from the file system only once by using `cmFileTime`
instances instead of `cmQtAutoGenerator::FileSystem::FileIsOlderThan` calls.

All calls to not thread safe file system functions are moved to non concurrent
fence jobs (see `cmWorkerPool::JobT::IsFence()`).  This renders the
`cmQtAutoGenerator::FileSystem` wrapper class obsolete and it is removed.

Instead of composing a single large settings string that is fed to the
`cmCryptoHash`, now all setting sub strings are fed one by one to the
`cmCryptoHash` and the finalized result is stored.

The `std::mutex` in `cmQtAutoGenerator::Logger` is tagged `mutable` and most
`cmQtAutoGenerator::Logger` methods become `const`.

Outlook
-------

This patch provides the framework required to

- extract dependencies from `.ui` files in `AUTOUIC`.
  These will help to address issue
  #15420 "AUTOUIC: Track uic external inputs".

- generate adaptive `make` and `ninja` files in the `_autogen` target.
  These will help to address issue
  #16776 "AUTOUIC: Ninja needs two passes to correctly build Qt project".

- generate (possibly empty) `moc` and `uic` files for all headers instead of a
  `mocs_compilation.cpp` file.
  This will help to address issue
  #17277 "AUTOMOC: Provide a option to allow AUTOMOC to compile individual "
         "moc_x.cxx instead of including all in mocs_compilation.cxx"
2019-05-07 12:42:19 +02:00
Kitware Robot
9bf6cbc8f7 CMake Nightly Date Stamp 2019-05-07 00:01:05 -04:00
Brad King
f0185ff14a Merge topic 'fix_ios_try_compile'
275b6b3194 iOS: Fix try_compile FILE_COPY not to fail

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3272
2019-05-06 09:32:25 -04:00
Alexandru Croitor
275b6b3194 iOS: Fix try_compile FILE_COPY not to fail
When building for iOS, the compiled target is placed into a bundle.
If a single-configuration generator is used, like Makefiles or Ninja,
the try_compile FILE_COPY behavior fails to find the bundle, because
it only looks for the bundle inside a Debug subfolder (presumably
to support a multi-configuration generator like Xcode).

Consider looking for the bundle in the root try_compile folder, as
well as in the location specified by CMAKE_TRY_COMPILE_CONFIGURATION.

Closes: #19211
2019-05-06 09:23:27 -04:00
Bartosz Kosiorek
1527defbfe cmMakefile: Enforce explicit use of project() command
Fixes: 17714
2019-05-06 10:58:10 +02:00
Kitware Robot
0f27e7d165 CMake Nightly Date Stamp 2019-05-06 00:01:05 -04:00
Gregor Jasny
f83e4359f2 Apple: Preserve high resolution mtime for static libraries
On macOS ranlib truncates the fractional part of the static achive
file modification time.  If the archive and at least one contained
object file were created within the same second this will make look
the archive older than the object file.  On subsequent ninja runs
this leads to re-achiving and updating dependent targets.

As a work-around we touch the archive after ranlib.

Closes: #19222
2019-05-05 16:14:28 +02:00
Kitware Robot
3771a75d58 CMake Nightly Date Stamp 2019-05-05 00:01:03 -04:00
Kitware Robot
d3a0582b0c CMake Nightly Date Stamp 2019-05-04 00:01:05 -04:00
Brad King
186ca170da Merge topic 'std-pipes-always'
c85524a94a Ensure stdin, stdout, and stderr pipes are always open

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !3282
2019-05-03 11:48:46 -04:00
Brad King
6f242acfcb Merge topic 'cpack-ifw-stylesheet'
c474fb2777 CPack/IFW: Add StyleSheet field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3270
2019-05-03 11:46:25 -04:00
Brad King
9713154cf6 Merge topic 'jobs-positive-value'
6ad699358b cmake: --build -j <jobs> should not accept 0.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3255
2019-05-03 11:45:32 -04:00
Brad King
323c4fb989 Merge topic 'genex-TARGET_FILE_BASE_NAME-manage-postfix'
6e5ccabe9b Genex: Update $<TARGET_FILE_BASE_NAME:...>: take care of POSTFIX
1f4c9aa7d2 Refactor: introduce method cmGeneratorTarget::GetFilePostfix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3267
2019-05-03 11:42:47 -04:00
Kitware Robot
713f1a0e7d CMake Nightly Date Stamp 2019-05-03 00:01:06 -04:00
Brad King
c85524a94a Ensure stdin, stdout, and stderr pipes are always open
On non-Windows platforms libuv assumes that file descriptors 0-2 are
always used for standard pipes and never for anything else.  Otherwise,
libuv may re-use one of these descriptors and then fail an assertion
when closing it.  Similarly, On Windows platforms our ConsoleBuf
implementation assumes that the standard handles are always open.

If CMake is run with any standard pipes closed, open them with
`/dev/null` or `NUL` to satisfy these assumptions.

Fixes: #19219
2019-05-02 14:34:58 -04:00
Zaytsev Yuriy
c474fb2777 CPack/IFW: Add StyleSheet field 2019-05-02 13:01:31 -04:00
Brad King
e08efc36eb Merge topic 'genex-code-cleanup'
3d856eba16 cmGeneratorExpressionNode: refactor TargetPropertyNode
9e1df5df54 cmGeneratorExpressionNode: use ctor arguments instead of macro
36f36d6a49 cmGeneratorExpressionNode: add VersionNode
3f57787dff cmGeneratorExpressionNode: remove structs CompilerId*, CompilerVersion*
20d7c5631e cmGeneratorExpressionNode: add CharacterNode
abd62201bd cmGeneratorExpressionNode: simplify code in EqualNode
f2c8ff8259 cmGeneratorExpressionNode: Simplify static string constant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3234
2019-05-02 09:43:09 -04:00
Brad King
3b4315dc23 Merge topic 'code-cleanup-3'
75643755a1 cmGlobalVisualStudioGenerator: remove redundant variables
615fb2633c cmGlobalVisualStudioGenerator: use cmJoin to join the filenames
30c98db61b cmGlobalVisualStudioGenerator: use auto instead of iterator types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3257
2019-05-02 09:42:08 -04:00
Marc Chevrier
6e5ccabe9b Genex: Update $<TARGET_FILE_BASE_NAME:...>: take care of POSTFIX
This capability complement MR !3190 and !3207
and is also needed to solve issue #18771.
2019-05-02 11:01:10 +02:00
Marc Chevrier
1f4c9aa7d2 Refactor: introduce method cmGeneratorTarget::GetFilePostfix 2019-05-02 10:06:04 +02:00
Kitware Robot
3ee16ef31b CMake Nightly Date Stamp 2019-05-02 00:01:07 -04:00
Brad King
87120b9c2a Merge topic 'out-of-dir-linking-private-deps'
3d3713121b target_link_libraries: Fix static library private deps in other dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3276
2019-05-01 11:50:33 -04:00
Fred Baksik
6ad699358b cmake: --build -j <jobs> should not accept 0.
Fixes #19059
2019-05-01 09:15:51 -04:00
Kitware Robot
f4e2face6f CMake Nightly Date Stamp 2019-05-01 00:01:05 -04:00
Craig Scott
e138207c42 Merge topic 'message-new-types-and-logging'
599587feb1 message(): Minor code modernization
6cc93b370e message(): Add support for log levels
377d1b7896 cmSystemTools: Remove unused message-related code, simplify logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !3268
2019-04-30 18:35:06 -04:00
Brad King
3d3713121b target_link_libraries: Fix static library private deps in other dirs
In commit a1ad0a699b (target_link_libraries: Allow use with targets in
other directories, 2018-09-07, v3.13.0-rc1~94^2) we accidentally broke
the logic that adds `$<LINK_ONLY:...>` to private dependencies of static
libraries in their `INTERFACE_LINK_LIBRARIES` in the case that the
dependency is added from outside the directory creating the library.
The check for a valid target name should apply to the original name
specified by the caller and not the encoded cross-directory reference.

Fixes: #19197
2019-04-30 13:53:10 -04:00
Brad King
ea026fb219 Merge topic 'cmuvstreambuf'
c74698cb75 cmUVStreambuf: Add std::streambuf implementation for uv_stream_t
8cfd25db71 cmUVHandlePtr: Add cm::uv_loop_ptr
c0e6b22d0a Refactor: Move/rename cmProcessGetPipes() to cmGetPipes()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3240
2019-04-30 10:35:11 -04:00
Kyle Edwards
40852eed8e Merge topic 'source_group-tree-files'
8d93815d20 source_group command ensures that FILES arguments are actually files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3265
2019-04-30 10:30:35 -04:00
Brad King
d0e6fc2833 Merge topic 'relax_TARGET_OBJECT_generator_expr'
ce078dda79 Relax the usage of TARGET_OBJECTS generator expression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3178
2019-04-30 10:09:52 -04:00
Brad King
d9a4da453f Merge topic 'server-deprecate'
996e1885c4 server: deprecate in favor of the file-api

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !3251
2019-04-30 10:07:27 -04:00
Brad King
60b28de5c8 Merge topic 'add-execute_process-command-echo'
044dcf9f8d execute_process: Add option to echo command lines
d350fb6889 execute_process: Manage KWSys Process lifetime with unique_ptr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3165
2019-04-30 10:05:09 -04:00
Kitware Robot
4eebc52eca CMake Nightly Date Stamp 2019-04-30 00:01:05 -04:00
Kitware Robot
a40c9825bb CMake Nightly Date Stamp 2019-04-29 00:01:05 -04:00
Alex Turbov
599587feb1 message(): Minor code modernization 2019-04-28 22:45:44 +10:00
Alex Turbov
6cc93b370e message(): Add support for log levels
Relates: #18943
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2019-04-28 22:45:44 +10:00
Kitware Robot
d8426b57a6 CMake Nightly Date Stamp 2019-04-28 00:01:04 -04:00
Alex Turbov
377d1b7896 cmSystemTools: Remove unused message-related code, simplify logic 2019-04-27 18:36:45 +10:00
Kitware Robot
a9c113fd3e CMake Nightly Date Stamp 2019-04-27 00:01:04 -04:00
Kitware Robot
68031b4fdd CMake Nightly Date Stamp 2019-04-26 00:01:07 -04:00
Kyle Edwards
1ddce8fd6d Merge topic 'cmWorkerPool_Tweaks'
56890ede2a cmWorkerPool: Factor our worker thread class (internals)
9794b72d38 cmWorkerPool: Set worker thread count separately to Process()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3260
2019-04-25 15:34:12 -04:00
Mateusz Janek
8d93815d20 source_group command ensures that FILES arguments are actually files 2019-04-25 20:51:40 +02:00
Kyle Edwards
c74698cb75 cmUVStreambuf: Add std::streambuf implementation for uv_stream_t
This will allow std::istream/std::ostream-based interaction with
processes spawned by libuv.
2019-04-25 12:14:00 -04:00
Kyle Edwards
8cfd25db71 cmUVHandlePtr: Add cm::uv_loop_ptr 2019-04-25 12:03:08 -04:00
Kyle Edwards
c0e6b22d0a Refactor: Move/rename cmProcessGetPipes() to cmGetPipes() 2019-04-25 12:03:08 -04:00