- fix the typo in `foreach` documentation
- fix broken `foreach(... IN ITEMS ... LISTS ...)`
- add tests of `foreach` for existed functionality and fixes
The `PROCESSES` test property name added for CMake 3.16 is too close to
the existing `PROCESSORS` test property. Furthermore, the property in
principle specifies groups of resources organized in a way that is
meaningful to a particular test. The groups may often correspond to
processes but they could have other meanings. Since the property name
`PROCESSES` has not been in a final 3.16 release yet, simply rename it
to `RESOURCE_GROUPS`.
Fixes: #19914
With the 10.x release, PostgreSQL upstream started encoding the version
as `MMmmmm` where `M` is major and `m` is minor. Prior to that, `MMmmPP`
was used where `P` was the patch number. Detect this difference and
decode it based on the used encoding.
Fixes: #19912
7b2dd9dedc Refactor: Use added message types in various modules
949a1e120a message: New message types to mark checks performed by CMake
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3689
A case added by commit 39ac8b4eb5 (ctest: Add --repeat-after-timeout
option, 2019-10-29) includes a success-case timeout of 2 seconds. That
is too short when running under valgrind, so extend it to 5 seconds.
Add an option to re-run tests if they fail. This will help tolerate
sporadic failures.
Issue: #17010
Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
Co-Author: Chuck Atkins <chuck.atkins@kitware.com>
Clang scan-build 7 reports:
```
Tests/CMakeLib/testUTF8.cxx:12:3: warning: 4th function call argument is an uninitialized value
printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast<int>(d[0]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Manual tracing of all call sites shows that all values are initialized.
macOS/Xcode no longer populate /usr/include.
Building with the compiler directly instead of using /usr/bin/c++
can result in missing headers without the -isysroot flag.
Relates: #19885
82cdb26c93 project: Fix potential buffer write-past-end for version components
15a0b0d046 Help: math() expressions must be representable as signed 64-bit
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3948
Follow up commit 0761186949 (project: Add variable
CMAKE_PROJECT_INCLUDE_BEFORE, 2019-03-28, v3.15.0-rc1~294^2) with a
project-specific variant. This variable will be used similar to the
already existing `CMAKE_PROJECT_INCLUDE_BEFORE` and
`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` variables.
Fixes: #19854
797689ab35 PCH: Fix Makefile dependencies to rebuild PCH on header changes
0b10b3ed6b cmMakefileTargetGenerator: Inline WriteObjectBuildFile in only call site
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3928
Since commit 97cc29c766 (VS: Teach generators how to mark per-config
source files, 2017-04-10, v3.9.0-rc1~268^2~2) the VS generators have
known how to generate per-config sources. We've now converted most
other code paths to support per-config sources, so drop the check
that disallows it.
This leaves only per-config support for precompiled headers and unity
build transformations, but those are optional features that can be
addressed later.
Fixes: #18233
Issue: #19789
Teach the Makefile generator to scan the implicit dependencies of PCH
creation. When a header named by `target_precompile_headers` changes
the corresponding PCH must be rebuilt and all consumers recompiled.
Fixes: #19830
Since commit 4ca0526f8a (cmake: Pass -S and -B into PreLoad.cmake and -C
scripts, 2019-08-20, v3.16.0-rc1~195^2) the value of `CMAKE_SOURCE_DIR`
is the source directory rather than the current working directory.
This was correct on its own, but the place storing that value is also
used as the base for relative paths specified on the command line.
The latter should of course be relative to the current working
directory.
The fix is to switch to use a full path internally, unless a full path
is already specified. Add tests for the behaviour of `-C` under these
four circumstances:
{with -S, without -S} x {full path, relative path}
Fixes: #19827
7cf79f4419 message: Support logging a context with each message
5bf85e2517 message: Add new CMAKE_MESSAGE_LOG_LEVEL variable
aa59badd6f Tests: Message log level tests must fail on unwanted output
7c579f0a03 Help: Move CMAKE_MESSAGE_INDENT variable to correct section
4b021bd3e9 message: Minor refactor to make code less verbose
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3680
The previous regular expressions were allowing output from
lower log levels. The tests still pass after these changes but will
now catch regressions (previously they would not have).
3fb146cb11 Tests: Update CompileFeatures test for Intel 19 with VS 2015
847e8bc98c Intel: Fix default C++ dialect detection on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3900
For the Intel Compiler for Windows we have some subtle preprocessor
checks in compiler feature detection to detect C++11 and C++14 modes.
Use these when detecting the default C++ dialect too.
The OLD behaviors of all policies are deprecated, but only by
documentation. Add an explicit deprecation diagnostic for policies
introduced in CMake 3.9 and below to encourage projects to port away
from setting policies to OLD.
Other multi-word command line options use hyphens to separate
the words, so the --loglevel option introduced in CMake 3.15 was
inconsistent in this regard. Rename it to --log-level but still support
the original --loglevel name to preserve backward compatibility.
* Added a fairly comprehensive test suite
* Separated the graph traversal logic from the Graphviz generation
code by introducing a new class, cmLinkItemsGraphVisitor{.h,cxx}
* Made the graph traversal logic less ad-hoc by using existing
methods in the GlobalGenerator; this fixed a few bugs
* Added support for new target types: custom targets, object
and unknown libraries
* Improved support for ALIAS libraries by showing the alias(es)
in the graph
* Introduced new flags to control those new libraries (consistent
with existing flags)
* Updated the documentation
* Removed useless setting to set graph type in dot file
* Improved the node/edge shapes (nicer, more consistent)
* Added a legend to the graph
* Some refactoring and cleanup of the Graphviz generation code
* Added test and fix for issue 19746
The relative path check added by commit 5838aba1aa (Export: Report error
on relative include with genex., 2013-11-26, v3.0.0-rc1~285^2) was added
one condition too early. If the value starts in `${_IMPORT_PREFIX}`
(which comes from `$<INSTALL_PREFIX>`) then it is an absolute path.
Fixes: #19791
If the target has C files, it will get a C PCH file.
The same for C++ files. The linker language is no
longer used to determine which language to use for
PCH.
Fixes: #19790
3d02593986 FindJava: ensure all versions can be found
14ac253af7 FindJava: tests clean-up
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3871
This algorithm is used to determine whether or not a test can
execute with the available resources. It uses a recursive largest-
first algorithm to try to place the tests into their respective
slots.
The target property introduced by commit 413b71485a (Xcode: Create Xcode
schemes per target, 2019-03-11, v3.15.0-rc1~347^2) was accidentally not
initialized by `CMAKE_XCODE_GENERATE_SCHEME` for custom targets. Fix it
and update the test.
Fixes: #19759
The target property introduced by commit 413b71485a (Xcode: Create Xcode
schemes per target, 2019-03-11, v3.15.0-rc1~347^2) was accidentally not
initialized by `CMAKE_XCODE_GENERATE_SCHEME` for custom targets. Fix it
and update the test.
Fixes: #19759
ed98209ddc Revise include order using clang-format-6.0
185fe49f29 clang-format: Normalize headers presentation
42ef28b4f3 Remove unused uid_t/gid_t types on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Merge-request: !3851
When linking to a shared library target that has version symlinks, add
an order-only dependency on the build statement that creates the links.
This ensures that the links exist for use at runtime.
Fixes: #19774
By using clang-format directives 'IncludeBlocks' and 'IncludeCategories'
headers are regrouped by categories:
1. "cmConfigure.h" which must be first
2. header matching current implementation file
3. standard language headers
4. CMake replacement ones
5. external headers (i.e. #include directive with '<' and '>')
6. Qt headers
7. cmsys/* headers
8. cm_* headers
9. CMake headers (i.e. starting with 'cm[A-Z]')
10. all other headers
Fixes: #19674
The "all" target defined for a subdirectory (e.g. `cd sub; make` or
`ninja sub/all`) should not include the "all" targets from nested
subdirectories (e.g. `sub/sub`) that are marked as `EXCLUDE_FROM_ALL`.
Fix this and add a test case.
Issue: #19753
Co-Author: Sebastian Holtermann <sebholt@xwmw.org>
dd0f304613 Objective C/C++: Add compiler standard detection
b515af782b Help: Add release note for Objective-C/C++ language support
9e66397c28 Languages: Add support for Objective-C++
80f120a85f Languages: Add support for Objective-C
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3811
Resolve conflicts with changes since the 3.15 series:
* Convert `cmSystemTools::IsOn` => `cmIsOn`.
* Move one "EXCLUDE_FROM_ALL" target property logic fix to
its new location in `cmMakefile::AddNewUtilityTarget`.
The "all" target in each directory is supposed to have targets from that
directory even if the directory itself is marked `EXCLUDE_FROM_ALL` in
its parent. This was broken by commit dc6888573d (Pass EXCLUDE_FROM_ALL
from directory to targets, 2019-01-15, v3.14.0-rc1~83^2) which made the
participation of a target in "all" independent of context. Revert much
of the logic change from that commit to restore the old behavior. Then
re-implement the behavior intended by the commit to keep its test
working. Extend the test to cover the old behavior too.
Fixes: #19753
Add entries in Modules and Modules/Platform to support
Objective-C++ compiler determination and identification.
Add Modules to check Objective-C++ compiler flags, source
compilations, program checks, etc...
Use OBJCXX as the designator of the language, eg:
project(foo OBJCXX)
Add various tests for Objective-C++ language features. Add
tests to preserve C++ handling of .M and .mm files when
Objective-C++ is not a configured language.
Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
Add entries in Modules and Modules/Platform to support
Objective-C compiler determination and identification.
Add Modules to check Objective-C compiler flags, source
compilations, program checks, etc...
Use OBJC as the designator of the language, eg:
project(foo OBJC)
Add various tests for Objective-C language features. Add
tests to preserve C++ handling of .m and .mm files when
OBJC is not a configured language.
Co-Authored-By: Cristian Adam <cristian.adam@gmail.com>
b2fd479df5 FindBinUtils: Use the compiler to get the path to compiler tools
587ccffe74 Tests: Add symbols to FortranModules static libraries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !3854
4dc8c153ec Tests: Teach VSWinStorePhone to verify the content of generated xap
481070a78a Tests: Teach VSWinStorePhone to verify the content of generated appx/msix
acdb326610 VS: Do not reference output assemblies of targets with no output
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3778
When GNU `ar` creates an archive with no symbols it has only an
empty header but no string table. On Solaris the OS-provided `ld`
fails in this case:
ld: elf error: file libfoo.a: elf_getarsym
Update our test to actually provide symbols from its archives.
fd3a394614 add_custom_command: Format files in error message in a single line
a1cc6b4447 add_custom_target: Add output checks for custom target byproducts
cbb861ade8 add_custom_command: Add tests for custom command output checks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3850
This was accidentally left out of commit 0467a2f91b (PCH: add
PRECOMPILE_HEADERS to special properties, 2015-03-12). Also add a test
case for `install(EXPORT)` and `export()` propagation of precompiled
headers.
Fixes: #19741
Add a test to verify the content of generated UWP app package - appx/msix.
MSIX format was introduced Visual Studio 2017 version 15.9.0 and
Windows SDK version 17763.
0e1faa28cb cmMakefile: Separate custom command setup from actual creation
56c204e8eb cmMakefile: Refactor AddCustomCommandOldStyle to be delay friendly
3061dc6ac9 add_custom_command: Add tests for rejecting literal quotes in commands
e893ab94ba cmMakefile: Validate command line for all custom commands
f1e846fdde cmMakefile: Extract custom command validation method
4926ab2454 cmMakefile: Create all generated byproducts as known sources
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3822
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
cc0900d9cd Help: Add release notes for AUTOMOC_PATH_PREFIX
692d8e3492 Help: Add documentation for AUTOMOC_PATH_PREFIX
1933ade9f1 Tests: At QtAutogen.MocIncludeSymlink test
706d9738a6 Tests: Merge QtAutogen.MocIncludeStrict and MocIncludeRelaxed
d018d27c10 Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)
77983c8147 Autogen: Add IsHeader flag to SourceFileT class
f9e5441eb4 Autogen: Abbreviate file paths in messages
51676cf655 Autogen: Split JobEvalCacheT job into separate moc and uic jobs
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3818
KWSys now requires C++11 but we want this test to be able to run as
C++98. Copy the KWSys DynamicLoader implementation (with original
notice headers and license reference) and update it to work alone.
3b409643bd Byproducts: Add test for collapsing of full paths in byproducts
445ff5ccdf Byproducts: collapse full paths of custom target byproducts
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3804
28cb86d796 FindPkgConfig: Allow libraries that can't be found with their full path
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Rolf Eike Beer <eike@sf-mail.de>
Merge-request: !3781
There's no way to know that loading an arbitrary module doesn't pull in
extra dependent modules so the test case asserting that exactly one module
was loaded isn't valid.
pkg-config's .pc files can sometimes provide libraries that are visible to
the linker but not present in CMake's known search paths. In the case
where CMake can find some, but not all of the library dependencies
provided in a .pc file, this allows them to be passed through as "-lfoo"
when the full path can't be found.
This also removes the test failure cases that occured because of this
scenario and adjsuts the remaining tests to account for not-found
libraries
Add test for collapsing of full paths in byproducts and additional tests for
the GENERATED source file properties set by add_custom_command and
add_custom_target with relative paths.
Add test for target-level dependency of custom target to POST_BUILD event via
byproduct. Remove explicit dependencies in test which are no longe required
due to introduced dependencies on build events via byproducts.
Issue: #19005
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators. Leave new expressions and cast
expressions for later.
Previously the CMake didn't compute the required set of libraries
needed to properly device link a static library when
CUDA_RESOLVE_DEVICE_SYMBOLS was enabled.
7786a05c70 Unity build: Add XCode support
1353802af3 Unity build: Add unit tests
8dfeb5d278 Unity build: Add support for Visual Studio generator
7114c141e2 Unity build: Add support for Ninja and Makefile generators
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Stanislav Ershov <digital.stream.of.mind@gmail.com>
Acked-by: Evgeniy Dushistov <dushistov@mail.ru>
Acked-by: Viktor Kirilov <vik.kirilov@gmail.com>
Merge-request: !3611
The Intel Fortran compiler supports an extension that allows conditional
compilation based on preprocessor definitions specified on the command
line even when not preprocessing.
Fixes: #19664
dca9c33abc Tests: Remove old IPO test
c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm
079b8e2916 Clang: prefer lld-link over link.exe
6e3655db2c Clang: add LTO support for GNU-command line clang on windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3527
25f29b9741 cuda: Adapted tests to work with modified cuda toolset
ee86770a3f cuda: Added docs for extended cuda toolset
0ad180d712 cuda: Extend cuda compiler detection to work with custom cuda path
55b0532128 cuda: Extend vs10 target generator to use custom cuda path
df0247a371 cuda: Extend toolset argument to accept path
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3713
7828577065 FindBoost: Add support for Boost 1.71
cf29fa18c8 FindBoost: Unwrap compatibility INTERFACE targets for legacy variables
d7df3cd73f FindBoost: Remove incorrect 1.70 timer dependency
8ff43de1a5 FindBoost: Simplify conditional block for last known version
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dennis Klein <d.klein@gsi.de>
Merge-request: !3763
Since commit 0dd6772a89 (FindBoost: Add legacy variables and targets for
compatibility, 2019-06-14, v3.15.0-rc2~3^2~1) we extract information
from imported targets provided by upstream `BoostConfig.cmake` files.
However, upstream Boost 1.71 provides some imported targets only for
compatibility. They are just INTERFACE libraries that wrap around the
real target named by `INTERFACE_LINK_LIBRARIES`. Unwrap this layer so
we can extract the real imported location.
Fixes: #19656
For the multi-configuration generators one can specify the list
of configurations to include in the package.
E.g. having a project, where debug libraries have a suffix to
distinct them from the release builds, one can build the package
containing both `Debug` and `Release` binaries.
- cuda version is only recognized if it contains no other characters
than "0123456789."
- cuda path is only tested with dummy value . Otherwise a cuda toolkit
must be copied to the integration test machine
When running `pkg_search_module`, it may be useful to get the matching
module name in order to run `pkg_get_variable`.
`pkg_search_module` now defines `<prefix>_MODULE_NAME` which contains
the first matching module name.
Fixes: #19648
We generate a small shell script to drive the steps. Previously a
failure in the `release_cmake.cmake` script was not diagnosed and hidden
from the script exit code by the following upload step. Tell the shell
to terminate with failure on the first command that fails.
689fdbfc61 Utilities/Release: Drop linux64 script in favor of docker build
2d7cfd30ac Utilities/Release: Drop source archive generation in scripts
facc240a45 Utilities/Release: Add docker specs to build and test Linux binaries
bf832ccf01 Utilities/Release: Add README.rst describing directory content
ab153f17bf Utilities/Release: Drop machine-specific README
ed294c1664 Add option to skip CMake tests that need network access
4b8a864d52 Add option to test CMake itself against its hosting CMake
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gregor Jasny <gjasny@googlemail.com>
Merge-request: !3727
It is currently presumed that the linker will generate
a space separated line. This is not the case for some
compilers such as IBM XL where it can output space or
comma separated. This is particularly apparent when IBM XL
is used as the host compiler for CUDA as it generates a comma
separated link line.
- Remove the special case from cmGetSourceFilePropertyCommand
Tests: check LANGUAGE for source file
- use target_sources to add file
- use get_property to read property value
d040f3f1ee Tests: Extend MakeClean test to test various target types
3ed8cffe73 Ninja: Add support for ADDITIONAL_CLEAN_FILES in custom targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3739
Generator expressions in target property VS_CONFIGURATION_TYPE might be used to
set the ConfigurationType to Utility for certain configurations to not build
the target while still linking to the target in other configurations.
Fixes: #19613
Update command-line options, script variables, and documentation to use
the term "group" instead of "track". The old terms are still available
for now, but they are now undocumented.
This makes our terminology more consistent with CDash. The goal of this
change is to make it more clear to our users how CTest and CDash interact
with each other.
Following commit 49cfd390 (cmExportBuildFileGenerator: improve error
message, 2019-06-26), improve the error message related to installed
export sets by referencing the files which contain the exported target
ambiguously.
f4fc0667ae FindOpenACC: Provide import targets and OpenACC_<lang>_OPTIONS variable
9460501ad7 FindOpenACC: Provide a Fortran snippet that compiles with gfortran
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3670
Previously the FindOpenACC module had issues where the contents of
OpenACC_<lang>_FLAGS could not be used with target_compile_options
when it contained multiple compiler flags.
* Update minimum required version to 3.10
* Use VERSION argument to project command rather than separate variables
* Replace `endif(USE_MYMATH)` with more modern `endif()`
* Simplify the call to 'configure_file()'
* Add comments to tutorial.cxx to use as anchors in documentation
* Remove CMakeLists and TutorialConfig.h.in files that users should
create. Consequently, remove Step1 from CMake tests.