Commit Graph

6811 Commits

Author SHA1 Message Date
Brad King
d00bb419ca Add deprecation warnings for policies CMP0069 and below
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.
2019-10-10 09:26:10 -04:00
Brad King
947b02e2e0 Merge topic 'export-genex-under-prefix'
3ded5b6da8 install,export: Fix export of a genex following $<INSTALL_PREFIX>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3886
2019-10-07 10:34:50 -04:00
Brad King
9c9e66289a Tests: Enable ConfigSources test on every configuration
Revise the test itself to work in all configurations and verify that
certain sources are only built by whatever configuration is tested.
2019-10-04 10:39:00 -04:00
Brad King
3ded5b6da8 install,export: Fix export of a genex following $<INSTALL_PREFIX>
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
2019-10-04 09:53:22 -04:00
Cristian Adam
38c1f2ab22 PCH: Fix CMake test files indentation 2019-10-03 23:24:21 +02:00
Cristian Adam
1144a4fa47 PCH: Add multi-language PCH generation support
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
2019-10-03 22:58:55 +02:00
Brad King
3247506662 Merge topic 'ctest-hardware-allocation'
e9500271a3 Help: Add documentation for CTest hardware allocation
d1f100a415 CTest: Add Json output for PROCESSES property
b741ee820d Tests: Add test for CTest hardware allocation feature
3c8a5aad46 Tests: Write tests for cthwalloc helper tool
2d74e54661 Tests: Write cthwalloc helper tool
e34de0691b CTest: Allocate hardware to tests
aee0964851 CTest: Add bin-packing algorithm
c494b2973a CTest: Add cmCTestHardwareAllocator class
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3858
2019-10-03 14:07:52 -04:00
Brad King
4a68c85073 Merge topic 'FindJava-all-versions'
3d02593986 FindJava: ensure all versions can be found
14ac253af7 FindJava: tests clean-up

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3871
2019-10-03 09:10:50 -04:00
Kyle Edwards
d1f100a415 CTest: Add Json output for PROCESSES property 2019-10-02 09:33:54 -04:00
Kyle Edwards
b741ee820d Tests: Add test for CTest hardware allocation feature 2019-10-02 09:33:54 -04:00
Kyle Edwards
3c8a5aad46 Tests: Write tests for cthwalloc helper tool
This helper tool is sufficiently complex that it warrants having its
own test suite.
2019-10-02 09:33:54 -04:00
Kyle Edwards
2d74e54661 Tests: Write cthwalloc helper tool 2019-10-02 09:33:54 -04:00
Kyle Edwards
aee0964851 CTest: Add bin-packing algorithm
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.
2019-10-02 09:33:54 -04:00
Kyle Edwards
c494b2973a CTest: Add cmCTestHardwareAllocator class 2019-10-02 09:33:54 -04:00
Kyle Edwards
c8f4806943 CTest: Add parser for hardware spec file 2019-10-02 09:33:54 -04:00
Kyle Edwards
bb4a141059 CTest: Add lexer for PROCESSES property 2019-10-02 09:33:54 -04:00
Marc Chevrier
14ac253af7 FindJava: tests clean-up 2019-10-02 14:47:11 +02:00
Brad King
7cccc5b199 Xcode: Restore CMAKE_XCODE_GENERATE_SCHEME for custom targets
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
2019-10-02 08:21:02 -04:00
Brad King
a1f78a481c Merge topic 'ninja-depend-shared-symlinks'
4891f0f966 Ninja: Ensure shared library version symlinks are created for dependents

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3875
2019-10-02 07:57:25 -04:00
Brad King
d57c1a5b31 Merge topic 'clang-format-normalize-headers-presentation'
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
2019-10-02 07:53:43 -04:00
Brad King
9649c91f83 Merge topic 'pch-compile-pdb'
e6e189e02b PCH: Report error when setting COMPILE_PDB_NAME property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3864
2019-10-02 07:48:55 -04:00
Brad King
c5bec56611 Merge topic 'test-iface-paths'
335236b0cb Tests: Shorten name RunCMake.IfacePaths_{INCLUDE_DIRECTORIES => INCDIRS}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3873
2019-10-02 07:41:39 -04:00
Brad King
4891f0f966 Ninja: Ensure shared library version symlinks are created for dependents
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
2019-10-01 14:34:03 -04:00
Cristian Adam
e6e189e02b PCH: Report error when setting COMPILE_PDB_NAME property
Reusable precompile headers require specific COMPILE_PDB_NAME property
values. Report error if the user tries to set a different value.
2019-10-01 18:33:40 +02:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Marc Chevrier
185fe49f29 clang-format: Normalize headers presentation
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
2019-10-01 12:25:48 -04:00
Brad King
335236b0cb Tests: Shorten name RunCMake.IfacePaths_{INCLUDE_DIRECTORIES => INCDIRS}
The original name was responsible for the longest path in our build
tree.  Use a shorter name to enable longer build tree names on Windows.
2019-10-01 10:53:39 -04:00
Brad King
8a15e75fe3 Tests: Cover EXCLUDE_FROM_ALL OFF on sub/sub/tgt in sub/all
Issue: #19753
2019-09-30 10:34:23 -04:00
Brad King
0733a94f64 Ninja,Makefile: Fix subdir "all" with nested EXCLUDE_FROM_ALL subdir
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>
2019-09-30 10:30:28 -04:00
Brad King
8aa5f6ba44 Merge topic 'fix-EXCLUDE_FROM_ALL-subdir-all'
dce58afd30 Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'
013d7dd484 Help: Mention 3.14.7 EXCLUDE_FROM_ALL fix in 3.15.4 release note
61103c0bac Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all'
1fe4501592 Help: Add release note for EXCLUDE_FROM_ALL fix in 3.15.4
05d7ca14e9 Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all'
62d45d91e8 Help: Add release note for EXCLUDE_FROM_ALL fix in 3.14.7
b3b1c7bf3a Restore "all" target in subdirectories marked EXCLUDE_FROM_ALL
156b56480a Makefiles: Revert "Make build root targets ... recursive"
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3863
2019-09-30 10:27:15 -04:00
Brad King
9b03baee30 Merge topic 'objective-c-cxx'
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
2019-09-30 10:25:19 -04:00
Brad King
c2d1ea58bf Merge topic 'FPHSA-reason-failure-message'
60473cc660 FPHSA: add capability to specify message explaining reason of failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3866
2019-09-30 10:22:35 -04:00
Brad King
dce58afd30 Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'
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`.
2019-09-30 09:34:57 -04:00
Brad King
05d7ca14e9 Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all' 2019-09-30 09:19:21 -04:00
Brad King
b3b1c7bf3a Restore "all" target in subdirectories marked EXCLUDE_FROM_ALL
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
2019-09-30 09:18:20 -04:00
Steve Wilson
9e66397c28 Languages: Add support for Objective-C++
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>
2019-09-28 15:56:53 +02:00
Steve Wilson
80f120a85f Languages: Add support for Objective-C
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>
2019-09-28 15:56:46 +02:00
Brad King
c88cf48bbe Merge topic 'FindBinUtils-ask-compiler'
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
2019-09-27 14:56:53 -04:00
Marc Chevrier
60473cc660 FPHSA: add capability to specify message explaining reason of failure
Fixes: #19660
2019-09-27 16:04:54 +02:00
Brad King
cf01d3d2bd Tests: Clarify target names in RunCMake.add_subdirectory ExcludeFromAll
Rename the `baz` target to `subinc` to clarify that its role is to be
included even though it is in an otherwise excluded subdirectory.
2019-09-26 14:58:26 -04:00
Brad King
21442d72a4 Tests: Revise RunCMake.add_subdirectory ExcludeFromAll to avoid globbing
Also simplify the clean step.
2019-09-26 14:57:40 -04:00
Justin Goshi
8b84c046fa fileapi: add some source property backtraces
Support backtraces for COMPILE_DEFINITIONS, COMPILE_OPTIONS, and
INCLUDE_DIRECTORIES source properties.
2019-09-26 10:56:52 -04:00
Brad King
b4087a2353 Merge topic 'vs-ReferenceOutputAssembly-conditions'
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
2019-09-26 10:43:27 -04:00
Brad King
587ccffe74 Tests: Add symbols to FortranModules static libraries
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.
2019-09-26 10:31:44 -04:00
Brad King
3cb12895f3 Merge topic 'pch-export'
c54448e185 PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !3862
2019-09-26 09:51:55 -04:00
Brad King
a29b8d285e Merge topic 'fix-vsmacro-access-violation'
7847fef510 VS: Fix access violation when calling Visual Studio macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3853
2019-09-26 09:49:56 -04:00
Brad King
df982c4e18 Merge topic 'add-custom-target-byproduct-checks'
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
2019-09-26 09:47:51 -04:00
Kyle Edwards
5fa625d611 Merge topic 'cpack-DEB-use-CPACK_PACKAGE_DESCRIPTION_FILE'
33c7ea513d CPackDeb: Use `CPACK_PACKAGE_DESCRIPTION_FILE`
53be31e19c Refactor: Use `list` commands instead of old-way string ops
b2c67a7703 Style: Remove spaces after command call and `(`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3541
2019-09-26 09:23:31 -04:00
Vedran Vujinovic
4dc8c153ec Tests: Teach VSWinStorePhone to verify the content of generated xap
XAP format was used as app package format on Windows Phone 7 and 8.
It was replaced by APPX format since Windows Phone 8.1.
2019-09-25 20:57:47 +02:00
Brad King
c54448e185 PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT)
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
2019-09-25 12:06:28 -04:00