Commit Graph

1679 Commits

Author SHA1 Message Date
Brad King
08813b17a1 Merge topic 'ctest_submit-https'
71f27c04b0 ctest_submit: show headers as debug info
4464ef21da ctest_submit: Check CA file during CDASH_UPLOAD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2171
2018-06-29 08:56:25 -04:00
Brad King
faa9ef9968 Merge topic 'lexer-null'
b29842a818 ListFileLexer: Do not match null bytes in input

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2174
2018-06-29 08:55:47 -04:00
Zack Galbreath
71f27c04b0 ctest_submit: show headers as debug info
Hide any headers specified by `ctest_submit(HTTPHEADER ...)` unless ctest
is run with --debug.  This option is used to present bearer tokens to CDash.
We do not want to inadvertently expose this secret data in the console
output log.
2018-06-27 15:08:14 -04:00
Brad King
b29842a818 ListFileLexer: Do not match null bytes in input
Extend the fix from commit v3.10.0-rc1~188^2 (ListFileLexer: fix
heap-buffer-overflow on malicious input, 2017-08-26) to apply to all
lexer token matches.  Replace all `.` with `[^\0\n]`.  Update all
`[^...]` match expressions to not match `\0`.

We cannot safely process null bytes in strings.

Fixes: #18124
2018-06-26 11:54:34 -04:00
Brad King
8848a1c07a Merge topic 'test-wizard'
7bffd71c3b Tests: Adopt wizard test in RunCMake.CommandLine

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2166
2018-06-25 09:56:56 -04:00
Brad King
383f29fd63 Merge topic 'file-GLOB-remove-new-errors'
142a625729 file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Shane Parris <shane.lee.parris@gmail.com>
Merge-request: !2164
2018-06-25 09:53:24 -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
1a21b4695a Merge topic 'vs_debugger'
797de7a6f6 VS10Project: Expand VS_DEBUGGER_* capabilities

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2150
2018-06-22 09:45:19 -04:00
Brad King
142a625729 file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressions
Refactoring in commit v3.12.0-rc1~418^2~3 (Refactor HandleGlobCommand,
2018-02-13) introduced error diagnostics for argument combinations that
were previously accepted.  Restore acceptance to avoid regressing
projects that used those combinations even if they do not make sense.

Fixes: #18097
2018-06-22 09:39:05 -04:00
Brad King
e11f660ae1 Merge topic 'xcode-10-legacy-build-system'
ca69206893 Tests: Do not use i386 architecture with Xcode 10 and above
71fa78ff7a Tests: Teach RunCMake to ignore Xcode missing file type warnings
057ecb8f6f C++ feature checks: Ignore Xcode warnings
985d3a162c Xcode: Use legacy build system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2151
2018-06-20 09:42:25 -04:00
Brad King
00a9d133fb Merge topic 'install_from_another_directory'
e89ad0f94e install: Allow installing targets created in another directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2152
2018-06-19 11:50:51 -04:00
Brad King
71fa78ff7a Tests: Teach RunCMake to ignore Xcode missing file type warnings
Xcode 10 beta warns

    xcodebuild... warning: file type '::com.apple.instruments.instrdst'
    is based on missing file type 'default::com.apple.package'

Teach RunCMake to drop such lines before matching against expected
output.
2018-06-19 10:56:50 -04:00
Craig Scott
6e7b424240 Merge topic 'subdir_target_sources'
316815e1f4 target_sources: Interpret relative paths as relative to the calling directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2128
2018-06-19 08:24:08 -04:00
Patrick Stotko
316815e1f4 target_sources: Interpret relative paths as relative to the calling directory
Previously the command considered non-absolute source file paths relative to
the associated target on the LHS. This causes problems in incremental builds
where files are added from subdirectories and forces users to workaround by
manually converting to absolute paths. Change this to enable more intuitive
usage by projects.

Fixes #17981
2018-06-18 21:01:57 +02:00
Zack Galbreath
e89ad0f94e install: Allow installing targets created in another directory
Previously, `install(TARGETS)` would only accept targets created in the same
directory scope.  Relax this restriction by searching the global scope when
determining whether or not a target exists.

Fixes: #14444
2018-06-18 13:18:54 -04:00
Jon Chronopoulos
797de7a6f6 VS10Project: Expand VS_DEBUGGER_* capabilities
This adds VS_DEBUGGER_COMMAND_ARGUMENTS and VS_DEBUGGER_ENVIRONMENT as
well as allowing VS_DEBUGGER_* to use generator expressions.
2018-06-17 17:55:27 +10:00
Sam Yates
c76c1ea208 find_program: Consider CWD only for paths with separator
find_program() incorrectly prepended search path components
to absolute file paths, and incorrectly searched the current
working directory for files that contained no directory
separators.

