Commit Graph

6153 Commits

Author SHA1 Message Date
Brad King
9620cb935a Merge topic 'add_consistent_verbose_build_flag'
66801f4d40 cmake: Add tests for verbose output to --build mode
439fe2e253 cmake: Add options for verbose output to --build mode
638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments
3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode
cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2708
2019-01-29 09:19:39 -05:00
Brad King
5134e11ee4 Merge topic 'update-tutorial'
0e2cdacf7b Tests: Update style of c++ code snippets in Tutorial directions
f2ddedfa58 Tests: Update CMake tutorial
438651506a Tests: Make ExternalProjectLocal independent of Tutorial directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2731
2019-01-29 09:15:44 -05:00
Brad King
fa7077e741 Merge topic 'vs-host-arch'
0fd742a6ff VS: Teach VS 2019 generator to select host tools matching host arch
17cef3806d VS: Add support for explicit 32-bit toolset selection via host=x86
bf774e521b VS: Remove stray semicolons from VS 2019 implementation
142e67eac6 VS: Use internal abstraction for VCTargetsPath host arch

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2870
2019-01-29 09:05:51 -05:00
Brad King
0fd742a6ff VS: Teach VS 2019 generator to select host tools matching host arch
This generator is new so we can introduce the long-desired behavior
of selecting ``host=x64`` tools by default on x64 hosts.
2019-01-28 12:58:21 -05:00
Brad King
17cef3806d VS: Add support for explicit 32-bit toolset selection via host=x86
Generalize the ``host=x64`` option in `CMAKE_GENERATOR_TOOLSET`
to also support ``host=x86``.
2019-01-28 11:22:50 -05:00
Robert Maynard
66801f4d40 cmake: Add tests for verbose output to --build mode 2019-01-28 10:01:55 -05:00
Sebastian Holtermann
03dbb62d31 Autogen: Reenable passing compiler implicit include directories to moc
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07) we now have compiler implicit include
directory computation for gcc and clang.  It should be safe now to pass
these to `moc`.  This patch re-enables passing the compiler implicit
include directories to `moc`, which was disabled due to issue #18669.

Fixes: #18041
Issue: #18669
2019-01-28 08:41:37 -05:00
Brad King
a844c7248d Merge topic 'cmake-E-compare_files-eol'
a5098cad94 cmake: Add --ignore-eol option to `-E compare_files` command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2778
2019-01-28 08:27:03 -05:00
Taylor Braun-Jones
a5098cad94 cmake: Add --ignore-eol option to -E compare_files command
Fixes: #13007
2019-01-28 08:24:50 -05:00
Brad King
1593e16d88 Merge topic 'get_filename_component_last_ext'
2a9220c34d Help: Add notes for topic 'get_filename_component_last_ext'
edda30d0f5 Tests: Add tests for LAST_EXT and NAME_WLE
7a25ef326b Help: Add documentation for new get_filename_component components
e50a36df48 cmGetFilenameComponentCommand: Add more components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2853
2019-01-28 08:21:50 -05:00
Brad King
dc752c9d2d Merge topic 'implicit-incs-upd'
2e91627dea ParseImplicitIncludeInfo: add Fortran implicit include handling
568343767e ParseImplicitIncludeInfo: handle/add SunPro, XL, and -nostdinc test cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2855
2019-01-28 08:08:36 -05:00
Brad King
70fabb8f25 Merge topic 'png-optimize'
b9e6d04558 Reduce size of PNG images
880e380599 CPack: Replace corrupted background png with original

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2852
2019-01-28 08:04:51 -05:00
Zack Galbreath
0e2cdacf7b Tests: Update style of c++ code snippets in Tutorial directions 2019-01-27 16:03:00 -05:00
Betsy McPhail
f2ddedfa58 Tests: Update CMake tutorial
Latest material from data.kitware.com -> Collections -> Courses -> CMake.
2019-01-27 16:03:00 -05:00
Betsy McPhail
438651506a Tests: Make ExternalProjectLocal independent of Tutorial directory
Adopt a copy of the needed content so we can modify the original
independent of this test.
2019-01-27 16:03:00 -05:00
Chuck Cranor
2e91627dea ParseImplicitIncludeInfo: add Fortran implicit include handling
Currently cmake is only setting CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES
the first time it runs (the implicit includes parser is only run when
the cache variables are initially populated).  It is left unset
during additional runs.  This behavior is both confusing and
inconsistent.

