Commit Graph

842 Commits

Author SHA1 Message Date
Carsten Rudolph 193b8fca52 cmBuildOptions: Split build arguments into separate object. 2022-01-22 06:35:38 -05:00
Brad King 39eabc17c4 Merge topic 'cmake-presets-include'
26a5512c0f CMakePresets: Add include field
a239f23a98 Refactor: Generalize file graph in CMakePresets
84d440caac Refactor: Split JSON processing into configure, build, and test presets
fd6ea2f67f Refactor: Rename cmCMakePresetsFile to cmCMakePresetsGraph

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6829
2022-01-10 17:12:03 -05:00
Kyle Edwards 84d440caac Refactor: Split JSON processing into configure, build, and test presets
Split up the file so that it won't be too big on some systems.
2022-01-06 18:52:30 -05:00
Kyle Edwards fd6ea2f67f Refactor: Rename cmCMakePresetsFile to cmCMakePresetsGraph
And change all references to "file" to say "graph" instead.
2022-01-06 18:52:30 -05:00
Sumit Bhardwaj 938a53f4f1 Refactor VsProjectType to its own header
Move VsProject to its own header so that we can consolidate IsManaged
and IsCSharp.
2021-12-23 11:53:39 -08:00
Brad King 4ef974e6cb CPack: Remove undocumented deprecated OSXX11 generator
This CPack generator was never documented, and has been deprecated since
commit 2ed00e8ef8 (CPack: Deprecate OSXX11 generator, 2020-01-31,
v3.17.0-rc1~45^2).

Issue: #20235
2021-11-05 12:39:22 -04:00
Kyle Edwards 9b479124cc install(TARGETS): Add FILE_SET mode 2021-10-27 15:17:23 -04:00
Kyle Edwards f2a44a8afa cmTarget: Add cmFileSet and associated properties 2021-10-27 15:17:23 -04:00
Marc Chevrier cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Brad King 67d0d8b9d5 Merge topic 'darwin-wmake-jwasm-support'
bf09145eb0 Enable Watcom WMake generator on Darwin
78f758a463 Use dashes for MASM flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6472
2021-08-25 09:18:11 -04:00
Brad King ac0f76a748 Merge topic 'revert-autouic-header-depends'
d2a6e160aa AUTOUIC: Revert "Fix generating of dependency rules for UI header files"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6465
2021-08-24 09:57:09 -04:00
Bradley Bell bf09145eb0 Enable Watcom WMake generator on Darwin
Open Watcom v2 runs on Mac OS and is useful there for doing
cross-compilation.
2021-08-20 20:35:40 -07:00
Brad King d2a6e160aa AUTOUIC: Revert "Fix generating of dependency rules for UI header files"
Revert commit e5ec0e52f4 (AUTOUIC: Fix generating of dependency rules
for UI header files, 2021-07-22, v3.21.1~8^2) because it caused
regressions.  For example, changing one C++ source can now cause many
others to rebuild.  Revert the change pending further investigation.

Fixes: #22531
Issue: #16776
2021-08-19 12:23:16 -04:00
Marc Chevrier e5cd39ca80 cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
2021-08-08 16:19:08 +02:00
Brad King 00cbc4cff7 Merge topic 'autouic-header-depends'
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
2021-07-26 09:34:52 -04:00
Alexey Edelev e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files
We could not rely on .ui files when generating the ninja rules
for the generated UI header files. .ui files might be added to the
target sources but never processed by AUTOUIC afterward, since UI
header files are never included in a source code. Instead of adding
dependency rules based on the .ui files, this approach scans
non-generated source files for includes of the UI header files,
as AUTOUIC does. This gives the consistent set of UI header files
at configure time, that could be used to generate byproducts rules
for the AUTOUIC. Also, the path to the generated UI header file depends
not on the .ui file location but on the include line is used in source
files.

Fixes: #16776
2021-07-23 15:37:31 +02:00
Zack Galbreath 5489ce74b3 ctest: support <CTestMeasurement> for runtime measurements
Teach CTest to parse output for <CTestMeasurement> in addition to
<DartMeasurement> for measurements defined at runtime.

Use a new class (cmCTestTestMeasurementXMLParser) derived from cmXMLParser
to parse the data and attributes these XML elements. This is an improvement
over our previous approach of using a series of regular expressions.

As part of this commit we also rename some member variables and methods
to make their purpose more clear.

