Commit Graph

1466 Commits

Author SHA1 Message Date
Brad King
2577365040 Tests: Remove unnecessary result files from RunCMake.File_Generate
The default result is "0" anyway.
2017-11-17 11:40:14 -05:00
Brad King
fb114a40aa Tests: Add test for bad foreach inside a function
Add test for a case fixed by commit 6a4a61d9e1 (cmForEachCommand:
prevent leakage, 2017-10-09).  Prior to that fix, this test case
could trigger an assertion failure.

Fixes: #17464
2017-11-16 11:10:05 -05:00
Brad King
163be8714a Merge topic 'update-ctest-documentation'
3b272ff8 Help: Add 'Label and Subproject Summary' section to ctest(1) manual
002d0a1c Help: Normalize capitalization of 'CTest' in ctest(1) manual
9d3aa95c Help: Divide ctest(1) manual options into sections
7904b659 Tests: Remove incorrect use of 'test-timeout' option
e80dc2ad cmCTest: Remove dead code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1427
2017-11-10 08:05:45 -05:00
Betsy McPhail
7904b659ea Tests: Remove incorrect use of 'test-timeout' option 2017-11-10 07:52:05 -05:00
Domen Vrankar
7e896029cd CPack: enable setting default dir creation permissions
Introduces CPACK_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS
variable which adds support for functionality introduced
by CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS variable.

Fixes #17333

# Conflicts:
#	Help/release/dev/cmake-default-dir-install-permissions.rst
2017-11-08 20:27:11 +01:00
Domen Vrankar
a4c829167d CPack test: expand output checking fallback
Some tests can have the same output for a certain
subtest no matter which packaging generator is used.
2017-11-08 20:27:11 +01:00
Brad King
30fcf13be6 Merge topic 'imported-promotion'
6a3922be Add new target-property `IMPORTED_GLOBAL`.
854e482a cmTarget: Simplified and fixed a string-comparision.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1254
2017-11-08 09:08:15 -05:00
Deniz Bahadir
6a3922bebe Add new target-property IMPORTED_GLOBAL.
The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong
the lifetime and scope of `IMPORTED` targets in such a way as if they
had been created with the keyword `GLOBAL` in the first place.

* It can only be set to `TRUE`. That means, a local `IMPORTED` target
  can be promoted to global scope but a global `IMPORTED` target cannot
  be degraded to local scope!
* Setting it to `TRUE` only succeeds if done from within the same
  directory in which the `IMPORTED` target was created in the first
  place.

Fixes #17256.
2017-11-07 15:08:41 +01:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Brad King
a0ec14d363 Add deprecation warnings for policies CMP0054 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for some policies
to encourage projects to port away from setting policies to OLD.
2017-11-01 11:46:53 -04:00
Brad King
cdc9c110a5 Merge topic '16780-write-single-xcodeproj'
e4e9ce7c Xcode: Add option to generate only topmost project file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1395
2017-11-01 08:02:15 -04:00
Gregor Jasny
e4e9ce7cbe Xcode: Add option to generate only topmost project file
Closes #16780
2017-10-31 17:09:26 +01:00
Brad King
6341596e29 Merge topic 'cmp0037-conditional-targets'
ae5f4069 CMP0037: Allow test and package targets when features are not enabled
409527a0 CMP0037: De-duplicate check and message generation
a2611d81 Tests: Add RunCMake.CMP0037 case for WARN on reserved targets
103501c4 Tests: Do not enable languages in all cases of RunCMake.CMP0037
2d0b3e6e cmGlobalGenerator: Refactor test and package target conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !1417
2017-10-31 08:19:27 -04:00
Brad King
ae5f40696e CMP0037: Allow test and package targets when features are not enabled
When CMake will not generate a test, package, or package_source target,
allow projects to create their own targets with these names.

Fixes: #16062
2017-10-30 10:21:31 -04:00
Brad King
58e0692b62 Merge topic 'cpack-deb-0-so-version-support'
5784ab8f CPack/Deb: handle shlibs file generation when SOVERSION set to 0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1423
2017-10-30 08:55:36 -04:00
Brad King
e48397ee29 Merge topic 'cpack-rpm-dist-test-fix'
9ce00cae CPack/RPM: DIST-MONOLITHIC-type subtest fix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1424
2017-10-30 08:52:48 -04:00
Domen Vrankar
9ce00caee3 CPack/RPM: DIST-MONOLITHIC-type subtest fix
Test was failing in case dist macro contained
a + symbol which is valid but must be escaped
for using the string as a regex.