Modify CMakeFortranCompiler.cmake.in to preserve the value of
CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES so that cmake's Fortran
behavior matches C and CXX (i.e. CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES
retains its value across runs).  The implicit includes variable may
not be as useful for Fortran as it is for C and CXX, but we do want
cmake to be consistent in how it is handled.

Adjust CMakeParseImplicitIncludeInfo to parse verbose Fortran output
for Cray and XL compiler IDs (GNU and clang were already ok since
they use the same verbose output format as they do with C/CXX).

Allow Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
to generate test inputs for Fortran too, and add some sample Fortran
input files for the Tests/RunCMake/ParseImplicitIncludeInfo test.
2019-01-25 10:57:42 -07:00
Chuck Cranor
568343767e ParseImplicitIncludeInfo: handle/add SunPro, XL, and -nostdinc test cases
Add parser code for compiler IDs SunPro and XL.  For SunPro, /usr/include
appears to be hardwired in and it does not have a -nostdinc-type flag.

For XL, the "xlc" and "xlC" commands determine if you are C or C++
based on input filename.  So compiling x.c with "xlC" reverts to C
and compiling x.cc with "xlc" upgrades to CXX.  System include paths
are specified by:
  -qc_stdinc=[path] and -qgcc_c_stdinc=[path] (for C)
  -qcpp_stdinc=[path] and -qgcc_cpp_stdinc=[path] (for CXX)
If you specify "-qnostdinc" then the above flags are ignored.
Specifying an empty path reverts the value to the default
path (e.g. "-qgcc_c_stdinc=" reverts that to the default).

Adjust the code to handle parsing the case where the user specifies
additional compiler include flags via CMAKE_C_FLAGS/CMAKE_CXX_FLAGS.
For example: "-DCMAKE_C_FLAGS=-nostdinc" ... note that gcc and clang
output slightly differ when -nostdinc is specified (clang skips
printing 'search starts here:' with the angle brackets, gcc always
prints it).

Enable sunos-{C,CXX}-SunPro test cases and add XL test cases.
Also add a few -nostdinc style tests.
2019-01-25 07:48:00 -07:00
Lucy Phipps
b9e6d04558 Reduce size of PNG images
Use FileOptimizer 13.50.2431 (x86) and ZopfliPNG 1.0.2.

Update expected file hashes in tests.
2019-01-25 09:14:51 -05:00
Brad King
40628b2519 Merge topic 'max-recursion-depth'
a6982cff0d cmMakefile: Impose maximum recursion limit

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Juraj Oršulić <juraj.orsulic@fer.hr>
Merge-request: !2746
2019-01-25 08:09:37 -05:00
Brad King
24b6e4830d Merge topic 'exclude_from_all'
dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2816
2019-01-25 08:06:54 -05:00
Tushar Maheshwari
edda30d0f5 Tests: Add tests for LAST_EXT and NAME_WLE 2019-01-24 22:42:42 +05:30
Hiroshi Miura
513e77550d FindPython: Introduce NumPy component
Fixes: #18678
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-01-25 01:26:48 +09:00
Kyle Edwards
e4541b0e3d FindPython: Support script mode
Fixes: #18827
2019-01-23 13:51:09 -05:00
Kyle Edwards
8ef1916c82 FindPython: Test existence of imported targets 2019-01-23 11:53:54 -05:00
Kyle Edwards
a6982cff0d cmMakefile: Impose maximum recursion limit
In order to keep infinitely-recursive scripts from causing a stack
overflow in the CMake executable, CMake now imposes a maximum
recursion limit before issuing an error message. The limit can be
adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH.

Fixes: #18694
2019-01-23 09:52:29 -05:00
Brad King
c1247d861a Merge topic 'cmake_build_jobs_supports_no_space'
f2fca92686 cmake: --build supports '-jN'
e463133cd2 Tests: Remove unused files from RunCMake.CommandLine test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2819
2019-01-23 08:15:36 -05:00
Craig Scott
68b51fb19a cmake: Convert no source/build dir error to warning
Temporarily restore previous behavior that allowed specifying
no source or build directory to work, even though it was
neither documented nor supported. This commit is expected
to eventually be reverted to restore the fatal error for such
cases.