* Replace calls cmFindProgramHelper::CheckDirectory(std::string())
  with call of new method cmFindProgramHelper::CheckCompoundNames()
  that checks for the presence of a directory separator in the
  file name.
* Use cmSystemTools::CollapseCombinedPath rather than string
  concatenation to properly combine absolute file names with
  search path components.
* Add unit tests to verify corrections.

Fixes: #18044
2018-06-14 14:28:03 -04:00
Brad King
575f97763f Merge topic 'list_sort'
49a51a61d7 list: Add options to control the SORT comparison operation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2065
2018-06-14 13:55:57 -04:00
Daniel Franke
49a51a61d7 list: Add options to control the SORT comparison operation 2018-06-13 14:06:29 -04:00
Brad King
812eaa465c Merge topic 'LINK_OPTIONS'
66ea1a3795 LINK_OPTIONS: Add support of "LINKER:" prefix
c1f5a44b28 LINK_OPTIONS: Add new family of properties
8e28d2630a Makefile generator: link flags management refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !2033
2018-06-08 09:37:48 -04:00
Jon Chronopoulos
6dad812143 install: Teach CODE,SCRIPT modes to evaluate generator expressions
Fixes: #15785
2018-06-07 13:18:23 -04:00
Marc Chevrier
66ea1a3795 LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
Marc Chevrier
c1f5a44b28 LINK_OPTIONS: Add new family of properties
This family enable to manage link flags

Three new properties:
* directory property: LINK_OPTIONS
* target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS

Two new commands
* add_link_options(): to populate directory property
* target_link_options(): to populate target properties

Fixes: #16543
2018-06-06 17:22:39 +02:00
Brad King
21b7e14800 Merge topic 'ep-support-passing-var-ending-with-notfound'
7ad5165c67 ExternalProject: Fix cache generation when args end with "-NOTFOUND"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2127
2018-06-05 11:23:49 -04:00
Jean-Christophe Fillion-Robin
7ad5165c67 ExternalProject: Fix cache generation when args end with "-NOTFOUND"
Generalize the fix in commit v3.11.0-rc4~8^2 (ExternalProject: Fix cache
generation when last args ends with "-NOTFOUND", 2018-03-10) to work for
any argument rather than just the last one.

ExternalProject can now successfully generate the cache file when any
(not only the last one) cache variable associated with either
`CMAKE_CACHE_ARGS` or `CMAKE_DEFAULT_CACHE_ARGS` configure step option
is set to a `<value>` ending with `-NOTFOUND`.
2018-06-04 11:37:52 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -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
Brad King
958191a95c Merge topic 'vs-toolset-version'
5f13168419 VS: Add option to select the version of the toolset used by VS 2017

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Francisco Facioni <fran6co@gmail.com>
Merge-request: !2093
2018-05-30 10:19:21 -04:00
Basil Fierz
5f13168419 VS: Add option to select the version of the toolset used by VS 2017
Add new `version=` parameter in the toolset setting to select the
version.  Add variable `CMAKE_VS_PLATFORM_TOOLSET_VERSION` to hold the
version, if one is set (blank indicates default).

Fixes: #17549
2018-05-29 10:12:59 -04:00
Brad King
f248f8ad78 Merge topic 'parallel_build_option'
1ab3881ec9 cmake: Add options for parallel builds to --build mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !1962
2018-05-29 10:05:09 -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
Alexander Grund
9455512d22 FindLua: Add tests for this module 2018-05-24 11:19:40 -04:00
Patrick Stotko
c9349cc1b9 target_link_libraries: Allow use with targets in other directories
Previously the command did not allow naming targets on the LHS that
were not created in the calling directory.  Lift this restriction to
enable more flexible use by projects.

Fixes: #17943
2018-05-15 10:22:35 -04:00
Brad King
c29992078f Merge topic 'custom-command-expand-empty'
6e59491659 add_custom_{command,target}: Fix crash on empty expanded command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2074
2018-05-15 09:54:08 -04:00
Brad King
813bcc2997 Merge branch 'custom-command-expand-empty' into release-3.11
Merge-request: !2074
2018-05-14 11:59:51 -04:00
Brad King
6e59491659 add_custom_{command,target}: Fix crash on empty expanded command
Our custom command generation logic assumes that all command lines have
at least `argv0`.  In `add_custom_{command,target}` we already check
that at least a `COMMAND` was given, but using `COMMAND_EXPAND_LISTS` in
combination with a generator expression that expands to an empty string
may produce an empty command line.  In this case simply add an empty
string as a command to maintain our internal invariant.

