In `AddGlobalTarget_{Test,Package,PackageSource}`, check conditions up
front and return early if the targets are not needed. This reduces the
indentation of the main logic.
393e0fbe cmTimestamp: For symlinks switch to timestamp of resolved path
640709e7 cmSystemTools: Implement GetRealPath on Windows
d41582fc Call GetRealPath through cmSystemTools instead of KWSys directly
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1202
4e7f6738 Defer check for sources within a target until generation.
6e4e7c65 Tests: Exclude bad RunCMake.add_executable case on multi-arch Xcode
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1242
ModifiedTime uses stat on UNIX which does resolve symlinks, however Windows implementation relies on GetFileAttributesExW which does not. Getting real file path before calling ModifiedTime will not change UNIX semantic and will fix Windows behavior.
Fixes: #17206
Since commit v3.9.0-rc1~224^2~1 (FindMPI: MPIEXEC handling improvements,
2017-04-21) the `ProcessorCount` module is being used to initialize
`MPIEXEC_MAX_NUMPROCS`. However, this leads to the logical cores being
counted rather than the physical ones, and some MPI implementations like
OpenMPI will error if mpiexec is called with that number. Switch it to
the number of physical cores using `cmake_host_system_information`.
This ensures that if `MPIEXEC_MAX_NUMPROCS` is being used to set up MPI
tests with CTest or similar that the tests won't spuriously fail due to
OpenMPI refusing to start the application.
9ffb3538 VS: Select and save a VS 2017 instance persistently
17edfa41 cmVSSetupHelper: Add option to specify an instance
a19b8113 CheckLanguage: Pass generator instance into check
6b3cd64d ExternalProject: Propagate the generator instance
314613d1 Add infrastructure for generators to select a build tool instance
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1394
The `add_library` and `add_executable` commands can now be called with
no source-files and won't generate a warning or error message, as long
as source-files will be added later via the `target_sources` command.
If during the generation step still no sources are associated with
targets created by such calls a useful error message will be generated
and generation fails.
Targets of type `INTERFACE_LIBRARY`, `UTILITY` or `GLOBAL_TARGET` are
excluded from this check because we do not need sources for these target
types during generation.
Fixes: #16872
The `NoSourcesButLinkObjects` case would not be expected to work under
Xcode with multiple architectures even if the target objects were listed
directly as sources. Exclude it. We already exclude similar cases in
`RunCMake.add_library`.
std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14
and an standard compliant implementation has been introduced within the
'cm' namespace: cm::{cbegin,cend}.
std::size is only part of C++17, hence exposing a compliant implementation
within namespace cm (cm::size).
where possible, the standard implementations are reused.