Commit Graph

1522 Commits

Author SHA1 Message Date
Brad King
e68a269cd2 Merge topic 'cache-truncate-newlines'
c42b377c cmCacheManager: Test and document newline truncation behavior
a9c48307 cmCacheManager: Truncate values containing newlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1652
2018-01-19 10:08:06 -05:00
Brad King
b4dfe1d816 Merge topic 'extend-compile-language-genex'
506fda1c Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and Xcode
c2f79c98 Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode
0795d25b cmVisualStudio10TargetGenerator: Factor out include dir computation
1ab4d186 cmLocalVisualStudio7Generator: Clarify variable name of compiled language
07e1a743 cmLocalVisualStudio7Generator: Clarify condition for target that compiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1657
2018-01-16 09:33:23 -05:00
Kyle Edwards
c42b377c29 cmCacheManager: Test and document newline truncation behavior 2018-01-15 09:28:32 -05:00
Brad King
506fda1cf0 Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and Xcode
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
`INCLUDE_DIRECTORIES` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of include directories for C and C++ is frequently similar but may
be distinct from those for other languages like CUDA.

Fixes: #17435
2018-01-12 14:27:37 -05:00
Brad King
c2f79c9867 Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode
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_DEFINITIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of definitions for C and C++ is frequently similar but may be
distinct from those for other languages like CUDA.

Issue: #17435
2018-01-12 14:27:37 -05:00
Brad King
e1f0518de0 GNU: Use -fvisibility on AIX when supported
Revise the logic from commit v3.7.0-rc1~173^2~2 (GNU: Do not use
-fvisibility on AIX or HP-UX, 2016-09-03) to add a version check.
The GCC 7 release notes [1] state that visibility support has been
added for AIX 7.1 and above.

[1] https://gcc.gnu.org/gcc-7/changes.html
2018-01-12 11:50:10 -05:00
Brad King
eae0a85d84 Tests: Remove redundant code from RunCMake.GenerateExportHeader case
Drop extra `add_compiler_export_flags` calls from subdirectories because
it is already called in the top-level directory before entering them.
2018-01-12 11:01:37 -05:00
Craig Scott
e44c5828d3 Merge topic 'add_cuda_to_source_regex'
81868e6b CUDA: Add cu as default source file extension

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !1629
2018-01-09 16:15:11 -05:00
Robert Maynard
81868e6bad CUDA: Add cu as default source file extension 2018-01-08 16:16:52 -05:00
Brad King
f7f34a46e6 Merge topic 'use_generator_is_multi_config'
3c413e2a GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Modules
c267ea1c GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1627
2018-01-08 11:14:16 -05:00
Brad King
f4a3143940 Merge topic 'execute_process_UTF8_keyword'
8caec41e execute_process: Allow UTF-8 as a synonym for the UTF8 keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !1623
2018-01-08 10:44:47 -05:00
Brad King
a3bba2a5ad Merge topic '17431-iphone-deployment-target'
4017bf40 Darwin: Emit deployment target that matches the SDK
8f4663ff Xcode: rename embedded SDK query function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1447
2018-01-08 09:58:11 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
Craig Scott
c267ea1c3e GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
Craig Scott
8caec41e6e execute_process: Allow UTF-8 as a synonym for the UTF8 keyword
UTF-8 is the proper naming according to the UTF-8 RFC and is also the
name used for a similar keyword in the file() command. This commit
brings (backward compatible) consistency to the keyword names and allows
the standard UTF-8 name to be used with execute_process(). The old UTF8
keyword is still supported.
2017-12-27 21:56:00 +11:00
Gregor Jasny
4017bf40de Darwin: Emit deployment target that matches the SDK
Closes: #17431
2017-12-22 21:56:53 +01:00
Craig Scott
b0ff528adc FindPkgConfig: Make IMPORTED_TARGET test verify NO...PATH properly 2017-12-16 22:38:56 +11:00
Marc Chevrier
10f58b27ac Genex: Per-source $<COMPILE_LANGUAGE:...> support
Fixes: #17542
2017-12-13 16:35:22 +01:00
Brad King
e016d6d255 Merge topic 'cpack-rpm-check-executable-flags'
a2031d3a CPack/RPM: check executable flags for debuginfo packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1565
2017-12-07 08:28:31 -05:00
Brad King
e1a09cfbd1 Merge topic 'externalproject_download_dir'
b8b87489 ExternalProject: Support substituting <DOWNLOAD_DIR>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1537
2017-12-07 08:14:34 -05:00
Brad King
ea63c522ef Merge topic 'gtest-discovery-timeout'
935848a8 GoogleTest: Add test for missing test executable
29731d89 GoogleTest: Add timeout to discovery
e99e3982 GoogleTest: Improve gtest_discover_tests messages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1534
2017-12-07 08:06:27 -05:00
Craig Scott
b8b8748977 ExternalProject: Support substituting <DOWNLOAD_DIR> 2017-12-07 07:22:02 +11:00
Domen Vrankar
a2031d3a3a CPack/RPM: check executable flags for debuginfo packages
Debuginfo packages can not be created from programs and
shared libraries that do not have execute permissions.
2017-12-06 21:04:20 +01:00
Matthew Woehlke
935848a8a7 GoogleTest: Add test for missing test executable
Add a test to verify expected behavior when a test executable on which
gtest_discover_tests is invoked was not built. (The test for the newly
added timeout conveniently sets up this situation, so this new test was
almost trivial to add.)
2017-12-06 07:37:48 -05:00
Matthew Woehlke
29731d8919 GoogleTest: Add timeout to discovery
Add a TIMEOUT option to gtest_discover_tests. This provides a
work-around in case a test goes out to lunch, rather than causing the
build to simply hang. (Although this is still a problem with the user's
project, hanging the build is not cool, especially in the case of
automatically running CI builds. It is much preferred that the build
should actively fail in this case, and it is trivially easy for us to
implement that.)
2017-12-06 07:37:48 -05:00
Marc Chevrier
9432f686e6 Add generator expression support to per-source COMPILE_DEFINITIONS
This allows users to specify different genex-based compile definitions for each file in a target.