DartStuff                        -> AllTestMeasurementsRegex
DartStuff1                       -> SingleTestMeasurementRegex
DartString                       -> TestMeasurementsOutput
GenerateDartOutput()             -> GenerateCTestXML()
GenerateRegressionImages()       -> RecordCustomTestMeasurements()
cmCTestRunTest::DartProcessing() -> ParseOutputForMeasurements()
2021-07-01 15:16:23 -04:00
Alex Richardson 115ff6a347 cmELF: Include the ELF parsing code unconditionally
Now that the ELF definitions are provided on all platforms there is no
need to keep the CMake_USE_ELF_PARSER option.
2021-06-24 10:57:51 -04:00
Alex Richardson 5dfa3ddbe5 cmELF: Allow building without system ELF headers
Use ELF headers vendored in `Utilities/cmelf` to get the ELF constants
and types. Using the same ELF definition header for all compilation
targets allows removing some #ifdefs depending on the host OS since we
know all required ELF constants will always be present. To reduce the
size of this commit, the CMake_USE_ELF_PARSER definite will be removed
in a separate commit.

This allows me to use CMAKE_BUILD_WITH_INSTALL_RPATH=False and the Ninja
generator on macOS, whereas before it would always give me the following
error message (despite cross-compiling for an ELF-based platform):

```
The install of the <name> target requires changing an RPATH from
  the build tree, but this is not supported with the Ninja generator unless
  on an ELF-based platform.  The CMAKE_BUILD_WITH_INSTALL_RPATH variable may
  be set to avoid this relinking step.
```
2021-06-24 10:57:51 -04:00
Kyle Edwards ed3633d88c install(TARGETS): Add RUNTIME_DEPENDENCIES option 2021-06-04 08:52:02 -04:00
Kyle Edwards f2617cf8e6 Source: Add cmInstallRuntimeDependencySet 2021-06-04 08:52:01 -04:00
Kyle Edwards df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode 2021-05-31 09:02:45 -04:00
Marius Messerschmidt bceb8e2ed2 cmMessenger: Pass title inside a metadata structure 2021-05-19 09:06:27 -04:00
Orgad Shaneh ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Kyle Edwards ce6ea7c927 Refactor: Move some common code into separate file
This code is going to be needed by both cmCMakePresetsFile and
cmCMakePresetsFileReadJSON when the upcoming condition types are
created. Move it into a header file.
2021-03-19 11:30:07 -04:00
Kyle Edwards ebbd475e54 Refactor: Move cmCMakePresetsFile::ReadJSON into a separate file
Some compilers complain about translation units that are too large.
In order to prepare for upcoming additions to cmCMakePresetsFile,
split ReadJSON into a separate file.
2021-03-19 11:30:02 -04:00
Brad King fe17685722 cmGlobalVisualStudio10Generator: Adopt flag table name methods
Migrate them from `cmVisualStudio10ToolsetOptions`.
2021-03-05 09:34:58 -05:00
Brad King 56fc4a325f cmXCOFF: Add helper to parse and edit the XCOFF binary format 2021-02-03 12:26:58 -05:00
Brad King cdcfe3eb99 Rename CMAKE_USE_MACH_PARSER to CMake_USE_MACH_PARSER
We use the `CMake_` prefix for options affecting CMake itself.
2021-02-03 11:35:31 -05:00
Brad King b6071c93f5 Rename CMAKE_USE_ELF_PARSER to CMake_USE_ELF_PARSER
We use the `CMake_` prefix for options affecting CMake itself.
2021-02-03 11:35:31 -05:00
Brad King 32498d0665 cmake: Reduce default recursion depth when compiling with IntelLLVM
This compiler makes stack frames large enough (at least in Debug
builds) that CMake language recursion to depth 1000 overflows the
stack.  Reduce the limit for this compiler.
2021-01-28 09:07:00 -05:00
Ben McMorran bb069c0857 cmFileAPI: Add "toolchains" object kind.
Fixes #19514
2021-01-12 11:21:19 -08:00
Brad King c257c25419 add_custom_{command,target}: Add genex support to OUTPUT and BYPRODUCTS
Move rejection of `#`, `<`, and `>` characters in outputs and byproducts
to a generate-time check.  This removes the front-end check that
disallowed generator expressions.  The generators have already been
updated to handle them.