Fixes #17328
2017-10-30 08:48:46 -04:00
Brad King
a7b770686a Merge topic 'fix-co-compile'
197b4e18 Merge branch 'backport-fix-co-compile' into fix-co-compile
992962c7 cmcmd: Restore support for running multiple lint tools
a5197eea cmcmd: Convert lint handlers to file-static functions
1c075ffd cmcmd: Rename loop iteration variable for clarity

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1418
2017-10-30 08:46:59 -04:00
Domen Vrankar
5784ab8fca CPack/Deb: handle shlibs file generation when SOVERSION set to 0
Setting CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS did not
auto generate shlibs control file when .so version
of the library was set to 0.

Fixes #17318
2017-10-29 00:20:54 +02:00
Brad King
8ffc1c3d89 Merge topic 'generalize-importedtargets-behavior'
fb88d2b5 Help: Add notes for topic 'generalize-importedtargets-behavior'
494906a8 Add support for IMPORTED GLOBAL targets to be aliased
fe4b25ec Teach target_* commands to set INTERFACE properties of IMPORTED targets
e40fd9fd cmTargetPropCommandBase: Fix typo in error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !1264
2017-10-27 09:47:31 -04:00
Brad King
b779b8e85f Merge topic 'cmp0040-wording'
a1b1f1a2 CMP0040: Clarify policy warning to match documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1415
2017-10-27 09:42:37 -04:00
Brad King
197b4e18d4 Merge branch 'backport-fix-co-compile' into fix-co-compile
Resolve a logical conflict by replacing `cmArray{Begin,End}` from
the their side with `cm::{cbegin,cend}` from our side.
2017-10-27 09:31:04 -04:00
Brad King
992962c76d cmcmd: Restore support for running multiple lint tools
Refactoring in commit v3.10.0-rc1~115^2 (Clean up iwyu code to not be
one big if statement, 2017-08-28) incorrectly changed the logic to run
only one lint tool at a time.  Restore support for running all tools
specified on the command-line.
2017-10-27 09:26:50 -04:00
Brad King
a2611d816b Tests: Add RunCMake.CMP0037 case for WARN on reserved targets 2017-10-26 14:11:19 -04:00
Brad King
103501c4e0 Tests: Do not enable languages in all cases of RunCMake.CMP0037 2017-10-26 14:11:19 -04:00
Brad King
a1b1f1a282 CMP0040: Clarify policy warning to match documentation
In commit v3.5.0-rc1~8^2~2 (Help: Clarify policy `CMP0040`
documentation, 2016-01-28) the documentation was clarified to indicate
that the target must be defined in the current directory.  Do the same
for the text of the policy warning itself.

Fixes: #17399
2017-10-26 09:47:29 -04:00
Deniz Bahadir
494906a8a2 Add support for IMPORTED GLOBAL targets to be aliased
Issue: #15569
Issue: #17197
2017-10-26 09:11:04 -04:00
Deniz Bahadir
fe4b25ec2f Teach target_* commands to set INTERFACE properties of IMPORTED targets
Now, several `INTERFACE_*` properties can be set on `IMPORTED` targets,
not only via `set_property` and `set_target_properties` but also via
`target_compile_definitions`, `target_compile_features`,
`target_compile_options`, `target_include_directories`, `target_sources`
and `target_link_libraries`.

