792 Commits

Author SHA1 Message Date
Brad King
c7428e1729 Merge topic 'read-list-file'
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2821
2019-01-21 07:57:33 -05:00
Brad King
4dba5d6ce2 Merge topic 'use-emplace'
ef61997b1b clang-tidy: Use emplace
2e5307a2a4 CTestSVN: Accept std::string in SVNInfo constructor

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2811
2019-01-21 07:51:54 -05:00
Regina Pfeifer
ef61997b1b clang-tidy: Use emplace 2019-01-17 13:12:02 -05:00
Vitaly Stakhovsky
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument
Same for cmMakefile::ReadDependentFile(); some cleanup
2019-01-17 12:36:07 -05:00
Fred Baksik
0c9e47d7cd GHS: Integrity Application updates
-- Check the property "ghs_integrity_app" on executables to set [INTEGRITY Application]
   If the property is not set then check if an integrate file is one of the source files (.int file).
   Dynamic Downloads that do not have an integrate file can use this property along with setting
   the compiler flag "-dynamic".

-- Remove parsing for -dynamic flag; it is only used to print a comment
   The MULTI GUI will show if it is a Monolith or Dynamic Download application

-- Use project references to specify which executables are part of the Integrity Application
   Usually Implicit Dependency Analysis will ensure that executable targets
   become part of the application.  This does not work for Dynamic Download without integrate files.
   Use `add_dependencies(dd vas)` to mark that the vas target is part of dd target.

-- Update file locations in the Integrate files.
2019-01-16 10:41:49 -05:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Craig Scott
6f904d0100 Merge topic 'nmake-compile-commands'
37c6a02dc2 CMake: fix nmake compile_commands generation
7583f7490e cmGlobalGenerator: Teach EscapeJSON to escape newlines and tabs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2648
2019-01-07 15:26:55 -05:00
Yan Pashkovsky
7583f7490e cmGlobalGenerator: Teach EscapeJSON to escape newlines and tabs 2018-12-14 18:23:20 +03:00
Brad King
b83fe27d8d fileapi: Report cmake generator in reply index file 2018-12-12 06:40:10 -05:00
Regina Pfeifer
3e60580784 clang-tidy: Fix readability-static-accessed-through-instance
Enable the check in .clang-tidy and fix all warnings.
2018-11-22 00:11:37 +01:00
Sebastian Holtermann
3327d3bb20 Autogen: Add cmQtAutoGenGlobalInitializer class
This moves the global ``AUTOMOC/UIC/RCC`` targets initializer
generation code into a separate new ``cmQtAutoGenGlobalInitializer`` class.
2018-11-11 09:35:28 +01:00
Cengizhan Pasaoglu
c67ab22cdc Using front() and back() instead of calculations 2018-11-06 21:43:33 +03:00
Brad King
ec9ef691fe Merge topic 'provide_explicit_source_and_build_command_line_options'
638f00117a Add release note for the -S and -B options.
de962cc00d CMake: Internally uses -S instead of -H to specify source directory
a10d63d578 cmake: -S and -B can be used to specify source and build directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2358
2018-09-19 10:38:19 -04:00
Brad King
76a19eb6c1 Merge topic 'fix-getsafedef-stdstring'
2428422c02 Fix regression in target output file naming logic
d686f81e58 Restore possibly regressed CMP0018 logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2402
2018-09-19 10:33:01 -04:00
Brad King
d686f81e58 Restore possibly regressed CMP0018 logic
Refactoring in commit f4ff60a803 (cmMakefile: Make GetSafeDefinition
return std::string const&, 2018-09-05) changed the treatment of the
empty string in CMP0018 diagnostic logic.  Restore the behavior.
2018-09-19 07:42:08 -04:00
Brad King
a8f628c0a4 Merge topic 'getsafedef-stdstring'
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2350
2018-09-18 11:18:00 -04:00
Vitaly Stakhovsky
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& 2018-09-18 11:16:46 -04:00
Robert Maynard
de962cc00d CMake: Internally uses -S instead of -H to specify source directory 2018-09-15 11:25:47 -04:00
Brad King
333804fa0e Merge topic 'out-of-dir-linking'
a1ad0a699b target_link_libraries: Allow use with targets in other directories
9bbae5ae28 cmTarget: Future-proof AddLinkLibrary target lookup scope
f9cb6f618a cmExportFileGenerator: Use cmGeneratorTarget::ResolveTargetReference
18441a6269 cmGeneratorTarget: Factor target name resolution out of link item resolution
2f708f5d65 Make internal TARGET_PROPERTY generator expressions more robust
94a75801c8 Android.mk: De-duplicate link libraries logic during export
8a63b23d16 cmGlobalGenerator: Remove unused FindLocalGenerator method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Patrick Stotko <stotko@cs.uni-bonn.de>
Merge-request: !2370
2018-09-14 13:25:07 -04:00
Brad King
a1ad0a699b 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.