Relates: #18817
2019-01-22 14:46:03 -05:00
Brad King
fa5bf870df Merge topic 'implicit-includes'
5990ecb741 Compute implicit include directories from compiler output
d751d2d2ed CMakeDetermineCompilerABI: set locale to C for try_compile()
c765ae495a CMakeDetermineCompilerABI: pass verbose flag during compilation
8c5221fb1f try_compile: Preserve special characters in COMPILE_DEFINITIONS
15ad830062 Refactor exclusion of -I/usr/include to avoid per-language values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2716
2019-01-22 11:37:49 -05:00
Brad King
a1f65014a3 Merge topic 'help-mark-default-generator'
dfd5ae7da7 Help: Mark default CMake generator with asterisk
6023fe7ff2 ccmake: Append rather than replace Generators section of docs
7408cd3929 cmake: Return generator docs directly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2682
2019-01-22 11:37:01 -05:00
Brad King
bcc9ea2b3d Merge topic 'crosscompiling_emulator-fix'
ab3b549ee0 CROSSCOMPILING_EMULATOR: Fix test generation for empty value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2834
2019-01-22 09:41:23 -05:00
Robert Maynard
f2fca92686 cmake: --build supports '-jN' 2019-01-22 08:27:04 -05:00
Brad King
e463133cd2 Tests: Remove unused files from RunCMake.CommandLine test
Drop `-stderr.txt` files for cases that do not exist.
2019-01-22 08:24:23 -05:00
Zack Galbreath
dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets
When a target is created it now inherits the EXCLUDE_FROM_ALL property
from its directory. This change makes it possible to include a target
in "all", even if its directory has been marked as EXCLUDE_FROM_ALL.
2019-01-21 11:38:24 -05:00
Chuck Cranor
5990ecb741 Compute implicit include directories from compiler output
- CMakeParseImplicitIncludeInfo.cmake: new parser that extracts the
   compiler's include path from verbose output.  If the parser cannot
   parse the output, we fall back to the old behavior.  On osx we skip
   over framework directories (handled elsewhere).

 - CMakeDetermineCompilerABI.cmake:
     - use verbose flag in try_compile for ${src}
     - use new cmake_parse_implicit_include_info() to attempt extract
       implicit include directory path and if successful set
        CMAKE_${LANG}_IMPLICIT_INCLUDE_DIRECTORIES

 - CMakeCCompiler.cmake.in and CMakeCXXCompiler.cmake.in - preserve
   CMAKE_${LANG}_IMPLICIT_INCLUDE_DIRECTORIES value between runs in
   the same way CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES is preserved

 - Tests/RunCMake/ParseImplicitIncludeInfo: tests for parse
   based on the older Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in.
   The test runs a set of verbose compiler outputs collected from
   various machines through the parser and checks the results.  New
   compiler files can be added by dropping input/output files in the
   ParseImplicitIncludeInfo/data subdirectory and then adding the new set
   of files to the ${targets} list in ParseImplicitIncludeInfo.cmake.
   There is a helper CMakeLists.txt in ParseImplicitIncludeInfo/data
   that can help with the generation of test input files.
   NOTE: the standard cmake pre-commit hook rejects verbose compiler
   output with trailing spaces... you have to manually edit them out.
   This shouldn't impact the test.

Note that both the parser and the test code can use CMAKE_${LANG}_COMPILER_*
variables such as ${CMAKE_CXX_COMPILER_ID} to decide how to parse
verbose compiler output.  For the test code, this requires us to
save the variables values in the test input files.

Fixes: #16291
2019-01-21 11:14:08 -05:00
Kyle Edwards
97700e9f5b FindGit: Add imported target 2019-01-21 10:01:56 -05:00
Kyle Edwards
ab3b549ee0 CROSSCOMPILING_EMULATOR: Fix test generation for empty value
If CROSSCOMPILING_EMULATOR was set to an empty string, and a test
was generated with the executable as the command, CMake would segfault
upon trying to generate the test file. Fix this.