Fixes: #12877
2020-12-11 08:24:21 -05:00
Brad King a24a4e18af Merge topic 'makefiles-compiler-deps-optims'
2c71d051fa Makefiles Generators: use compiler for dependencies generation
afd0f6785d Refactoring: Abstract Makefile line continuation format
b6068ce407 Refactoring: enhance include file filtering
3401403f69 Refactoring: Introduce place-holder for dependency target.
a97c41bf8b Refactoring: Makefiles Generators: Add support for various depends scanners

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !5528
2020-11-30 13:26:53 -05:00
Brad King 9fe62a34c1 Merge topic 'enable-extensions-on-qnx'
34f6d76755 QNX: Do not disable compiler extensions for CMake itself

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5537
2020-11-30 12:36:13 -05:00
Marc Chevrier 2c71d051fa Makefiles Generators: use compiler for dependencies generation
Each source compilation generates a dependencies file. These dependencies
files are consolidated in one file per target. This consolidation is done
as part of command 'cmake -E cmake_depends` launched before evaluation of
makefile dependency graph.

The consolidation uses the same approach as `CMake` dependencies management.

Fixes: #21321
2020-11-29 15:25:42 +01:00
Stephen Kelly 34f6d76755 QNX: Do not disable compiler extensions for CMake itself
The `set(CMAKE_CXX_EXTENSIONS FALSE)` option has the effect of passing
compile option `-std=c++NN` instead of `-std=gnu++NN`.  On some
platforms, the latter form (or the secondary effects that it has, such
as setting _XOPEN_SOURCE) is required.  This typically affects platforms
such as mingw, cygwin and QNX.  The GNU-like compiers default to
`-std=gnu++NN`, which means that users can typically build source code
on those platforms by default.

While the `set(CMAKE_CXX_EXTENSIONS FALSE)` option was set here in
commit f034b0f6 (CMake compilation: do not use compiler extensions,
2020-03-14), the other changes in that commit added `#defines` which
become required in the absense of use of `-std=gnu++NN`.  However, only
platforms regularly tested in the cmake dashboard were ported, as is
reasonable.  That made CMake fail to compile on QNX and perhaps other
platforms which for which no one is submitting regular testing to the
cmake dashboard.

Make the `set(CMAKE_CXX_EXTENSIONS FALSE)` option conditional on non-QNX
to restore the QNX build.

Issue: #21503
2020-11-25 10:17:29 -05:00
Ben Boeckel a02c4ccabc cmScanDepFormat: add reader and writer for the format from P1689R2
This format is currently subject to change, but is not too far from the
end goal.

Some bits are currently unimplemented (see TODO comments).
2020-11-17 13:16:05 -05:00
Marc Chevrier 1c912056a1 cmake_path: remove new command from 3.19
Defer adding this command until post-3.19 development so that it
has more time to mature before being included in a release.

Issue: #21385
2020-11-03 09:55:35 -05:00
Brad King 4f6fccd861 Merge topic 'remove-server-mode'
9952ee063a server: remove deprecated 'cmake -E server' mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5370
2020-10-15 08:31:47 -04:00
Brad King 9493532f80 Merge topic 'cmake-E-cat-binary'
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:51 -04:00
Brad King b1d9a25f35 Merge topic 'cmake-E-cat-binary' into release-3.19
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:50 -04:00
Brad King 9952ee063a server: remove deprecated 'cmake -E server' mode
The server mode has been deprecated since commit 996e1885c4 (server:
deprecate in favor of the file-api, 2019-04-19, v3.15.0-rc1~198^2).
Clients should now be using the file-api.  Remove the server mode.
2020-10-14 16:41:50 -04:00
Brad King 90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management 2020-10-14 12:08:06 -04:00
Kyle Edwards b2c14bc774 cmake -E: Add cmake_transform_depfile internal command 2020-10-13 10:18:02 -04:00
Kyle Edwards 06128cf949 Presets: Add cmCMakePresetsFile class 2020-10-05 09:49:59 -04:00
Zack Galbreath 56e4e942d2 ctest: split launcher XML writer into separate class
This refactor will allow us to more easily add additional warnings and errors
to builds that use launchers.
2020-09-28 13:13:52 -04:00
Kyle Edwards 3f3a30e1e0 JSON: Add helpers 2020-09-09 08:29:02 -04:00
Marc Chevrier eb583b0a66 cmake_path command: path management
Fixes: #19568, #20922
2020-09-06 10:52:25 +02:00
Marc Chevrier 212e953d35 cmCMakePath: Class for path handling 2020-09-06 10:34:17 +02:00