Commit Graph

99 Commits

Author SHA1 Message Date
Brad King
c932f49842 cmake: Teach -E capabilities to report supported fileapi requests
Fixes: #19339
2019-06-07 11:08:38 -04:00
Brad King
a7d2efc15b Merge topic 'remove_directories'
07a80c7002 cmake: Teach -E remove_directory to remove multiple directories
013bee698e Tests: Add RunCMake.CommandLine make_directory test checks
3eb16de327 Tests: Fix RunCMake.CommandLine make_directory test name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3411
2019-06-04 08:37:04 -04:00
Brad King
f263650f95 Tests: Fix RunCMake.CommandLine test to use generator in no-S-B case
Apply the fix from commit baed22c4b0 (Tests: Fix RunCMake.CommandLine
test to use generator with -S and -B, 2019-04-10) to the `no-S-B` case
too.  It also generates a build system and should use the generator
being tested.
2019-06-03 14:57:19 -04:00
John Freeman
07a80c7002 cmake: Teach -E remove_directory to remove multiple directories
The `make_directory` command can make multiple directories in a single
invocation.  Make `remove_directory` mirror that behavior.
2019-06-03 14:20:00 -04:00
John Freeman
013bee698e Tests: Add RunCMake.CommandLine make_directory test checks 2019-06-03 14:17:11 -04:00
John Freeman
3eb16de327 Tests: Fix RunCMake.CommandLine make_directory test name 2019-06-03 14:16:50 -04:00
Brad King
8ed6efbbd3 Merge topic 'default-generator-env'
d0f0ba0f7a Tests: Add environment generator tests
a48ce8f4bf Help: Add documentation for default generator environment variables
083cf7e8a2 cmake: Allow default generator to be set by environment variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3218
2019-05-22 10:32:43 -04:00
Eicke Herbertz
d0f0ba0f7a Tests: Add environment generator tests 2019-05-22 07:40:51 -04:00
Brad King
186ca170da Merge topic 'std-pipes-always'
c85524a94a Ensure stdin, stdout, and stderr pipes are always open

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !3282
2019-05-03 11:48:46 -04:00
Brad King
c85524a94a Ensure stdin, stdout, and stderr pipes are always open
On non-Windows platforms libuv assumes that file descriptors 0-2 are
always used for standard pipes and never for anything else.  Otherwise,
libuv may re-use one of these descriptors and then fail an assertion
when closing it.  Similarly, On Windows platforms our ConsoleBuf
implementation assumes that the standard handles are always open.

If CMake is run with any standard pipes closed, open them with
`/dev/null` or `NUL` to satisfy these assumptions.

Fixes: #19219
2019-05-02 14:34:58 -04:00
Fred Baksik
6ad699358b cmake: --build -j <jobs> should not accept 0.
Fixes #19059
2019-05-01 09:15:51 -04:00
Brad King
39e7fd8c68 Tests: Avoid enabling languages in RunCMake.CommandLine -S and -B cases
The test project does not compile any sources and so does not
need to enable any languages.
2019-04-10 09:40:48 -04:00
Brad King
baed22c4b0 Tests: Fix RunCMake.CommandLine test to use generator with -S and -B
The `-S` and `-B` command-line option tests do generate build systems
and so should use the generator being tested.
2019-04-10 09:40:48 -04:00
Kyle Edwards
8c0b7aa17d Merge topic 'cmake--install'
73f23d1e00 cmake: add '--install <dir>' option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Acked-by: Bartosz <gang65@poczta.onet.pl>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Rejected-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !3069
2019-03-19 13:39:18 -04:00
Jiang Yi
73f23d1e00 cmake: add '--install <dir>' option
Fixes: #19023
2019-03-17 01:31:25 +08:00
Bartosz Kosiorek
077ab5774c cmake: add short version of '--target <tgt>...' option 2019-03-12 12:00:09 +01:00
Bartosz Kosiorek
324d18bb34 cmake: Teach --build mode to support multiple targets
Fixes: #16136
2019-03-05 08:55:28 -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
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
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
Brad King
1f411b0cfa Merge topic 'cmake-option-parsing'
27eb7c5bdb cmake: Ensure source and binary dirs are set
a1adbc7243 cmake: Stop processing if -P option lacks file name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2799
2019-01-14 07:25:46 -05:00
Craig Scott
27eb7c5bdb cmake: Ensure source and binary dirs are set
If only the source dir is provided, the binary dir is assumed
to be the working directory. If only the binary dir is provided
and it doesn't yet have a CMakeCache.txt to provide the
source dir, then the source dir is assumed to be the working
directory. This logic was not previously being handled
correctly when -S and/or -B options were involved.
Furthermore, when both were missing, no suitable error
message was provided and an empty string was used for
the build directory.

Fixes: #18707
2019-01-14 07:13:28 +11:00
Brad King
2ec3363ea5 Tests: Add cases for -{C,D,U} without a source tree 2019-01-10 21:19:26 +11:00
Artur Ryt
cbf0c0fce4 cmake: Enable --warn-uninitialized inside string(CONFIGURE) and configure_file
Fixes: #18489
2018-12-30 08:31:09 +11:00
Isaiah Norton
100366a267 cmake: add error message when '-E touch' fails
Issue: #16526
2018-11-27 16:20:43 -05:00
R2RT
53a5aec899 CMP0053: Fix double warning on uninitialized variables in -P mode
When `CMP0053` is not set to OLD or NEW then we compute both variants
in case we need to warn about a behavior change.  Do not allow both
code paths to produce an uninitialized variable warning.