Fixes: #15689
Issue: #17197
2017-10-26 09:11:04 -04:00
Deniz Bahadir
e40fd9fd19 cmTargetPropCommandBase: Fix typo in error message 2017-10-26 09:11:00 -04:00
Brad King
b5dd256d94 Merge topic 'defer-target-source-check'
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
2017-10-25 08:11:19 -04:00
Deniz Bahadir
4e7f67383f Defer check for sources within a target until generation.
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
2017-10-24 08:14:47 -04:00
Brad King
6e4e7c6547 Tests: Exclude bad RunCMake.add_executable case on multi-arch Xcode
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`.
2017-10-24 08:11:29 -04:00
Brad King
9ffb35386f VS: Select and save a VS 2017 instance persistently
Visual Studio 2017 supports multiple instances installed on a single
machine.  We use the Visual Studio Installer tool to enumerate instances
and select one.  Once we select an instance for a given build tree, save
the result in `CMAKE_GENERATOR_INSTANCE` so we can re-configure the tree
with the same instance on future re-runs of CMake.

Fixes: #17268
2017-10-19 10:20:12 -04:00
Brad King
314613d1af Add infrastructure for generators to select a build tool instance
Add cache entry `CMAKE_GENERATOR_INSTANCE` to hold the instance location
persistently across re-runs of CMake in a given build tree.

For now we reject the option by default if explicitly set.  It will be
implemented on a per-generator basis.  Pass the setting into try_compile
project generation.  Add a RunCMake.GeneratorInstance test to cover
basic use cases for the option.  Verify that `CMAKE_GENERATOR_INSTANCE`
is empty by default, and that it is rejected when the generator does not
support a user setting.

Issue: #17268
2017-10-19 10:20:08 -04:00
Brad King
358ceee5d8 Merge topic 'curl_netrc_options'
d45aa38a Add dev notes for topic 'curl_netrc_options'
60c272b6 ExternalProject: Add support for NETRC and NETRC_FILE suboption
754e39dd Add testcases for file(DOWNLOAD|UPLOAD) netrc options
5d67e902 file(DOWNLOAD|UPLOAD): Add 'NETRC' and 'NETRC_FILE' suboption

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Merge-request: !1376
2017-10-19 09:27:43 -04:00
Shane Parris
754e39dd36 Add testcases for file(DOWNLOAD|UPLOAD) netrc options 2017-10-18 15:21:42 -04:00
Brad King
344d149ae4 VS,Xcode: Add CMakeLists.txt sources without mutating targets
Rather than injecting `CMakeLists.txt` files into each target's
`SOURCES`, teach the generators to add them during generation using
dedicated code.  This avoids mutating the original targets, and avoids
polluting `$<TARGET_PROPERTY:foo,SOURCES>` with generator-specific
content.

This also avoids listing the `CMakeLists.txt` sources in the results of
`CMAKE_DEBUG_TARGET_PROPERTIES==SOURCES` so the `RunCMake.TargetSources`
test no longer needs a separate case for IDEs.
2017-10-18 14:24:07 -04:00
Brad King
0dba1db9d5 Merge topic 'module-fetchcontent'
1e56634f FetchContent: Add tests
60e74d2f FetchContent: New module for populating content at configure time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1306
2017-10-18 09:37:26 -04:00
Craig Scott
1e56634faa FetchContent: Add tests 2017-10-17 08:10:19 +11:00
Brad King
4594880be7 Merge topic 'cpack-deb-mr-1296-fix'
c5db2f9a CPack/Deb: fix for regex passing even if invalid characters are present
529729d6 CPack/Deb: CPACK_DEBIAN_PACKAGE_VERSION regex testing exception

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1375
2017-10-11 08:26:24 -04:00
Brad King
155c1505a5 Merge branch 'cpack-deb-mr-1296-fix' into release-3.10
Merge-request: !1375
2017-10-11 08:25:30 -04:00
Domen Vrankar
529729d6e7 CPack/Deb: CPACK_DEBIAN_PACKAGE_VERSION regex testing exception
CPACK_DEBIAN_PACKAGE_VERSION variable could in the past also
contain release and epoch version so regex test should expect
the entire versioning if both CPACK_DEBIAN_PACKAGE_RELEASE
and CPACK_DEBIAN_PACKAGE_EPOCH are not set.
Also since the checks were not performed in the past the regex
test of CPACK_DEBIAN_PACKAGE_VERSION variable content should
only report author warnings instead of errors in case of the
test fail.

Fixes: #17339
2017-10-11 00:10:01 +02:00
Brad King
0be7d61abf Tests: Teach RunCMake to ignore clang unused sanitizer flag warnings
These can show up in Release builds of CMake because some tests still
build Debug.
2017-10-10 09:37:49 -04:00
Brad King
3f567a9847 Tests: Refactor RunCMake output line ignore regex construction
Avoid one giant line.
2017-10-10 09:35:31 -04:00
Gregor Jasny
3a49b4eb78 Xcode 9: Lower iOS deployment version to get armv7 builds 2017-10-10 09:08:44 -04:00
Gregor Jasny
78a560e42b Revert "Xcode: Adjust tests to drop of 32bit iOS architectures"
This reverts commit d210b28130.
2017-10-10 09:08:44 -04:00
Gregor Jasny
d210b28130 Xcode: Adjust tests to drop of 32bit iOS architectures 2017-10-05 14:10:28 +02:00
Brad King
58d9297eef Tests: Fix RunCMake.Framework ios arch for Xcode 9
Xcode 9 comes with the iPhoneOS 11.0 SDK that does not support the
`armv7` architecture.  For this SDK version and newer, use `arm64`.
2017-10-03 09:09:08 -04:00
Brad King
b8dd7a705c Tests: Fix RunCMake.Framework expected output on macOS 10.13
The archiver output in the case of universal binaries has changed
slightly.  Update our expected output to match.  While at it, drop
unnecessary leading and trailing `.*`.
2017-10-03 09:08:27 -04:00
Brad King
c044b9ae84 FindBoost: Improve messages when a Boost CMake package is found
Add a test for this case to verify the messages.  This test will also be
valuable to cover this code path in which we've had several regressions
recently.
2017-09-29 10:10:01 -04:00