Commit Graph

534 Commits

Author SHA1 Message Date
Brad King cc3611023d Merge topic 'use-algorithms'
bb9d71b4 Replace loops with algorithms.
4afe6c26 cmAlgorithms: Add cmReverseRange adaptor.
a3a0a8c2 cmAlgorithms: Add cmFindNot algorithm.
8c74a41f cmRST: Replace two erase with a rotate and larger erase.
61fe1919 cmAlgorithms: Update concept requirement to FowardIterator
09d6125b cmAlgorithms: Move cmRotate out of 'implementation detail' namespace.
8ed6ecac cmRST: Move two algorithms beside each other.
dfe49c20 cmRST: Use std::min where appropriate.
21b0654a cmGlobalGenerator: Convert set insert algorithm to vector algorithms.
416df93a Convert some raw loops to cmWrap.
37b88d34 cmAlgorithms: Add cmWrap.
a2818093 Use cmJoin where possible.
76207b08 cmCacheManager: Replace loop with algorithm.
60c3bb73 cmGlobalGenerator: Replace loop with algorithm.
05fec779 cmTarget: Port loop to algorithm.
9c225767 cmGlobalGenerator: Replace set::insert algorithm with cmRemoveDuplicates.
...
2015-02-23 10:26:38 -05:00
Stephen Kelly 21b0654ace cmGlobalGenerator: Convert set insert algorithm to vector algorithms.
Adjust test for new error output.
2015-02-20 21:36:57 +01:00
Brad King ffc06c1239 Teach find_(library|file|path) to get prefixes from PATH (#15370)
The find_package command already knows how to compute installation
prefixes from PATH.  Use the same approach to establish prefixes for
find_library, find_file, and find_path to use to look in directories
like "<prefix>/lib[/<arch>]" and "<prefix>/include" for libraries and
headers.  This will reduce the amount of configuration end users need to
do to establish a work environment rooted under a specific prefix.
2015-02-19 10:03:17 -05:00
Brad King d891d47434 Tests: Consolidate detection of 'rpmbuild'
Several tests use slight variations of the same logic to enable CPack
RPM tests.  Consolidate this logic into one check before any tests are
added.  Look for 'rpmbuild' only on Linux and only when the test build
tree does not have spaces in the path.  In particular, this will make
the result available in time for the RunCMake.CPackRPM test to be
activated even if CMake is configured exactly once.
2015-02-13 11:50:38 -05:00
Gregor Jasny bf8f9c29e7 Xcode: Teach XCODE_ATTRIBUTE target properties about generator expressions
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-02-12 13:35:31 -05:00
Brad King f30022eb07 install: Allow generator expressions in TARGETS DESTINATION (#14317)
This will allow per-config destinations for targets in EXPORT sets.
Using multiple install(TARGETS) with separate CONFIGURATIONS is
rejected as a target appearing more than once in an export set.
Now instead one can write

 install(TARGETS foo EXPORT exp DESTINATION lib/$<CONFIG>)

to get a single logical membership of the target in the export set
while still having a per-config destination.
2015-02-11 15:15:33 -05:00
Stephen Kelly 6da65b3907 Allow export of targets with INTERFACE_SOURCES.
Use the same rules for paths in source and binary dirs in
installed INTERFACE_SOURCES as are used for
INTERFACE_INCLUDE_DIRECTORIES.
2015-02-11 00:51:34 +01:00
Stephen Kelly 736bcb9664 Tests: Move IfacePaths test stderr files.
Rename the files with a property-specific name, so that additional
properties can be easily tested.
2015-02-11 00:51:30 +01:00
Stephen Kelly d9f8390db6 Tests: Run IfacePaths tests with a parameter.
Run the tests for the INCLUDE_DIRECTORIES INTERFACE property
in a specific build location, and update the stderr expectation
to match the new output.
2015-02-09 19:34:27 +01:00
Stephen Kelly cc15209476 Tests: Split part of include_directories test to a generic location.
The moved tests are related to paths in INTERFACE_INCLUDE_DIRECTORIES
in general, and when exporting, and covering cases of the install
location being within the build or source prefix etc.  Other build
properties containing paths should have similar tests, so this
allows some parameterization while keeping the preparation of the
various directory structures.
2015-02-09 19:23:47 +01:00
Stephen Kelly c0d8e71591 RunCMake: Allow specifying the stderr file for a test. 2015-02-09 19:15:04 +01:00
Stephen Kelly 68d29f5190 RunCMake: Allow specifying the directory to run tests in. 2015-02-09 19:15:04 +01:00
Stephen Kelly 1c3918ff02 RunCMake: Remove unneeded files.
The default expectation of RunCMake tests is empty content, so there
is no need to specify it.
2015-02-09 19:15:04 +01:00
Brad King aec11372a5 Merge topic 'rpm_multi_prefix'
3ec02547 CPackRPM: Allow multiple path relocation prefixes for one package
2015-02-03 09:46:21 -05:00
Brad King 3228fc5049 Features: Define meaning for no language standard default
Define an empty string in CMAKE_<LANG>_STANDARD_DEFAULT to mean that
the toolchain has no notion of lanuage standard levels.  In this case
the <LANG>_STANDARD[_REQUIRED] properties will have no effect.

Update the RunCMake.CompileFeatures test to exclude the
LinkImplementationFeatureCycle test when there is no standard default.
It can never fail because no use of specific features will adjust the
CXX_STANDARD level required for any target since the standard levels
have no meaning in this case.
2015-01-29 15:01:40 -05:00
Domen Vrankar 3ec0254727 CPackRPM: Allow multiple path relocation prefixes for one package 2015-01-29 10:48:58 -05:00
Brad King 6a0a4079ef Merge topic 'shorten-test-paths'
70c50962 Tests: Shorten paths in ExternalProjectLocal
539c5c25 Tests: Shorten paths in RunCMake.CompileFeatures
494f6e8d Tests: Shorten paths in CompileDefinitions
2015-01-28 09:33:38 -05:00
Brad King a47b904db2 Merge topic 'file-strings-utf-16'
1f77a700 file: Teach STRINGS to support UTF-16 and UTF-32 encodings
2015-01-27 11:36:45 -05:00
Justin Borodinsky 1f77a7001b file: Teach STRINGS to support UTF-16 and UTF-32 encodings 2015-01-27 11:30:26 -05:00
Brad King af9cf04647 Merge topic 'cmake-E-tar-files-from'
44fd71de cmake: Teach "-E tar" command a "--files-from=" option
2015-01-27 11:22:08 -05:00
Brad King 33daec1ae9 Merge topic 'test-rerun-cmake'
7f2dc8dc configure_file: Test that CMake re-runs on input change or output missing
daf95a38 try_compile: Test that CMake re-runs on input change
2015-01-27 11:22:06 -05:00
Brad King 34ce0dd22f Merge topic 'tests-RunCMake-normalize-newlines'
bf05938b Tests/RunCMake: Normalize newlines before checking actual output
2015-01-27 11:22:04 -05:00
Brad King 7f2dc8dc54 configure_file: Test that CMake re-runs on input change or output missing
With the Makefile generators we expect that touching or modifying the
input file of a configure_file, or removing its output, will cause CMake
to re-run on the next build.  Extend the RunCMake.configure_file test
with a case covering this.  Also check that CMake does not re-run if
nothing has changed.
2015-01-27 11:18:37 -05:00
Brad King bf05938b8f Tests/RunCMake: Normalize newlines before checking actual output
We read the expected output with file(STRINGS) which converts CRLF
newlines to LF.  Do the same with the actual output before comparing.
2015-01-27 11:18:36 -05:00
Brad King daf95a3827 try_compile: Test that CMake re-runs on input change
With the Makefile and Ninja generators we expect that touching the input
source file for a try_compile will cause CMake to re-run on the next
build.  Extend the RunCMake.try_compile test with a case covering this.
Also check that CMake does not re-run if nothing has changed.
2015-01-27 11:18:36 -05:00
Brad King 44fd71decb cmake: Teach "-E tar" command a "--files-from=" option
Read file names from the lines of a specified file.  Reject input lines
starting in '-' to leave room for option parsing to be added later.  Add
just '--add-file=' now to allow files starting in '-' to be specified.
2015-01-26 13:28:31 -05:00
Brad King 19e57a48cd Merge topic 'tests-RunCMake-make-program'
23bf98fc Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM
2015-01-26 10:28:30 -05:00
Brad King 8def82585c Merge topic 'try-run-link-libraries'
d0adcccb try_run: Add tests for LINK_LIBRARIES with mock libraries.
223c5cb7 try_run: Add test for bad link libraries.
e2b1f058 try_run: Add support for LINK_LIBRARIES option.
2015-01-26 10:28:25 -05:00
Matt McCormick 223c5cb70b try_run: Add test for bad link libraries.
Based off the corresponding try_compile test.
2015-01-26 10:05:30 -05:00
Matt McCormick e2b1f0583f try_run: Add support for LINK_LIBRARIES option.
Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}.
Document and improve argument parsing.

This functionality is already being used by a number of modules, like
CheckCSourceCompiles.cmake, but it is not documented.
2015-01-26 10:05:26 -05:00
Brad King 539c5c252e Tests: Shorten paths in RunCMake.CompileFeatures
Shorten the NotAFeature_OriginDebug_target_compile_features case name to
avoid creating really long paths that fail with some tools on Windows.
2015-01-26 08:30:57 -05:00
Brad King 23bf98fc04 Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM
If tests are using an explicit make program, pass it through to RunCMake
tests so that any that actually do build use the expected tool.
2015-01-24 07:35:44 -05:00
Brad King c0298947ff Merge topic 'cdash_upload_file_mode'
f3e0b6f1 CTestCoverageCollectGCOV: Add module to run gcov
6dd980e0 ctest_submit: Make CDASH_UPLOAD mode arguments more strict
5dc33f89 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash
2015-01-22 11:16:45 -05:00
Brad King afd998373d Merge topic 'test-ctest_submit-fail-with-RunCMake'
ef97cd85 Tests: Fix obscure RunCMake.CTestSubmit 'drop' case failures
76f7eb2e Tests: Extend RunCMake.CTestSubmit test to cover 'drop' failures
2015-01-21 16:36:20 -05:00
Brad King ef97cd8587 Tests: Fix obscure RunCMake.CTestSubmit 'drop' case failures
When curl is given a URL of the form '<something>://' it tries to
resolve '<something>' as a host name.  If the host happens to exist and
have a server then the drop might actually appear to work.  Instead use
an explicit '-no-site-' host to ensure it cannot connect.

Reported-by: Gilles Khouzam <Gilles.Khouzam@microsoft.com>
2015-01-21 16:34:42 -05:00
Brad King 6dd980e0ef ctest_submit: Make CDASH_UPLOAD mode arguments more strict
Disallow mixing of arguments from different command signatures.
Extend the RunCMake.CTestSubmit test to cover such error cases.
2015-01-20 09:33:21 -05:00
Brad King 1ef4e3ab45 Merge topic 'cmake-E-tar-mtime'
3a60c899 cmake: Teach "-E tar" command a "--mtime=" option
90f9c427 cmake: Teach "-E tar" to report file name on failure to read from disk
2015-01-20 09:20:12 -05:00
Brad King 3a60c899fc cmake: Teach "-E tar" command a "--mtime=" option
Add an option to set the mtime of entries in a tarball so that one can
create a tarball with a consistent content hash (e.g. MD5) for a given
set of files regardless of their current timestamps on disk.  This will
be useful for submission of tarballs to CDash, which tracks content
hashes to avoid duplication.

Inspired-by: Bill Hoffman <bill.hoffman@kitware.com>
2015-01-19 14:16:19 -05:00
Brad King 813ace90e4 Merge topic 'GNU-4.4-compile-features'
004e1540 Features: Record for GNU 4.4.
2a5ca650 Features: Wrap failure-test in UNIX condition.
1ae2c6b2 Features: Blacklist cxx_constexpr test for GNU 4.5.
c66e3317 Features: Use a more-common feature in cycle-test.
c43a6dc5 Features: Update comment in test to match the code.
78259135 Features: Test presence of cxx_auto_type with genex.
7b9fc88b Features: Remove outdated comment.
2015-01-19 13:55:31 -05:00
Brad King 2e71d92ef2 Merge topic 'test-ctest_submit-fail-with-RunCMake'
352de1d7 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures
2015-01-19 10:03:12 -05:00
Brad King 76f7eb2e4a Tests: Extend RunCMake.CTestSubmit test to cover 'drop' failures
Replace the TODO comment with calls to run_ctest_submit_FailDrop.  For
now leave curl errors out of expected stderr.  They can be ported over
from CTestTestFailedSubmit-* tests later.
2015-01-19 09:56:38 -05:00
Brad King 352de1d749 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures
Cover command invocation argument errors.  Prepare infrastructure
to cover failed 'drop' cases, but do not cover them yet because
we need to collect error messages from each platform.
2015-01-19 09:53:57 -05:00
Stephen Kelly c66e331749 Features: Use a more-common feature in cycle-test.
We require that the $<$<COMPILE_FEATURES:cxx_feature>:empty2> generates
a '1' when CXX11 is enabled.  GNU 4.4 does not support cxx_nullptr, but
does support cxx_auto_type.
2015-01-18 14:46:45 +01:00
Stephen Kelly c43a6dc5ec Features: Update comment in test to match the code.
After commit f13a2eb1 (Features: Adjust the RunCMake test to use
more-common features., 2015-01-15).
2015-01-18 14:46:45 +01:00
Brad King 8b7db43bc6 Merge topic 'GNU-4.6-compile-features'
770ba876 Help: Add notes for topic 'GNU-4.6-compile-features'
b15c008f Features: Record for GNU 4.6.
f13a2eb1 Features: Adjust the RunCMake test to use more-common features.
1f19ac4d Features: Adjust cxx_variadic_templates unit test for GNU < 4.7.
0798d1e5 Features: Extend the generalized_initializers test for GNU < 4.7.
938bd94e Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU < 4.7 compatibility.
462c630b Features: Don't test __cplusplus value for CXX98 on GNU.
222ec86f Features: Test an old value of __STDC_VERSION__ for GNU < 4.7 compatibility.
6e909035 Features: Record C/CXX dialect flags for GNU 4.6.
bfc995cc Features: Remove wrong content from else() condition.
1532b921 Features: Make cxx_noexcept available from GNU 4.6.
1f4649e6 Features: Update the default_dialect test for old GNU-like compilers.
a60027a6 Features: Ensure appropriate return value from feature test macros.
2015-01-16 11:07:14 -05:00
Brad King c15a2fdd2e Merge topic 'tests-RunCMake-report-command'
6c121924 Tests: Teach RunCMake to report command-line on failure
2015-01-16 09:43:56 -05:00
Stephen Kelly f13a2eb118 Features: Adjust the RunCMake test to use more-common features. 2015-01-16 00:11:01 +01:00
Brad King 6c121924ad Tests: Teach RunCMake to report command-line on failure
When a test sets RunCMake_TEST_COMMAND, report the command line
on failure to make it easier to run by hand for debugging.
2015-01-15 14:46:58 -05:00
Brad King 0fe4d8bb3b ExternalData: Add support for custom download scripts
Add support for a special URL template to map the fetch operation
to a project-specified .cmake script insead of using file(DOWNLOAD).

Extend the Module.ExternalData test to cover the behavior.
Extend the RunCMake.ExternalData test to cover error cases.
2015-01-15 10:48:09 -05:00
Brad King 44612e7407 Merge topic 'fix-LOCATION-with-TARGET_OBJECTS'
23f3798c cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338)
2015-01-15 09:53:59 -05:00