5293 Commits

Author SHA1 Message Date
Brad King
1882ba2e05 Merge topic 'extend-compile-language-genex'
2ae880fa Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio
2b7d59f3 Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio
0f6f7c8a Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode
c5a82d0f Tests: Decouple COMPILE_LANGUAGE in file(GENERATE) from COMPILE_OPTIONS
25773650 Tests: Remove unnecessary result files from RunCMake.File_Generate

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jason Juang <jasjuang@gmail.com>
Merge-request: !1511
2017-11-27 09:00:44 -05:00
Craig Scott
51ccfaacb8 Merge topic 'WriteBasicConfigVersionFile_SameMinorVersion'
d18ff3a5 WriteBasicConfigVersionFile: Fix messages in ExactVersion tests
16a93de0 WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Claudio <claudio.fantacci@gmail.com>
Merge-request: !1507
2017-11-22 07:29:33 -05:00
Brad King
baa19f658f Merge topic 'gtest-fix-discovery'
70f9f62d GoogleTest: Fix multiple discovery on same target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1510
2017-11-21 13:00:24 -05:00
Matthew Woehlke
70f9f62da8 GoogleTest: Fix multiple discovery on same target
According to the documentation, tests can be discovered for a target
multiple times by using a different prefix and/or suffix to ensure name
uniqueness. However, while this worked for gtest_add_tests, it did not
work with gtest_discover_tests because the generated file that sets up
the tests was named based only on the target name, and so subsequent
discovery from the same target would clobber earlier discovery.