Fixes: #17508
2017-12-05 14:47:39 +01:00
Brad King
0236e50802 Merge topic 'update-cpplint'
bfcc2034 Update cpplint support to return 0 and mark warnings for CDash.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1544
2017-12-05 08:14:39 -05:00
Brad King
caa1c4967a Merge topic 'csharp_project_without_sources'
8e654a37 VS: Enable generation of CSharp projects without initial .cs files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1521
2017-12-04 10:48:53 -05:00
Bill Hoffman
bfcc20343c Update cpplint support to return 0 and mark warnings for CDash.
This commit makes cpplint act like the other compiler mirroring tools. It
will always return 0 even if it reports warnings and will only return non
zero if there is a problem running the command. In addition, it will now
add some extra text to allow CTest to recognize the warnings and report
them correctly to CDash.
2017-12-01 16:23:45 -05:00
Brad King
22e67bc6bb Merge topic 'simplify_target_link_libraries'
8112059e target_link_libraries: Simplify implementation and add comments.
b0e2f141 target_link_libraries: Slightly fix some error-messages.
85457b63 target_link_libraries: Return earlier on some error.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1531
2017-12-01 08:24:08 -05:00
Brad King
5d43e46ad5 Merge topic 'whitelist-more-interface-properties'
fb3c5bfd cmTargetPropertyComputer: whitelist custom properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1515
2017-11-30 07:57:08 -05:00
Craig Scott
b311b87518 Merge topic 'check_fixtures_before_exe_existence'
fbe91dba CTest: Check failed fixture dependencies before test command and args

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !1526
2017-11-29 15:09:58 -05:00
Michael Stürmer
8e654a3785 VS: Enable generation of CSharp projects without initial .cs files
fixes #17388
2017-11-29 18:06:08 +01:00
Deniz Bahadir
b0e2f1415e target_link_libraries: Slightly fix some error-messages.
Some error-messages are slightly adjusted to better tell what
invocation would be correct instead. Tests are adjusted accordingly.
2017-11-29 17:01:47 +01:00
Brad King
caffddd620 Merge topic 'CheckIncludeFiles-language-CXX'
b31d5e1d CheckIncludeFiles: improve warning for missing argument
1f1c2a9f CheckIncludeFiles: clean up documentation of new features
c8609992 Help: Add notes for topic 'CheckIncludeFiles-language-CXX'
ea1bb902 CheckIncludeFiles: add unit tests
7669695a CheckIncludeFiles: extend to allow a LANGUAGE argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1464
2017-11-29 08:26:05 -05:00
Brad King
89a628e28f Merge topic 'fortran-compiler-launcher'
f19c70c3 Fortran: Add option to run the compiler through launcher tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1517
2017-11-29 08:21:44 -05:00
Craig Scott
fbe91dba6a CTest: Check failed fixture dependencies before test command and args 2017-11-29 07:27:20 +11:00
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
David Adam
b31d5e1dfd CheckIncludeFiles: improve warning for missing argument 2017-11-24 15:54:00 +08:00
Brad King
f19c70c3d2 Fortran: Add option to run the compiler through launcher tools
Add a `Fortran_COMPILER_LAUNCHER` target property like those added for C
and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler
through tools like ccache or distcc, 2015-06-04) and CUDA by commit
v3.10.0-rc1~531^2 (CUDA: Add option to run the compiler through launcher
tools, 2017-06-09).

Fixes: #17499
2017-11-21 14:44:01 -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
Ben Boeckel
fb3c5bfdbe cmTargetPropertyComputer: whitelist custom properties
CMake's properties will never begin with an underscore or a lowercase
letter, so allow them to be set by projects.
2017-11-21 11:35:41 -05: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
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