Commit Graph

258 Commits

Author SHA1 Message Date
Orkun Tokdemir
f2f21c5752 Improve Const Correctness 2023-05-26 14:15:24 +02:00
Orkun Tokdemir
775c369420 Autogen: set SKIP_LINTING ON for generated files
Fixes: #19772
2023-05-16 10:56:25 -04:00
Brad King
28dd02c3ba Merge topic 'autogen-system-include'
7bf4e30090 Autogen: Default AUTOGEN_USE_SYSTEM_INCLUDE to ON if it is not set
033dc7ee2f Autogen: Add AUTOGEN_USE_SYSTEM_INCLUDE target property
8ba16db163 Tests/RunCMake: Add option for dynamic expected output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8400
2023-05-04 09:01:08 -04:00
Orkun Tokdemir
7bf4e30090 Autogen: Default AUTOGEN_USE_SYSTEM_INCLUDE to ON if it is not set
Add policy CMP0151 to preserve the old behavior by default.
2023-05-03 09:03:46 -04:00
Orkun Tokdemir
033dc7ee2f Autogen: Add AUTOGEN_USE_SYSTEM_INCLUDE target property
`AUTOGEN_USE_SYSTEM_INCLUDE` was added. `AUTOGEN_USE_SYSTEM_INCLUDE`
is a boolean property that can be set on a target to indicate that the
autogen target include directory should be added as a system include
directory or normal include directory to the target.
2023-05-03 09:03:46 -04:00
Marc Chevrier
241304190f CMake code rely on cmList class for CMake lists management (part. 2) 2023-04-29 09:54:31 +02:00
Marc Chevrier
87fe031a07 cmList class: various enhancements 2023-04-29 09:54:22 +02:00
Marc Chevrier
e08ba229ee CMake code rely on cmList class for CMake lists management (part. 1) 2023-04-24 10:41:10 +02:00
Orkun Tokdemir
c5c3aff1f5
Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target property
Add this target property to specify macro names that propagate to
dependents as `AUTOMOC_MACRO_NAMES`.  The dependents will automatically
generate MOC files for source files that contain the inherited macro
names.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
Fixes: #19679
2023-04-09 20:51:15 +10:00
Orkun Tokdemir
429a452705 Autogen: Add target's C++ standard to moc_predef.h
Generate `moc_predef.h` using the same C++ standard level that will be
used to compile the target so that the compiler's predefined macros can
be more accurately recovered.

Fixes: #24624
Qt-Issue: https://bugreports.qt.io/browse/QTBUG-110847
2023-03-30 06:41:51 -04:00
Orkun Tokdemir
a42ecb1614 Autogen: Restore AUTOGEN_PARALLEL support for numbers
Refactoring in commit d867e05892 (Autogen: Use JSON instead of CMake
script for info files, 2019-09-20, v3.16.0-rc1~57^2) broke support for
numerical values of `AUTOGEN_PARALLEL`.  Parse and verify the range.
Warn if the value is invalid.

Fixes: #20376
2023-03-20 12:10:01 -04:00
Kyle Edwards
480b363724 cmCustomCommand: Refactor custom command-specific policy values
Many custom commands are created by CMake itself rather than by
the user. These custom commands should always have their policies
set to NEW, and user-created custom commands should have their
policy values set only from the state snapshot. In addition, we
want to genericize the mechanism of recording a policy at the time
of custom command creation.

Add a CM_FOR_EACH_CUSTOM_COMMAND_POLICY macro to genericize
custom command policies. Use this to define all custom command
policies. Make all such policies NEW instead of WARN by default.
Remove individual policy modifier methods and add a single method
that records relevant values from a cmStateSnapshot. Remove the
no longer needed explicit policy settings from synthesized custom
commands.
2023-02-06 15:04:16 -05:00
Rose
6d15754814 Make vector operations more efficient 2022-12-10 12:48:09 -05:00
Kyle Edwards
09d7f947d6 cmGeneratorExpression: Require cmake instance 2022-11-11 12:29:41 -05:00
Cristian Adam
681714ce20 AUTOMOC: Skip PCH when all sources files skip the PCH file too
Fixes: #23464
2022-10-06 22:12:22 +02:00
Brad King
ef6a4240ba cmQtAutoGenInitializer: Drop unnecessary argument in AppendProperty call
Prepare to add another optional argument.
2022-08-22 12:24:40 -04:00
Brad King
778aaf6fdc AUTOUIC: Revert "Fix internal paths of generated ui_foo.h files"
Revert commit 10668f26c9 (AUTOUIC: Fix internal paths of generated
ui_foo.h files, 2022-05-21, v3.24.0-rc3~20^2).  It broke some existing
projects that use more than one `.ui` file of the same name.