Fixes: #17993
2018-05-14 11:54:27 -04:00
Rolf Eike Beer
92ac721a44 FindPkgConfig: export the list of found libraries also as variable 2018-05-11 19:35:53 +02:00
Brad King
1e521a1a91 Merge topic 'restore-imported-lib-alias-diagnostic'
e567d7eb63 add_library: Restore error on alias of non-global imported target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2058
2018-05-11 09:18:08 -04:00
Brad King
e567d7eb63 add_library: Restore error on alias of non-global imported target
In commit v3.11.0-rc1~433^2~1 (Add support for IMPORTED GLOBAL targets
to be aliased, 2017-09-14) we accidentally dropped the error on calling
`add_library` to alias an imported target that is not globally visible.
The `add_executable` command's equivalent check was properly updated.
Restore the check in `add_library` with the same update.  Also fix the
test case accordingly.

Fixes: #17982
2018-05-10 09:57:31 -04:00
Kyle Edwards
563781099f ctest_start: read model from TAG file
This change reworks ctest_start() so that simply calling
ctest_start(APPEND) will read all the information from the TAG file.
On top of that, it relaxes the argument parsing for ctest_start() to
allow greater flexibility in the argument ordering, and the documentation
for ctest_start() has been cleaned up.
2018-05-09 08:22:55 -04:00
Michael Stürmer
8d7ffed048 cmVisualStudio10TargetGenerator: issue warning when adding static C# lib 2018-05-07 07:20:46 +02:00
Brad King
efaaa729aa Merge topic 'genex-complang-not-loaded'
4f82199bef Genex: Allow COMPILE_LANGUAGE to name a language that is not loaded

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2031
2018-05-04 09:36:08 -04:00
Henry Schreiner
4f82199bef Genex: Allow COMPILE_LANGUAGE to name a language that is not loaded
Evaluate to false on `$<COMPILE_LANGUAGE:Lang>` if language `Lang`
is not loaded.  This is helpful in exported targets consumed in other
projects that may not enable all the same languages.

Fixes: #17952
2018-05-03 08:34:39 -04:00
Kyle Edwards
edcb545a24 install: add test for new NAMELINK_COMPONENT parameter 2018-05-03 08:08:42 -04:00
Brad King
e52cf1034f Merge topic 'csharp_reference_imported_targets'
de549083e3 cmVisualStudio10TargetGenerator: warn if /clr flag is set manually
59ec7d50bd cmVisualStudio10TargetGenerator: fix for backward compatibility
663f5120f4 cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced()
359544a907 add tests for using target_link_libraries() with imported managed targets
43571073e0 cmVisualStudio10TargetGenerator: store managed reference information in maps
16fec7e2fc cmVisualStudio10TargetGenerator: make some methods config aware
f3c6828876 cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt
f9042d807d remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1805
2018-04-26 08:55:19 -04:00
Brad King
625b8f9076 Ninja: Avoid empty phony edges for target ordering
Since commit v3.9.0-rc1~230^2~2 (ninja: break unnecessary target
dependencies, 2017-04-17) we unconditionally generate a phony edge for
target ordering.  It is needed in case a later target depends on it.
However, if the phony edge has no inputs then `ninja -d explain` prints:

    ninja explain: output ... of phony edge with no inputs doesn't exist

Furthermore the phony edge's output is considered dirty and can cause
dependents to be incorrectly considered dirty.  Avoid this by always
generating at least one input to the target ordering phony edges.
If we have no real dependencies just use a path that always exists.

Fixes: #17942
2018-04-26 08:40:57 -04:00
Brad King
5a6c629289 Merge topic 'vs-dedup-custom-commands'
f59c33a763 VS: Generate a custom command only in the least dependent target
d58d4daa6b cmVisualStudio10TargetGenerator: Use cmLocalVisualStudio10Generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1889
2018-04-25 08:56:16 -04:00
Brad King
195400cab7 Merge topic 'Genex-TARGET_GENEX_PROPERTY'
4d15046edd Genex: Add $<TARGET_GENEX_EVAL:...> and $<GENEX_EVAL:...>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1984
2018-04-24 11:06:19 -04:00
Brad King
6c942ec338 Merge topic 'FindMatlab/mcr-compatibility'
59fb9e89b2 FindMatlab: Matlab Runtime Compiler support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1970
2018-04-24 11:01:36 -04:00
Michael Stürmer
359544a907 add tests for using target_link_libraries() with imported managed targets 2018-04-24 07:05:16 +02:00