Fixes: #18819
2019-01-21 09:57:25 -05:00
Brad King
02f7e997e9 Merge topic 'ExternalProject-non-cmake-source-subdir'
c09ec79981 ExternalProject: support SOURCE_SUBDIR for BUILD_IN_SOURCE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2823
2019-01-21 07:58:10 -05:00
Brad King
177b5fb61b Merge topic 'fortran-compiler-id'
a080914274 Fortran: Add compiler ID/Version generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2804
2019-01-21 07:56:59 -05:00
Brad King
eadaf0c8c3 Merge topic 'cmake-role-fix'
264bdac185 CMAKE_ROLE: Fix value for ctest --build-and-test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2820
2019-01-21 07:54:06 -05:00
Brad King
7e5f9b192e Merge topic 'ctest-json-polish'
cae9d2a61a CTest: Teach --show-only= to reject unknown values
7370b02c36 CTest: Teach --show-only=json-v1 to filter out not-available tests
62fec84ad7 Tests: Fix RunCMake.CTestCommandLine case when no python is found
75a7a23746 Tests: Rename RunCMake.CTestCommandLine show-only test cases
fecbc87608 Tests: Fix RunCMake.CTestCommandLine to actually check json-v1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2812
2019-01-21 07:51:08 -05:00
Brad King
d704cc3407 Merge topic 'command_file_link'
0f08ed8936 cmSystemTools: Silence CreateLink and CreateSymlink errors
593d986470 Tests: Avoid cross-device links in CREATE_LINK test
9a3d85cfc5 Tests: Skip symlink tests on Windows
e68ea269d7 Tests: CREATE_LINK subcommand negative test case
45aa9c65a1 Tests: file CREATE_LINK subcommand test cases
8bb7562f1a Help: Add documentation for file(CREATE_LINK) subcommand
81650e488c cmFileCommand: Add CREATE_LINK subcommand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2759
2019-01-21 07:48:26 -05:00
Brad King
d1aa2e1109 Merge topic 'find-package-resolve-symlinks'
b773e58099 find_package: add test coverage for CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
a5e948a36f find_package: optionally resolve symlinks when discovering packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2798
2019-01-21 07:47:29 -05:00
Brad King
fefae527c8 Merge topic 'submit-url'
2915a75615 CTest: Add documentation and release notes for SubmitURL
d6475daa79 Modules/CTest: Set SubmitURL
938f06fda6 ctest_submit: Add parameter SUBMIT_URL
65e725c957 CTest: Add option SubmitURL
65f1fc9d63 CTest: Add function GetSubmitURL
2bedd5fb7c ctest_submit: Remove submit method from log output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2719
2019-01-21 07:46:20 -05:00
Artur Ryt
dfd5ae7da7 Help: Mark default CMake generator with asterisk
Required extracting default generator evaluation
to explicit function, as Visual Studio generators
get validated during their construction.

Fixes: #18544
2019-01-18 12:57:34 -05:00
Kyle Edwards
264bdac185 CMAKE_ROLE: Fix value for ctest --build-and-test
--build-and-test builds a CMake project, so CMAKE_ROLE should be
PROJECT. Fix this and add a test case.
2019-01-18 10:15:25 -05:00
Andrew Paprocki
a080914274 Fortran: Add compiler ID/Version generator expressions
Adds `Fortran_COMPILER_ID` and `Fortran_COMPILER_VERSION` generator
expression support to match equivalent `C_COMPILER_ID`,
`CXX_COMPILER_ID`, `C_COMPILER_VERSION`, and `CXX_COMPILER_VERSION`
support.

This is very helpful in the case where the C/C++ compiler suite is a
different type of compiler from the platform Fortran compiler and
projects use generator expressions to assign compiler flags and
definitions.  (e.g. `GNU` C/C++ and `SunPro` Fortran on Linux)
2019-01-18 08:56:13 -05:00
Brad King
a61c061b61 Merge topic 'automoc-test-in-place'
1c08652580 Tests: Fix Qt4And5Automoc tests to work on in-source build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2817
2019-01-18 07:02:01 -05:00
Brad King
65a3abf999 Merge topic 'GHS_updates'
21ab58d3f8 GHS: Update test suite
72e0c115b7 GHS: Add Compiler ID detection
436cc5e991 GHS: try_compile() now uses GHS platform variables
4a1ec0de3d GHS: Fix toolset selection
1a66acdef2 GHS: Append ".gpj" to target name when generating build command
0c9e47d7cd GHS: Integrity Application updates
8044318431 GHS: Add support for some of the source file properties
73092b2213 GHS: Add support for object libraries
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2231
2019-01-18 06:58:35 -05:00
Ben Boeckel
c09ec79981 ExternalProject: support SOURCE_SUBDIR for BUILD_IN_SOURCE 2019-01-17 13:40:30 -05:00
Brad King
1c08652580 Tests: Fix Qt4And5Automoc tests to work on in-source build
Use a distinctly-named build directory for each case so that neither
one uses its own source tree as the build tree.

Fixes: #18159
2019-01-17 12:58:41 -05:00