Fix this by introducing a counter that records how many times discovery
has been used on a target, and use this to generate unique names of the
generated test list files.
2017-11-21 12:05:34 -05:00
Daniele E. Domenichelli
d18ff3a5c6 WriteBasicConfigVersionFile: Fix messages in ExactVersion tests 2017-11-21 10:09:15 +01:00
Daniele E. Domenichelli
16a93de0a8 WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY option 2017-11-21 09:27:07 +01:00
Brad King
2ae880fa8f Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio
Since commit v3.9.0-rc4~3^2~1 (VS: Fix target_compile_options for CUDA,
2017-06-21), the evaluation of `COMPILE_LANGUAGE` receives the proper
language.  The set of compile flags used for a target's C and C++
sources is based on the linker language.  By default this is always the
C++ flags if any C++ sources appear in the target, and otherwise the C
flags.  Therefore we can define the `COMPILE_LANGUAGE` generator
expression in `COMPILE_OPTIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
can do.  It is also sufficient for many use cases since the set of
allowed flags for C and C++ is almost the same in Visual Studio.
Furthermore, since the VS generator moves many of the flags to
declarative `.vcxproj` elements, it will automatically avoid passing
C++ flags for C sources.

Issue: #17435
2017-11-20 13:51:25 -05:00
Brad King
66b37132b6 Merge topic 'cpack-minor-cleanup-and-tests-extension'
325f34d1 CPack tests: add possibility for expecting config developer warnings
176281e1 CPack test: correctly handle CPACK_PACKAGING_INSTALL_PREFIX
cf0c2599 CPack: set variable commands in lower case
2ff906b3 CPack: documentation typo fix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1499
2017-11-20 10:09:14 -05:00
Brad King
1da5a6ea39 Merge topic 'cuda-sep-comp-var'
00e13993 CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alexander Korsunsky <a.korsunsky@gmail.com>
Merge-request: !1495
2017-11-20 09:45:58 -05:00
Brad King
9100ea1d82 Merge topic 'FindOpenGL-glvnd-policy'
2ea17412 FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Clinton Stimpson <clinton@elemtech.com>
Merge-request: !1491
2017-11-20 09:43:27 -05:00
Domen Vrankar
325f34d150 CPack tests: add possibility for expecting config developer warnings 2017-11-19 14:55:00 +01:00
Domen Vrankar
176281e131 CPack test: correctly handle CPACK_PACKAGING_INSTALL_PREFIX
Every CPack generator sets default CPACK_PACKAGING_INSTALL_PREFIX
variable value differently so test framework should support
that correctly - previous version expected RPM/Deb /usr default and
removed it for Archive packagers as the default there is /.
2017-11-19 14:55:00 +01:00
Brad King
2b7d59f310 Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio
Issue: #17435
2017-11-17 14:31:07 -05:00
Brad King
0f6f7c8ab1 Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode
When rejecting the `COMPILE_LANGUAGE` generator expression on include
directories and compile definitions with Xcode, add `file(GENERATE)` to
the allowed set in the message.  It is allowed and already covered
by the `RunCMake.File_Generate` test `COMPILE_LANGUAGE-genex` case.
2017-11-17 11:56:00 -05:00
Brad King
c5a82d0f88 Tests: Decouple COMPILE_LANGUAGE in file(GENERATE) from COMPILE_OPTIONS
Simplify the `RunCMake.File_Generate` test `COMPILE_LANGUAGE-genex`
case to avoid requiring support for the genex in `COMPILE_OPTIONS`.
2017-11-17 11:55:58 -05:00
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
00e13993fd CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variable
Use its value to initialize the `CUDA_SEPARABLE_COMPILATION` target
property when targets are created.

Fixes: #17478
2017-11-17 09:51:39 -05:00
Brad King
2ea17412a9 FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GL
Fixes: #17449
2017-11-17 07:17:28 -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
501b08ea67 Tests: Fix FindPatch test on Windows
On Windows our input and patch files may have CRLF newlines.
Tell `patch` not to transform them to LF newlines because our
baseline will have CRLF newlines too.
2017-11-15 06:56:04 -05:00
Brad King
6c23107725 Merge topic 'cmake-gui-qt-static-windows'
3a993c49 Tests: Add options to disable tests requiring Qt
27a73f16 cmake-gui: Add build option to use Qt5 windows plugin statically

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1476
2017-11-14 07:23:40 -05:00
Brad King
3a993c49db Tests: Add options to disable tests requiring Qt 2017-11-13 13:58:32 -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
Brad King
9ffb9cb873 Tests: In CTestTest2 configure KWSys encoding to match CMake
During configuration of KWSys by CMake we write UTF-8 content
to a string used by KWSys tests.  Tell KWSys to interpret it
as UTF-8 instead of the ANSI code page.
2017-11-09 08:35:38 -05:00
Brad King
05d8892e61 Merge topic 'cmake-default-dir-install-permissions'
7e896029 CPack: enable setting default dir creation permissions
a4c82916 CPack test: expand output checking fallback
670ad047 Move file/dir permissions code to common file.
deeba85f CMake: enable setting default dir creation permissions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1433
2017-11-09 08:28:28 -05:00
Brad King
43edaee0ce Merge topic 'contract-plplot'
05e9f6ec Tests: Add contract test for PLplot

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1452
2017-11-09 08:13:07 -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
Brad King
bd68d0c252 Merge topic 'implicit-lib-gcceh'
41aacca7 Restore exclusion of "gcc_eh" from implicit link libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1460
2017-11-08 08:25:16 -05:00
Brad King
ddf485511b Merge branch 'implicit-lib-gcceh' into release-3.10
Merge-request: !1460
2017-11-08 08:12:08 -05:00
Christian Pfeiffer
41aacca7fb Restore exclusion of "gcc_eh" from implicit link libraries
Since commit v3.9.0-rc1~148^2 (Do not assume GCC libs are linked by all
compilers, 2017-05-05) we no longer filter out all `gcc*` implicit link
libraries.  This allows mixing of gcc and non-gcc compilers across
languages.  However, this caused a subtle problem with how GCC makes
exception handling symbols available to linked binaries.

GCC (at least on MinGW) provides two different libraries with exception
handling symbols:

* gcc_s: A shared library with -fvisibility=default, used by -shared-libgcc.
* gcc_eh: A static library with -fvisibility=hidden, used by -static-libgcc.

The C compiler (on MinGW) defaults to -static-libgcc and uses gcc_eh.
The C++ compiler defaults to -shared-libgcc and uses gcc_s when linking
shared libraries and executables so that exceptions can propagate across
shared libraries [1].  When linking a mixed-language binary, the C++
compiler should be used along with its choice of gcc_s.  In this case
gcc_eh should not be added even though the C compiler implies it because
gcc_s supersedes it.

Since the above-mentioned change, CMake is adding gcc_eh to C++ link
lines that also contain C code on MinGW.  This causes both gcc_s and
gcc_eh to be used, which is incorrect.  We can fix this simply by
excluding gcc_eh from the C compiler's implicit link libraries.

[1] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Link-Options.html#Link-Options

Fixes: #17436
2017-11-08 08:10:52 -05:00
Brad King
05e9f6ec52 Tests: Add contract test for PLplot 2017-11-08 06:47:26 -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
Brad King
6e2193a26d Tests: Avoid hanging on check for Fortran
Use a timeout when running the check for Fortran in case the tools hang.
2017-11-06 10:21:11 -05:00
Brad King
e673e6f053 Tests: Pass generator instance into check for Fortran
Check for a Fortran compiler using the same VS instance that we are
testing.
2017-11-06 10:21:11 -05:00
Brad King
b104bcfd98 Merge topic 'typos'
777e87ae Fix trivial typos in text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1442
2017-11-06 09:02:23 -05:00
Brad King
62d736f74a Merge topic 'test-contract-refactor'
4c626b7e Tests: Refactor contract test activation
4bd5af63 Tests: Factor out contract test HOME finding
0ce082b7 Tests: Drop unused contract test environment script
36346de4 Tests: Drop unused contract test
bbc9c966 Tests: Honor already-set CTEST_REAL_HOME in case of repeat run

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1444
2017-11-06 09:01:49 -05:00
Brad King
6a54dbe8ca Merge topic 'test-crash-ubsan'
701a637e Tests: Fix CTestTestCrash test under ubsan

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1443
2017-11-06 09:00:44 -05:00
Brad King
73db89c2c2 Merge topic 'server-refactor'
39c2feaf misc: Added utility method to allow working with stacks
f5d2988e server: Swapped to cm_thread impl
2636d86c utility: Added minimal std::thread drop-in
d46b4ba8 server: Updated server tests to try various communication channels
08dca583 Tests: reworked server tests to allow other operation modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1230
2017-11-06 08:58:11 -05:00
Brad King
4c626b7e43 Tests: Refactor contract test activation
Use separate `CMake_TEST_CONTRACT_<project>` variables for each test.
Make the set of possible tests match what is in the source tree.
2017-11-03 11:35:06 -04:00
Brad King
4bd5af6302 Tests: Factor out contract test HOME finding 2017-11-03 11:35:06 -04:00
Brad King
0ce082b7c8 Tests: Drop unused contract test environment script
`Trilinos/EnvScript.cmake` has machine-specific content that has been
moved to the respective machines.
2017-11-03 11:32:06 -04:00
Brad King
36346de480 Tests: Drop unused contract test 2017-11-03 11:30:26 -04:00
Brad King
bbc9c96691 Tests: Honor already-set CTEST_REAL_HOME in case of repeat run 2017-11-03 11:30:21 -04:00
Brad King
701a637e4d Tests: Fix CTestTestCrash test under ubsan
UBsan causes our test crash to abort instead.  Update our regex to
tolerate this.
2017-11-03 11:23:33 -04: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
Justin Berger
d46b4ba835 server: Updated server tests to try various communication channels 2017-11-01 11:30:35 -06: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