Fixes: #23759
Issue: #23523
2022-07-22 11:48:40 -04:00
Brad King
18c0ff66b2 Merge topic 'fix-23523' into release-3.24
10668f26c9 AUTOUIC: Fix internal paths of generated ui_foo.h files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7419
2022-06-29 08:43:27 -04:00
Josiah Bills
10668f26c9 AUTOUIC: Fix internal paths of generated ui_foo.h files
For every file foo.ui we generate a ui_foo.h file in
${target}_autogen/include or ${target}_autogen/include_$<CONFIG> in the
multi-config case.  Even .ui files in subdirectories are handled this
way.  That means, .ui files with the same base name will conflict in a
target.

However, for .ui files in subdirectories we added generated sources with
the nonexistent path ${target}_autogen/include/subdir/ui_foo.h.  This
patch fixes that.

Also, CMake will now yield an error if a target has multiple .ui files
with the same base name.

Fixes #23523
2022-06-28 17:26:28 +02:00
Joerg Bornemann
76608c60d3 AutoMoc: Take AUTOMOC_BUILD_DIR into account in depfile
For the Ninja generator and targets that have AUTOMOC_BUILD_DIR set, the
AutoMoc target was always out of date.

That was because the depfile in the AutoMoc build directory was
referencing the wrong timestamp file:
    target_autogen/timestamp: ...dependencies...
instead of
    automoc_build_dir/timestamp: ...dependencies...

Use the relative path of the timestamp file as rule name for the
depfile.  That path is calculated with AUTOMOC_BUILD_DIR taken into
account.

Fixes: #23547
2022-05-25 13:04:01 +02:00
Brad King
73337cb383 LINK_LIBRARIES: Evaluate separately for linking and usage requirements
We evaluate `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` for two purposes:

* Constructing the link line.
* Collecting usage requirements.

We evaluate `INTERFACE_LINK_LIBRARIES` separately for each purpose in
order to support the `$<LINK_ONLY:...>` generator expression used to
express private link dependencies of a static library.  Previously we
only evaluated `LINK_LIBRARIES` for linking, and used that result for
collecting usage requirements too.  Therefore `$<LINK_ONLY:...>` does
not work in `LINK_LIBRARIES`.

With the introduction of `INTERFACE_LINK_LIBRARIES_DIRECT`, evaluation
of `LINK_LIBRARIES` now needs to distinguish these two cases in order to
honor link dependencies encountered through `$<LINK_ONLY:...>` without
also exposing other usage requirements through private dependencies of a
static library.  Revise internal infrastructure to distinguish the two
cases when evaluating `LINK_LIBRARIES`.  Make the information available
in code paths for `INTERFACE_LINK_LIBRARIES_DIRECT` and `LINK_ONLY`.
Defer actually using the information to later commits.

Issue: #22496
2022-03-22 11:57:48 -04:00
NAKAMURA Takumi
780341f360 cmCustomCommand: Track main dependency explicitly
Store the main dependency as the first entry in the dependency list plus
a boolean member indicating its existence.  Note that this slightly
changes existing behavior: the main dependency was previously the last
entry of the dependency list.
2021-12-14 10:48:43 -05:00
Joerg Bornemann
1e550ad02d AutoMoc: Only add the WIN32 define if the target system is Windows
When there's no moc_predefs.h generated, we add the WIN32 define as
fallback.

