Commit Graph

1142 Commits

Author SHA1 Message Date
John Parent
d7b18895bc cmake: Add filtered debug-find options
Add a `--debug-find-pkg=` option to debug find calls for specific
packages.

Add a `--debug-find-var=` option to debug find calls for specific
return variables.

Fixes: #21880
2021-12-17 08:55:21 -05:00
Brad King
56dc22d488 cmMessenger: Make relative path conversion more explicit
Move the decision to convert to call stacks to relative paths out to the
client.  Avoid using `cmState` to make the decision ourselves.
2021-12-08 10:03:48 -05:00
Brad King
3d378541bb cmMessenger: Adopt backtrace printing functions
Move backtrace printing functions from `cmListFileBacktrace` over to
`cmMessenger`, their primary caller.  Thread `cmMessenger` instances
through APIs needed to update other call sites.
2021-12-08 10:03:48 -05:00
Sean McBride
29ffa5f48c Source: fix -Wextra-semi-stmt warnings 2021-12-01 11:17:39 -05:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
f84193292c Use new AddCacheEntry signatures 2021-09-10 15:46:21 +02:00
Marc Chevrier
3c2e58eeb8 AddCacheEntry accept cmProp or std::string 2021-09-10 15:45:51 +02:00
Marc Chevrier
6dfa581bab Enhancement: SetProperty accept cmProp or std::string
Methods SetProperty of classes cmPropertyMap, cmStateDirectory
and cmMakefile accept now cmProp or std::string as argument.
2021-08-25 10:09:02 +02:00
leha-bot
d1599c3f7f Fix build on Android (host) 2021-08-13 21:32:49 +03:00
Brad King
6c440ea3ce cmake: Model normal and try-compile project kinds explicitly
Construct with the project kind instead of mutating state after
construction.
2021-07-12 12:21:52 -04:00
Brad King
2065bd73cb cmState: Construct with mode 2021-07-12 12:21:44 -04:00
Kyle Edwards
d9a3c9fad5 CMakePresets.json: Make --list-presets show presets with no generator
Fixes: #22389
2021-07-06 14:36:27 -04:00
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Brad King
072f8b7d0e Merge topic 'presets-build-fixes'
de2b14a711 Merge branch 'backport-3.20-presets-build-fixes' into presets-build-fixes
534c40e6d8 presets: Fix buildPreset "targets" not allowing a single string
5d67632813 presets: Fix buildPreset "jobs"
93e396b402 presets: Fix buildPreset "jobs" field test case
efe7ac9022 presets: Fix buildPreset "targets" not allowing a single string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6190
2021-06-09 07:57:34 -04:00
Sam Freed
de2b14a711 Merge branch 'backport-3.20-presets-build-fixes' into presets-build-fixes 2021-06-08 07:49:50 -04:00
Sam Freed
5d67632813 presets: Fix buildPreset "jobs"
Fixes: #22273
2021-06-08 07:47:24 -04:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Brad King
6c34ed9b87 cmake: Allow CMAKE_TOOLCHAIN_FILE to be set by environment variable
When no `CMAKE_TOOLCHAIN_FILE` is explicitly specified while creating
a new build tree, check for an environment variable of the same name.
2021-06-03 08:32:44 -04:00
Jake Cobb
c3bd5a6a2c cmake-gui: Unset empty CC,CXX on global generator change
On subsequent runs of configure from cmake-gui the global generator is
swapped.  So on runs other than the first it was setting CC and CXX to
empty when they were otherwise undefined.

Instead, restore them if non-empty and unset them if empty when changing
the global generator and a previous generator exists.

Fixes: #21449
2021-05-24 11:34:07 -04:00
Robert Maynard
372bf1bcc4 cmCommandLineArgument: Understands which commands require partial matching
Allows us to provide better error messages when commands such as
`--target` are passed invalid input.
2021-05-19 11:07:16 -04:00
Marc Chevrier
f5fa6d53b0 class cmake: Store working directory at cmake launch 2021-05-11 18:16:08 +02:00
Brad King
a94332ed37 Merge topic 'cmprop-nullptr'
ce97b7909b Source: Remove unnecessary comparisons to nullptr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6112
2021-05-11 09:26:39 -04:00
Brad King
d0b6eb8ec7 Merge topic 'capabilties-generator-platforms'
66be34853c cmake: add supported platforms to cmake -E capabilties report

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6102
2021-05-11 09:22:47 -04:00
Vitaly Stakhovsky
ce97b7909b Source: Remove unnecessary comparisons to nullptr 2021-05-10 11:44:53 -04:00
scheffle
66be34853c cmake: add supported platforms to cmake -E capabilties report 2021-05-10 10:28:28 -04:00
Josef Angstenberger
5950e54325 Source: Fix typos and spelling in comments 2021-05-07 17:00:18 +02:00
Robert Maynard
a9b968bb98 cmake-presets: Introduce toolchainFile preset option
In v3 of the presets, the `--toolchain` command line argument now
has a preset mapping.
2021-04-28 17:22:25 -04:00
Brad King
835896e985 cmake: Improve error message when failing to update generation timestamp
Include the underlying system error description.