Fixes: #18552
2018-11-05 08:31:09 -05:00
Brad King
379e5f93a9 Tests: Add cases for -{C,D,U} without a source tree 2018-10-26 10:56:46 -04:00
Kyle Edwards
514f0b572e Testing: Update hard-coded line numbers to [0-9]+ in some tests 2018-10-10 10:06:27 -04:00
Brad King
a9df54ec31 Merge topic 'symlink'
afb7f6e4ff cmake: Add '-E create_symlink' support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2144
2018-09-19 10:41:07 -04:00
Jon Chronopoulos
afb7f6e4ff cmake: Add '-E create_symlink' support on Windows
The allows `-E create_symlink` to work on Windows.  It utilizes
`uv_fs_symlink`.  I am still unsure exactly which Windows platforms will
work without requiring Administrator privileges or needing a user/group
with the "Create Symbolic Links" User Rights.  It does work with my
Windows 10 Pro with Developer Mode turned on.  In the test suite check
that the symlink either worked or failed with a permissions error.

Use recent changes in cmSystemTools::FileExists to check that a symlink
is broken.
2018-09-18 11:24:08 -04:00
Robert Maynard
a10d63d578 cmake: -S and -B can be used to specify source and build directories
Document the previously internal option of '-B' and provide a
matching source directory option with '-S'. Both '-B', and '-S'
can be used independently of each other.
2018-09-15 11:25:47 -04:00
Brad King
7bffd71c3b Tests: Adopt wizard test in RunCMake.CommandLine
Avoid a whole separate test for one removed command-line option.
2018-06-22 13:59:14 -04:00
Brad King
523c443d13 clang-format.bash: update to clang-format-6.0
Update `.clang-format` with configuration to make the 6.0 format as
close as possible to what 3.8 produced before.  Then revise the style:

* Indent preprocessor directives (a feature new since 3.8)
* Add a newline and indentation before inheritance `:` and `,`

Rename the Git attribute identifying the format to include the
clang-format version number: `format.clang-format-6.0`.  This will aid
external infrastructure in knowing what version of the tool to run.
2018-06-01 09:52:02 -04:00
Florian Maushart
1ab3881ec9 cmake: Add options for parallel builds to --build mode
While we already support `cmake --build . -- -j`, the options after `--`
are specific to the native build tool.  Add new options `--parallel
[<N>]` and `-j [<N>]` to abstract this and map to the proper option
for the native build tool.
2018-05-25 09:42:20 -04:00
Brad King
5c10e8f608 Merge topic 'fix-crash-trace-exp-uninit-vars'
aad360eb3d Fix crash with --trace-expand --warn-uninitialized together

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1944
2018-04-10 11:32:56 -04:00
R2RT
aad360eb3d Fix crash with --trace-expand --warn-uninitialized together
Some code paths in `ExpandVariablesInString{New,Old}` were not checking
the `filename` parameter for a null pointer, but this can happen when
using the above flags together.  Add the checks and a test case.

Fixes: #17896
2018-04-09 11:59:07 -04:00
Brad King
eb80af9093 Drop Visual Studio 8 2005 generator
This generator has been deprecated since CMake 3.9.  Remove it.
2018-04-02 10:08:10 -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
Bill Hoffman
3bbe95f58a Clean up iwyu code to not be one big if statement.
This commit changes the internal -E__run_iwyu to be -E__run_co_compile. This
is used for co-compile commands. These are tools that want to mirror the
compiler. For each compiler invocation the tool will be invoked first. This
started as a way to implement include what you use (iwyu), but has expanded
to include cpplint, cppcheck and others. Likely there will be more in the
future as well. This commit implements each one in its own function and
provides a way to add additional ones in the future with less work.
2017-09-13 17:44:49 -04:00
Bill Hoffman
311b7b1a70 Add properties to run cppcheck along with the compiler
Create a `<LANG>_CPPCHECK` target property (initialized by a
`CMAKE_<LANG>_CPPCHECK` variable) to specify a `cppcheck` command line
to be run along with the compiler.
2017-08-30 10:23:46 -04:00
André Klitzing
c4de0a25ac Add sha1sum, sha224sum, sha256sum, sha384sum and sha512sum to command mode 2017-07-14 19:49:45 +02:00
André Klitzing
501a4feea8 Add some unit tests for md5sum 2017-07-09 13:18:20 +02:00
Brad King
81f9c9e892 Deprecate Visual Studio 8 2005 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2017-04-21 13:45:45 -04:00
Brad King
c94f1bcf92 Drop Visual Studio 7 .NET 2003 generator
This generator has been deprecated since CMake 3.6.  Remove it.
2017-04-19 15:28:05 -04:00
Gregor Jasny
ded616bdad cmListFileLexer: bail out on seek-errors
If we are given a FIFO, for example, we cannot seek back after trying to
read a Byte-Order-Mark.

Closes: #16607
2017-02-27 09:14:28 -05:00
Brad King
d5f39a56a4 clang-format.bash: Use Git attributes to mark files for formatting 2017-02-22 16:59:26 -05:00
Jamie Snape
0618ddf6b1 Add properties to run the cpplint style checker with the compiler
Create a `<LANG>_CPPLINT` target property (initialized by a
`CMAKE_<LANG>_CPPLINT` variable) to specify a `cpplint` style checker
command line to be run along with the compiler.
2017-01-23 14:47:13 -05:00
Tobias Hunger
1d601c6cb9 server-mode: Introduce cmServerConnection
Use it to split pipe and stdin/out handling out of cmServer itself.

The server will shut down when it looses its connection to the client.
This has the nice property that a crashing client will cause the server
to terminate as the OS will close the connection on behave of the client.
2016-09-22 08:06:38 -04:00