Before this change, we added the WIN32 define if the host system was
Windows.  That's wrong when cross-compiling.  Now we're checking whether
the target system is Windows.

Fixes: #22933
2021-11-19 17:56:19 +01:00
NAKAMURA Takumi
c46b041a3b cmLocalGenerator: Simplify Add{Custom,Utility}Command 2021-11-18 12:02:38 -05:00
NAKAMURA Takumi
9b31a97748 cmCustomCommand: Move constructor arguments to individual setters
Make `cmCustomCommand` have just only default constructor.
Use each setter instead.  This follows the builder pattern.

Introduce `cc::SetOutputs(std::string output)`.
This will be used later, as substitution for `cc::SetOutputs({output})`.
2021-11-18 12:02:37 -05:00
Brad King
a21d5455c0 Merge topic 'autogen-dep-on-imported-implib-only-target'
895fa3433f cmQtAutoGenInitializer: support IMPLIB-only imported targets
354c1f5628 Tests/RunCMake/Autogen: test CMP0111 behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6558
2021-09-27 13:48:57 -04:00
Ben Boeckel
895fa3433f cmQtAutoGenInitializer: support IMPLIB-only imported targets
Instead of using the target name directly (which ends up in the `Ninja`
generators querying for the `LOCATION` parameter), wrap up the target
name in a `$<TARGET_LINKER_FILE:>` to avoid the query for the unset
property.
2021-09-24 11:29:54 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Brad King
ed9abd9977 Merge topic 'mocmacrosonce'
8ff0c2b1dd AutoMoc: Do not list moc macros multiple times
6e2f4029c0 cmAlgorithms: Preserve const-ness in cmRemoveDuplicates range signature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6459
2021-09-09 14:02:52 -04:00
David Redondo
8ff0c2b1dd AutoMoc: Do not list moc macros multiple times
When working on a project with a nested dependency tree, a macro
can be added multiple times. For example in a project I am working
on, in the warning "includes the moc file [... ] but does not contain
a [...] macro" the macro list contains 127 entries but only 25 unique
ones.
2021-09-03 09:41:12 -04: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
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
Brad King
98d813b92c Merge topic 'autouic-header-depends' into release-3.21
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:51 -04:00
Joerg Bornemann
4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp
For an AUTOMOC'ed target foo, when depfiles are used, there are the
following dependencies:

foo_autogen -> foo_autogen/timestamp
foo_autogen/mocs_compilation.cpp -> foo_autogen/timestamp

The first is used to trigger AUTOGEN.
The second erroneously triggers a recompilation of
mocs_compilation.cpp when any source file of target foo is touched.

Remove the latter dependency and replace it with an order-only
dependency from foo_autogen/mocs_compilation.cpp to
foo_autogen_timestamp_deps.

That is achieved by making mocs_compilation.cpp or its
per-configuration variants byproduct(s) of the timestamp file.

Fixes: #22338
2021-07-23 15:47:28 +02: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
Joerg Bornemann
af11ea8d0c AutoGen: Fix needless compilation of mocs_compilation.cpp
For an AUTOMOC'ed target foo, when depfiles are used, there are the
following dependencies:

foo_autogen -> foo_autogen/timestamp
foo_autogen/mocs_compilation.cpp -> foo_autogen/timestamp

The first is used to trigger AUTOGEN.
The second erroneously triggers a recompilation of
mocs_compilation.cpp when any source file of target foo is touched.

Remove the latter dependency and replace it with an order-only
dependency from foo_autogen/mocs_compilation.cpp to
foo_autogen_timestamp_deps.

That is achieved by making mocs_compilation.cpp or its
per-configuration variants byproduct(s) of the timestamp file.

Fixes: #22338
2021-07-01 15:31:02 +02:00
Vitaly Stakhovsky
ce97b7909b Source: Remove unnecessary comparisons to nullptr 2021-05-10 11:44:53 -04:00
Joerg Bornemann
5b0ea5874a AutoGen: Retrieve Qt version from moc as fallback
Consider the case where the find_package call for QtCore is wrapped in a
function call. Then AutoGen cannot determine the Qt version, because it
only looks at variables and directory properties. The former don't leave
the function scope and the latter are not set by default.