Issue: #21571, #22086
2021-04-21 10:45:16 -04:00
Brad King
5ac713da70 Merge topic 'mrjoel/add-missing-not'
370bebd921 Add missing 'not' in error messages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6012
2021-04-19 09:44:03 -04:00
Brad King
bb290fc7a4 Merge topic 'add_toolchain_cmake_option'
d5c3e4ac32 cmake: add support for --toolchain command argument
13838bbb36 CMAKE_TOOLCHAIN_FILE: Document relative path behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5991
2021-04-16 11:39:28 -04:00
Joel Johnson
370bebd921 Add missing 'not' in error messages 2021-04-16 07:47:59 -06:00
Robert Maynard
d5c3e4ac32 cmake: add support for --toolchain command argument 2021-04-15 10:13:49 -04:00
friendlyanon
06e6981336 cmake-presets: Make generator and binaryDir fields optional
In v3 of the presets, generator and buildDir can be omitted to fall
back to regular cmake behavior when these values are not explicitly
provided by the user.

Fixes: #21987
2021-04-07 01:24:44 +02:00
Brad King
928f4bda30 Merge topic 'cmake-presets-condition'
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets
ce6ea7c927 Refactor: Move some common code into separate file
ebbd475e54 Refactor: Move cmCMakePresetsFile::ReadJSON into a separate file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5919
2021-03-23 10:33:59 -04:00
Kyle Edwards
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets 2021-03-22 15:04:54 -04:00
Andrew Gilewsky
7c4c4f1406 Treat '.ixx' and '.cppm' files as C++ sources
These extensions are used by convention for C++ modules and interface
units with MSVC.
2021-03-22 11:58:44 -04:00
Robert Maynard
b227a9565e cmake: configure preset add support for --install-prefix mapping 2021-03-09 13:53:16 -05:00
Robert Maynard
38140713ad cmake: add support for --install-prefix command argument
Fixes: #21781
2021-03-04 10:50:24 -05:00
Brad King
a133a583d4 cmLocalGenerator: Clarify GetIncludeFlags signature
Make the `config` argument non-optional so all callers must be explicit.
Convert the path style argument to an enumeration to make its role clear
at call sites.

The path style argument is implemented by `ConvertToIncludeReference`,
which was introduced with the Ninja generator by commit 5b114c9bee
(Introduce a cmLocalGenerator::ConvertToIncludeReference function,
2011-09-07, v2.8.7~187^2~4).  Its only purpose is to allow the Ninja
generator to use relative paths in `-I` flags.  Add a comment explaining
this role.
2021-02-25 13:24:45 -05:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00
Brad King
05f4248e3d Merge topic 'cpp-modules'
39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files
791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep
4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object
b0fc2993e1 Treat the '.mpp' file extension as C++ code
988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
dacd93a2db ninja: De-duplicate version numbers required for ninja features
533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Shannon Booth <shannon.ml.booth@gmail.com>
Merge-request: !5562
2021-01-07 08:26:28 -05:00
Robert Maynard
0fb78576b0 cmake: Use shared parsing code for all cmake argv parsing 2021-01-06 09:11:14 -05:00
Ben Boeckel
b0fc2993e1 Treat the '.mpp' file extension as C++ code
This is the extension required in build2 for C++ module support.
2021-01-05 09:29:18 -05:00
Brad King
f70814c3fd Merge topic 'install-properties'
63db7ae9c4 cmake: Clear INSTALL file properties between runs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5603
2020-12-14 07:08:49 -05:00
Brad King
63db7ae9c4 cmake: Clear INSTALL file properties between runs
Do not keep state across separate project configurations.
This is particularly important in `cmake-gui` where those
configurations can be for separate projects.

Fixes: #21580
2020-12-11 12:30:27 -05:00
Robert Maynard
1b6c5333a0 cmake: Error out on unknown arguments starting with -.
Fixes: #21521
2020-12-01 09:04:08 -05:00
Brad King
7302a23a1f cmake: Simplify -W recognition of no- and error= prefixes 2020-11-19 08:53:58 -05:00
Robert Maynard
98290782b6 cmake: redesign command-line argument parsing
Make handling more consistent:

   "-S" -> invalid
   "-S/path/to/source" -> valid
   "-S /path/to/source" -> valid
   "-S=/path/to/source" -> now valid

   "-D" -> invalid
   "-DStr" -> valid
   "-D Str" -> valid
   "-D=Str" -> now valid

   "--log-level=" -> invalid
   "--log-level" -> invalid
   "--log-level=2" -> valid
   "--log-level 2" -> now valid
2020-11-19 08:53:58 -05:00
Brad King
d800c26ce9 cmake: Fix processing of -Wno-error= flags
Fix two bugs that happened to cancel each other out for cases covered
by our test suite.  Add a test case that distinguishes them.
2020-11-17 13:22:52 -05:00
Vitaly Stakhovsky
f6e7d5f3a0 Reduce the scope of temporary cmProp variables and other improvements 2020-11-05 11:07:39 -05:00