Targets named on the RHS will need to be looked up during generation in
the scope of the call site rather than the scope of the LHS target.
Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties
to specify target names that need to be looked up in a directory other
than that containing the target on which the property is set.  Add
minimal documentation of the syntax to help users that encounter it.

Unfortunately CMake previously did allow such calls in the case that
only `INTERFACE` libraries are specified, but those libraries would be
looked up in the target's directory rather than the caller's.  Add
policy `CMP0079` to enable the new behavior with new lookup scope in a
compatible way.

Fixes: #17943
2018-09-12 13:06:36 -04:00
Brad King
2f708f5d65 Make internal TARGET_PROPERTY generator expressions more robust
While collecting usage requirements from the `INTERFACE_*` properties of
directly linked targets, we internally generate `TARGET_PROPERTY:` and
`TARGET_OBJECTS:` generator expressions to refer to those properties on
those targets.  At the point we generate these expressions we already
have a pointer to an exact `cmGeneratorTarget` instance.

Switch from using the target name in these generator expressions to
using an internal unique name generated for each `cmGeneratorTarget`
instance to be referenced.  This avoids depending on the user-facing
target name to find the same target we already have.
2018-09-12 12:46:25 -04:00
Brad King
8a63b23d16 cmGlobalGenerator: Remove unused FindLocalGenerator method
This method has not been used since commit v3.4.0-rc1~234^2~1
(cmGlobalGenerator: Port Find API to cmMakefile, 2015-08-02).
2018-09-11 08:21:22 -04:00
Vitaly Stakhovsky
13d10ee616 cmState::GetInitializedCacheValue: Return as const std::string* 2018-09-10 09:31:48 -04:00
Brad King
e1ebec55d4 Merge topic 'grd-stdstring'
4d89830d71 cmMakefile: Make GetRequiredDefinition return std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2347
2018-09-06 09:54:56 -04:00
Vitaly Stakhovsky
4d89830d71 cmMakefile: Make GetRequiredDefinition return std::string
In all cases the return value is converted to std::string anyway.

Also remove unnecessary `c_str()` calls in arguments to
`GetRequiredDefinition`.
2018-09-05 15:15:55 -04:00
Vitaly Stakhovsky
6f16be6a62 Remove unnecessary c_str() calls
Use the new IsOn(),IsOff() overloads.
2018-09-05 15:12:57 -04:00
Vitaly Stakhovsky
4e94f6447a cmGlobalGenerator::AddInstallComponent(): Accept std::string argument 2018-08-30 11:52:45 -04:00
Vitaly Stakhovsky
c8fd23ec6f cmMakefile: return directories as const std::string& 2018-08-27 14:07:43 -04:00
Sebastian Holtermann
3aa11f31fc Autogen: Use integers to store the Qt version 2018-08-13 18:12:47 +02:00
Sebastian Holtermann
b6802cd506 cmGeneratedFileStream: clang-tidy applied to remove redundant `c_str` calls
After changing the ``cmGeneratedFileStream`` methods to accept
``std::string const&`` instead of ``const char*`` we don't
need to call ``std::string::c_str`` anymore when passing
a ``std::string`` to a ``cmGeneratedFileStream`` method.

This patch removes all redundant ``std::string::c_str``
calls when passing a string to a ``cmGeneratedFileStream`` method.

It was generated by building CMake with clang-tidy enabled using
the following options:

-DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
2018-08-07 17:02:39 +02:00
Sebastian Holtermann
87e7904c91 Autogen: Use a single AUTOGEN setup function in cmGlobalGenerator
By moving all AUTOGEN setup code in ``cmGlobalGenerator``
into a single ``cmGlobalGenerator::QtAutoGen`` function, the
``cmGlobalGenerator::Compute`` function becomes cleaner.
2018-08-03 12:55:50 +02:00
Brad King
cfa6b14f9c cmGlobalGenerator: Avoid -Wstringop-truncation warning
Use `memcpy` instead of `strncpy` to copy bytes into a buffer that
is not intended to be null terminated.
2018-07-31 09:34:55 -04:00
Sebastian Holtermann
c6a8002827 Autogen: Improve error detection during configuration
cmQtAutoGenInitializer::InitCustomTargets and
cmQtAutoGenInitializer::SetupCustomTargets
now return their success value which gets evaluated
and passed on by the caller (cmGlobalGenerator).

Checks for the existance of the moc/uic/rcc
binaries have been introduces in cmQtAutoGenInitializer.
Additionally they get called once with a "-h"
argument to determine if they're functional.
This way any binary-not-found problem is caught
during the configuration phase.
2018-07-11 13:29:49 +02: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
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
3c47ac5b25 OpenWatcom: Add workaround for lack of error on missing library
The OpenWatcom tools do not fail to link when a library is missing if no
symbols were needed from it.  This can break `try_compile` checks.
Teach `cmGlobalGenerator::Build` to pretend that the build tool returned
non-zero if the output contains the corresponding warning.
2018-04-18 08:09:56 -04:00
Craig Scott
e60e4dfc88 cmWorkingDirectory: Check success of current dir changes 2018-03-08 20:07:14 +11:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03:00
Brad King
92cd3d0677 Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1698
2018-01-29 08:05:27 -05:00
Pavel Solodovnikov
c85bb007df Reduce allocation of temporary values on heap.
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
2018-01-26 13:24:45 +03:00
Wouter Klouwen
e6a80ccfc4 Make use of std::chrono throughout every component
This commit continues the changes made in CTest to support std::chrono
by
applying it throughout every component where a duration was used.

No functional change intended.
2018-01-23 18:56:42 +00:00
Sebastian Holtermann
9cfa213aa6 Autogen: Rename cmQtAutogeneratorInitializer to cmQtAutoGenInitializer 2018-01-17 17:23:49 +01:00
Gregor Jasny
8f4663ffb2 Xcode: rename embedded SDK query function 2017-12-22 21:56:53 +01:00
Sebastian Holtermann
2a85b5ac76 Autogen: Make cmQtAutoGeneratorInitializer an instantiable class
Remove the cmQtAutoGenDigest classes and make
cmQtAutoGeneratorInitializer instantiable instead.
2017-11-19 12:51:31 +01:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Brad King
ae5f40696e CMP0037: Allow test and package targets when features are not enabled
When CMake will not generate a test, package, or package_source target,
allow projects to create their own targets with these names.

Fixes: #16062
2017-10-30 10:21:31 -04:00
Brad King
2d0b3e6ed2 cmGlobalGenerator: Refactor test and package target conditions
In `AddGlobalTarget_{Test,Package,PackageSource}`, check conditions up
front and return early if the targets are not needed.  This reduces the
indentation of the main logic.
2017-10-26 14:09:38 -04:00
Brad King
6a8c765c8f Merge topic 'cm-array-begins-size'
57132765 Replace cmArray{Begin,End,Size} by their standard counterparts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1352
2017-10-26 08:57:04 -04:00
Brad King
b5dd256d94 Merge topic 'defer-target-source-check'
4e7f6738 Defer check for sources within a target until generation.
6e4e7c65 Tests: Exclude bad RunCMake.add_executable case on multi-arch Xcode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1242
2017-10-25 08:11:19 -04:00
Deniz Bahadir
4e7f67383f Defer check for sources within a target until generation.
The `add_library` and `add_executable` commands can now be called with
no source-files and won't generate a warning or error message, as long
as source-files will be added later via the `target_sources` command.
If during the generation step still no sources are associated with
targets created by such calls a useful error message will be generated
and generation fails.

Targets of type `INTERFACE_LIBRARY`, `UTILITY` or `GLOBAL_TARGET` are
excluded from this check because we do not need sources for these target
types during generation.

Fixes: #16872
2017-10-24 08:14:47 -04:00