As a fallback, locate the moc executable via its target and call it with
the --version argument to determine the Qt version.

Issue: #22028
2021-04-23 10:49:07 +02:00
Duncan Barber
a8d879cf45 Autogen: Add detection of UI file changes to the pre-build VS case
This is achieved by adding a rule file which carries the UI files as dependencies but performs no meaningful command. Its output path points to a timestamp file which is instead touched by the pre-build command that runs autogen. The rule file therefore triggers the build if any of the files have been changed more recently than the last autogen run.

Fixes: #17959
Fixes: #18741
2021-04-10 18:40:22 +01:00
Duncan Barber
1876f2d03f Autogen: Move duplicated filename generation code into a function 2021-04-10 18:33:24 +01:00
Duncan Barber
087b717aef Autogen: Move duplicated executable dependency code into a function 2021-04-10 18:33:23 +01:00
Duncan Barber
0656bebeae Autogen: Rename the variable for UI files with UIC options
Monitoring for UI file changes in the target sources will require keeping track of the files without options as well so this will improve clarity.
2021-04-10 18:33:22 +01:00
Duncan Barber
e8ddc1e268 Autogen: Fix a bug in setting the UIC source group
If the relative path to a UI file was empty then the source group for the corresponding autogen header file would not apply because of a double slash in the path.
2021-04-04 12:29:59 +01:00
Brad King
f14e19c053 Merge topic 'ninja-automoc-cycle'
ca7c76269b Tests: Add test for Ninja automoc dependency cyle
54ad3e4958 autogen: Don't include SKIP_AUTOMOC files in depfile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jörg Bornemann <joerg.bornemann@qt.io>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !5956
2021-03-30 09:54:09 -04:00
Kyle Edwards
54ad3e4958 autogen: Don't include SKIP_AUTOMOC files in depfile
SKIP_AUTOMOC files should not be included in moc processing, which
means they shouldn't be included in the depfile either. Remove them.

Fixes: #21977
2021-03-29 15:17:11 -04:00
Brad King
b4a103bdec Merge topic 'autouic-headers-ninja'
1265c65b33 AUTOUIC: Collect ui header files for Ninja generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5803
2021-02-24 09:49:03 -05:00
Brad King
261ba00668 Merge topic 'autogen-cmp0116-fix' into release-3.20
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
2021-02-24 09:44:59 -05:00
Brad King
ab3485d15b Merge topic 'autogen-cmp0116-fix'
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
2021-02-24 09:44:59 -05:00
Kyle Edwards
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation 2021-02-23 09:14:31 -05:00
Alexey Edelev
1265c65b33 AUTOUIC: Collect ui header files for Ninja generator
The '<user target>_autogen/timestamp' target supposed to
generate ui header files using the 'uic'. Ninja must have
information about these header files as a result of generating.

The fix collects .ui files of the user target and generates
a list of the ui headers that need to be added to the generating
results of the '<user target>_autogen/timestamp' target.

The case when the .ui files are not specified and collected by
AUTOUIC from the include directives of the project source files
is not covered in this patch.

Fixes: #16776
2021-02-23 13:46:40 +01:00
Craig Scott
a3df25c694 Autogen: Don't change the order of HEADERS array in AutogenInfo.json
Qt6 reads our internal AutogenInfo.json file. In 92d7b456e5
(Autogen: Add support for per-config sources, 2020-10-20), the
ordering of the HEADERS array elements was changed and this
broke their cmake_automoc_parser. We don't need to change the
order of the array elements, we can append to the existing ones
instead. Do this to allow their cmake_automoc_parser to continue
to work.

Fixes: #21823
2021-02-22 16:11:26 +11:00
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Brad King
92d7b456e5 Autogen: Add support for per-config sources
Fixes: #20682
2020-12-16 14:04:30 -05:00
Kyle Edwards
1080935732 AutoGen: Account for CMP0116 in the depfile
Fixes: #21467
2020-12-08 14:51:36 -05:00
Deniz Bahadir
6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW
* Adding implementation for policy CMP0118 being set to `NEW`.
* Adding new tests for policy CMP0118 being set to `NEW`.
* Checking the `GENERATED` property with `get_source_file_property` or
  `get_property` now always returns exactly `1` or `0`. No other values
  will be returned. Note, that this is a backwards-incompatible change,
  even when policy CMP0118 is unset or set to `OLD`.
* Additionally, as `get_source_file_property` and `get_property` now
  always check if a source-file was marked globally visible, even when
  CMP0118 is unset or set to `OLD`, they possibly return `1` where they
  might have returned `0` before the changes introduced by this commit.
  Note, that this is a backwards-incompatible change, even when policy
  CMP0118 is unset or set to `OLD`.
* As a consequence, the tests for policy CMP0118 being unset or set to
  `OLD` got slightly adjusted, too, to reflect these changes in
  behavior.
2020-11-24 18:16:51 +01:00
Vitaly Stakhovsky
c7b50349de cmSourceFile::GetPropertyForUser: return cmProp
also fix GetSafeProperty() return type
2020-11-04 10:11:54 -05:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Brad King
94964b60a0 Merge topic 'automoc-depend-project-file'
776059ef0f Merge branch 'backport-3.17-automoc-depend-project-file'
6b20bbd2dd AutoMoc: Restore support for re-running after project file changes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5166
2020-09-01 09:09:30 -04:00
Brad King
776059ef0f Merge branch 'backport-3.17-automoc-depend-project-file' 2020-08-31 13:10:31 -04:00
Joerg Bornemann
6b20bbd2dd AutoMoc: Restore support for re-running after project file changes
For Qt >= 5.15.0 and Ninja generators AutoMoc creates a depfile to let
Ninja decide when to run AutoMoc.  This was introduced by commit aebfbcaa46
(AutoGen: Use depfiles for the XXX_autogen ninja targets, 2020-01-14,
v3.17.0-rc1~58^2).

However, AutoMoc was not triggered after adding a new moc-able file to
the project. This patch adds the project file (and potentially included
files) to the dependencies in the depfile.

Now, a re-run of AutoMoc is triggered if the project file changes.

Fixes: #21127
2020-08-31 13:07:23 -04:00
Brad King
979a5bd4d1 Merge topic 'automoc_timestamp_nmc_fix'
a48bb185c3 AutoGen: Fix moc and uic dependencies when building Qt itself

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5153
2020-08-25 13:58:28 -04:00
Alexandru Croitor
a48bb185c3 AutoGen: Fix moc and uic dependencies when building Qt itself
When building Qt itself, the moc and uic executables are spcecified
via a generator expression of the form $<TARGET_FILE:Qt6::moc>,
which ends populating Moc's and Uic's 'Executable' field but not the
ExecutableTarget and ExecutableTargetName fields.

In such a scenario, the code in
cmQtAutoGenInitializer::InitAutogenTarget fails to add a dependency
on moc (or uic), because ExecutableTarget is null. First try to add
a dependency on the ExecutableTarget if it's not empty, otherwise try
to add a dependency on the path specified in the 'Executable' field.

Issue: #21118
2020-08-25 12:29:23 -04:00
Brad King
030aa9dc30 Merge topic 'automoc_timestamp_deps'
9a9ed4b9d3 Merge branch 'backport-3.17-automoc_timestamp_deps'
7445c9a58a AutoGen: Add test to check for correct AutoMoc dependencies
a79056bb02 AutoGen: Fix over-specified direct dependencies of custom command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Aleix <aleixpol@kde.org>
Merge-request: !5085
2020-08-06 10:31:23 -04:00
Brad King
9a9ed4b9d3 Merge branch 'backport-3.17-automoc_timestamp_deps' 2020-08-05 15:42:39 -04:00
Alexandru Croitor
a79056bb02 AutoGen: Fix over-specified direct dependencies of custom command
The AutoMoc timestamp creating custom command explicitly depended
on all dependencies of the origin target (associated to the AutoGen
target).

When an origin target depended on a shared library 'libfoo.so',
if it was re-linked, the AutoMoc custom command would touch its
output timestamp file, and thus cause needless rebuilding of sources,
despite the shared library not having any influence on the AutoMoc
generated files.

Introduce a new '<target>_autogen_timestamp_deps' utility target,
which will serve as an 'order-only' dependency for the custom command.

This will prevent needless rebuilding, because touching 'libfoo.so'
will not cause the custom command to be re-executed.

The new AutoMoc dependency tree looks like:
    '_autogen_timestamp_deps (serves as order-only dep)'
 <- '<target_autogen>/timestamp' file ( + moc deps file)
 <- '<target>_autogen' target.

Fixes: #21020
2020-08-03 19:38:11 +02:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Kyle Edwards
63ecf481da Merge topic 'cmnonempty'
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5017
2020-07-15 10:53:43 -04:00
Vitaly Stakhovsky
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string 2020-07-14 15:18:59 -04:00
Vitaly Stakhovsky
7156911242 cmIsOn: add overload accepting const std::string* 2020-07-14 08:22:24 -04:00
Robert Maynard
7a969fe21d cmMakefile: Refactor API to better handle empty config values 2020-07-03 07:43:18 -04:00
Robert Maynard
7628153edb Refactor file extension queries to be more consistent
It was very easy to forgot to check against all language file
extensions. This updates the internal API to have a unified API.
2020-06-22 09:13:16 -04:00
Brad King
a432b1075c Merge topic 'getdef-expand'
7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4819
2020-06-02 08:02:24 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Vitaly Stakhovsky
7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector
Combines cmMakefile:GetDefinition() and cmExpandList()
2020-05-30 08:59:20 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Vitaly Stakhovsky
53675adbcf GetSafeProperty: return std::string const& 2020-04-30 10:27:16 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Justin Goshi
bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding
Adds a flag to indicate that pipe output from a custom command should be
interpreted as UTF-8 encoded. This change does not introduce a public
way to set the flag, but generators that create internally-generated
commands know if they are calling cmake, which uses UTF-8 pipes.

MSBuild added support for interpreting output of PreBuildEvent,
PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change
will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need
to add the StdOutEncoding tag. MSBuild treats these as property bags so
if we emit the tag for earlier versions of Visual Studio it would be
safely ignored. This change emits the StdOutEncoding tag and sets it to
UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes
globalization issues when the output from cmake contained characters
that required MSBuild to interpret as UTF-8 before displaying them.
2020-04-13 12:54:47 -07:00
Vitaly Stakhovsky
aba23c747b cmMakefile::GetProperty: return cmProp 2020-04-01 10:56:34 -04:00
Vitaly Stakhovsky
c84cf42897 cmState::GetGlobalProperty: return cmProp 2020-03-25 09:10:46 -04:00
Kyle Edwards
7abc3d61ac Ninja Multi-Config: Fix issue with framework dependencies and Autogen
Fixes: #20345
2020-02-17 08:24:57 -05:00
Alexandru Croitor
7c664bb5b9 Fix AUTOMOC deps file to contain correct rule name
The rule name should include the current binary path relative to
the top level binary path.

Fixes: #20298
2020-02-01 00:35:53 +01:00
Brad King
89a3d33d11 Merge topic 'automoc-using-depfiles'
aebfbcaa46 AutoGen: Use depfiles for the XXX_autogen ninja targets
f765fdea03 AutoGen: Use moc's feature to output dependencies
f8c505d4b3 Add a parser for GCC-style depfiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jan Niklas Hasse <jhasse@bixense.com>
Merge-request: !4221
2020-01-30 09:52:33 -05:00
Joerg Bornemann
aebfbcaa46 AutoGen: Use depfiles for the XXX_autogen ninja targets
The XXX_autogen targets are implemented as utility commands, which
means they always run, even if there weren't any changes.

For the Ninja generator and Qt >= 5.15 we're taking a different
approach: This commit adds custom commands that create
XXX_autogen/timestamp files. Those custom commands have a depfile
assigned that is generated from the depfiles that were created by moc.

The XXX_autogen targets merely wrap the XXX_autogen/timestamp custom
commands.

Fixes: #18749
2020-01-28 11:16:11 -05:00
Joerg Bornemann
f765fdea03 AutoGen: Use moc's feature to output dependencies
In Qt version 5.15.0 moc learned to output the dependencies
of the generated file.

This commit enhances JobCompileMocT to read the dependency file
written by moc. The dependencies are stored in the same cache that's
used for the dependencies determined by dependency filters.

The dependency filter functionality is turned off if moc's dependency
output feature is used.

Fixes: #17750
Fixes: #19058
2020-01-28 11:16:11 -05:00
Marc Chevrier
8f839d02e3 cm::String: enhance compatibility with STL 2020-01-25 18:16:16 +01:00
Brad King
6a5a23ea92 Merge topic 'autogen_rcc_skip_unity'
086d9b2bab Autogen: Enable SKIP_UNITY_BUILD_INCLUSION on AUTORCC generated files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !4237
2020-01-20 11:54:13 -05:00
Sebastian Holtermann
086d9b2bab Autogen: Enable SKIP_UNITY_BUILD_INCLUSION on AUTORCC generated files
`rcc` generated files are not compatible with unity builds, because they
contain classes in anonymous namespaces and static data with identical names.

This patch sets the source file property `SKIP_UNITY_BUILD_INCLUSION` to `On`
on all `AUTORCC` generated files to exclude them from unity build files.

Fixes: #20191 "QT5: Exclude resource files from unity build"
2020-01-17 09:48:35 -05:00
Marc Chevrier
f466cea3c9 cmMakefile: modernize memory management 2020-01-14 11:03:07 +01:00
Sebastian Holtermann
abad139c99 Autogen: Process .hh headers based on new policy CMP0100 settings
Reintroduces .hh header processing in AUTOMOC and AUTOUIC based on the new
policy CMP0100 setting.

Fixes: #13904 CMAKE_AUTOMOC misses headers with ".hh" extension
2020-01-04 11:33:04 +01:00
Sebastian Holtermann
4db1463e05 Autogen: Try adding header suffix to moc output file name on name conflicts
In AUTOGEN, this changes the moc output file name computation on output name
conflicts to first try to add the header suffix to the moc output base name.
When that still conflicts, we try adding a range of sequential numbers.
If we still can't find an unique output name, we raise an error.
2020-01-04 11:32:14 +01:00
Brad King
a3455779fb Merge topic 'autogen-no-hh'
7fa7f55230 Autogen: Revert processing of .hh files for compatibility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4146
2019-12-19 09:52:34 -05:00
Brad King
7fa7f55230 Autogen: Revert processing of .hh files for compatibility
Since commit 4a9154537c (Autogen: Use cmake::IsHeader/SourceExtension
for file type detection, 2019-07-02, v3.16.0-rc1~470^2~4) we process
`.hh` files with `AUTOMOC`.  However, this change can break existing
projects that do not expect the behavior.  Revert it for now.  It can
be restored later via a policy.

Fixes: #20101
2019-12-18 05:34:27 -05:00
Brad King
64e2891cbd Merge topic 'stdstring-target'
c34b4497f8 cmTarget: add std::string overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4137
2019-12-17 11:09:20 -05:00
Vitaly Stakhovsky
c34b4497f8 cmTarget: add std::string overloads 2019-12-14 09:30:28 -05:00
Kyle Edwards
5a8a9f7229 Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
2019-12-13 10:51:46 -05:00
Daniel Eiband
777ceaea94 cmMakefile: Delay custom command creation
Move custom command creation to cmLocalGenerator and dispatch custom
commands in cmMakefile to generate time.  Generators add custom commands
using the new methods provided by cmLocalGenerator.

Issue: #12877
2019-11-24 20:32:43 +01:00
Daniel Eiband
96e5042e46 cmCustomCommand: Explicitly pass backtrace on construction 2019-11-24 20:13:23 +01:00
Marc Chevrier
f93385283f cmLocalGenerator: modernize memory management 2019-11-11 16:41:13 +01:00