summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
Commit message (Collapse)AuthorAgeFilesLines
* CMP0053: Fix double warning on uninitialized variables in -P modeR2RT2018-11-051-1/+1
| | | | | | | | When `CMP0053` is not set to OLD or NEW then we compute both variants in case we need to warn about a behavior change. Do not allow both code paths to produce an uninitialized variable warning. Fixes: #18552
* cmMakefile: Rename SuppressWatches to SuppressSideEffectsR2RT2018-11-051-4/+4
|
* add_subdirectory: Run subdirectory install rules in correct orderKyle Edwards2018-10-101-0/+4
| | | | | | | | | Before this change, install rules created by add_subdirectory() would be executed after all of the top-level install rules, even if they were declared before the top-level rules. This change adds a new policy, CMP0082, which interleaves the add_subdirectory() install rules with the other install rules so they are run in the correct order.
* link_directories(): enhance capabilitiesMarc Chevrier2018-09-251-2/+9
|
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-15/+16
| | | | | | | | | | | | These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
* Merge topic 'deprecate-policy-old'Craig Scott2018-09-201-1/+1
|\ | | | | | | | | | | | | 0c709cb2a2 Add deprecation warnings for policies CMP0063 and below Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2397
| * Add deprecation warnings for policies CMP0063 and belowBrad King2018-09-171-1/+1
| | | | | | | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for some policies to encourage projects to port away from setting policies to OLD.
* | Merge topic 'getsafedef-stdstring'Brad King2018-09-181-7/+17
|\ \ | |/ |/| | | | | | | | | f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2350
| * cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-7/+17
| |
* | Merge topic 'out-of-dir-linking'Brad King2018-09-141-0/+17
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | 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
| * target_link_libraries: Allow use with targets in other directoriesBrad King2018-09-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cmState::GetInitializedCacheValue: Return as const std::string*Vitaly Stakhovsky2018-09-101-17/+13
|/
* Merge topic 'definitions-get'Brad King2018-09-071-6/+11
|\ | | | | | | | | | | | | 437d0c16c7 cmStateSnapshot::GetDefinition(): Return std::string const* Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2356
| * cmStateSnapshot::GetDefinition(): Return std::string const*Vitaly Stakhovsky2018-09-061-6/+11
| | | | | | | | Expose std::string type used internally in cmDefinitions instead of const char*
* | Merge topic 'grd-stdstring'Brad King2018-09-061-3/+3
|\ \ | | | | | | | | | | | | | | | | | | 4d89830d71 cmMakefile: Make GetRequiredDefinition return std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2347
| * | cmMakefile: Make GetRequiredDefinition return std::stringVitaly Stakhovsky2018-09-051-3/+3
| |/ | | | | | | | | | | | | In all cases the return value is converted to std::string anyway. Also remove unnecessary `c_str()` calls in arguments to `GetRequiredDefinition`.
* | Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-1/+1
|/ | | | Use the new IsOn(),IsOff() overloads.
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-4/+4
|
* cmStateDirectory: use const std::string& for return valuesVitaly Stakhovsky2018-08-121-2/+2
|
* Merge topic 'project-injected-no-cmp0048'Craig Scott2018-07-251-0/+2
|\ | | | | | | | | | | | | | | 6646771b0f project: Do not issue CMP0048 warnings on injected call 08eb157c03 Tests: Add case showing CMP0048 warning on injected project command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2235
| * project: Do not issue CMP0048 warnings on injected callBrad King2018-07-241-0/+2
| | | | | | | | Fixes: #18202
* | LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-0/+15
|/ | | | | | | | | | | | | | 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
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-16/+28
| | | | | | | | | | | | 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.
* Merge topic 'parallel_build_option'Brad King2018-05-291-2/+2
|\ | | | | | | | | | | | | | | 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
| * cmake: Add options for parallel builds to --build modeFlorian Maushart2018-05-251-2/+2
| | | | | | | | | | | | | | 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.
* | Revise implementation of case-insensitive command namesFlorian Jacomme2018-05-221-12/+11
|/ | | | | | | | | | | | | | | | | | | | Store both the as-written and lower-case command names and use the latter to avoid case-insensitive string comparisons. With this I obtain 2-6% speed increase (on Windows) for the configure step with no significant changes in memory usage. A case-insensitive comparison is a lot slower than just calling `==` because the operator will use things like memcmp, so prefer the latter. The `cmSystemTools::LowerCase` function allocates a new string each time it is called, so before this change we were allocating in: * cmMakefile::Configure two times for each function (to look for `cmake_minimum_required` and `project`) * cmMakefile::ExecuteCommand twice by function by calling cmState::GetCommand and copying the name Now we are only allocating once by function instead of four.
* cmMakefile: Convert private helpers to file static functionsVitaly Stakhovsky2018-05-011-30/+30
| | | | | | The two-argument forms of `AddDefineFlag` and `RemoveDefineFlag` need no access to `cmMakefile` class members. They are used only within the implementation file.
* cmMakefile: Improve ExpandVariablesInString return typeVitaly Stakhovsky2018-05-011-4/+5
| | | | | Return `std::string const&` instead of a `const char*` that points into a string anyway. Update call sites accordingly.
* Merge topic 'fix-CMAKE_DISABLE_SOURCE_CHANGES-top-dir'Brad King2018-04-251-1/+2
|\ | | | | | | | | | | | | 60cb75e4a1 Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build tree Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2001
| * Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build treeMarc Chevrier2018-04-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | The change in commit v3.11.0-rc1~480^2 (UseJava: add_jar OUTPUT_DIR option used only for jar generation, 2017-10-12) added code of the form `file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR})`. This exposed an existing bug in `CMAKE_DISABLE_SOURCE_CHANGES` in which it does not recognize that the top of the build tree itself is in the build tree. Fix that now. Fixes: #17933
* | add_compile_definitions: add new commandMarc Chevrier2018-04-201-0/+5
| | | | | | | | | | | | | | This command manages preprocessor definitions at directory level and supports generator expressions. Fixes: #15374
* | cmake_policy: Add undocumented PARENT_SCOPE option to GETBrad King2018-04-181-3/+3
| | | | | | | | | | | | Policies affecting the behavior of CMake-provided macros and functions need to be able to get the policy setting as of the call site rather than the definition site. Add an undocumented option to do this.
* | Merge topic 'variable_watch-on-PARENT_SCOPE'Brad King2018-04-121-0/+9
|\ \ | | | | | | | | | | | | | | | | | | 65198cfd0f variable_watch: trigger on variables set via PARENT_SCOPE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1948
| * | variable_watch: trigger on variables set via PARENT_SCOPEMatteo Settenvini2018-04-111-0/+9
| | | | | | | | | | | | | | | | | | | | | Make sure that we also trigger variable watches when a variable is set in the parent scope. Fixes: #17827
* | | Merge topic 'fix-crash-trace-exp-uninit-vars'Brad King2018-04-101-4/+5
|\ \ \ | |/ / |/| / | |/ | | | | | | aad360eb3d Fix crash with --trace-expand --warn-uninitialized together Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1944
| * Fix crash with --trace-expand --warn-uninitialized togetherR2RT2018-04-091-4/+5
| | | | | | | | | | | | | | | | Some code paths in `ExpandVariablesInString{New,Old}` were not checking the `filename` parameter for a null pointer, but this can happen when using the above flags together. Add the checks and a test case. Fixes: #17896
* | Sanitize paths from LINK_DIRECTORIES directory propertyjrp20142018-04-041-6/+4
| | | | | | | | | | Normally they are sanitized by the `link_directories` command before populating the property, but projects may set the property directly.
* | Features: Add infrastructure for C++ 20 language standardBrad King2018-03-271-6/+17
| | | | | | | | Issue: #17849
* | Merge topic 'policy-version-range'Craig Scott2018-03-221-3/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 45408b5ea1 cmake_minimum_required: Optionally set policies with version range 6a41aa2abd cmPolicies: Split parsing and impl of ApplyPolicyVersion 1d00ed7cf7 cmPolicies: Drop unnecessary check from ApplyPolicyVersion 0df559832b cmPolicies: Pass policy version as std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1864
| * | cmake_minimum_required: Optionally set policies with version rangeBrad King2018-03-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Teach `cmake_minimum_required` and `cmake_policy(VERSION)` to support a version range of the form `<min>[...<max>]`. Define this to mean that version `<min>` is required, but known policies up to those introduced by `<max>` will be set to `NEW`. This will allow projects to easily specify a range of versions for which they have been updated.
| * | cmPolicies: Pass policy version as std::stringBrad King2018-03-161-2/+2
| | |
* | | find_package: Improve CMP0074 warning messagesBrad King2018-03-211-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | Policy `CMP0074` was added by commit eb35d8884b (find_package: Use PackageName_ROOT variables as search prefixes, 2018-03-15). Revise the logic to avoid warning when a `PackageName_ROOT` variable is set to empty since that won't change the search behavior. Also, when we do warn include the variable value(s) for reference.
* | | find_package: Use PackageName_ROOT variables as search prefixesBrad King2018-03-161-0/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature was originally added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and documented by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). However, we had to disable the feature and remove the documentation in commit v3.9.1~2^2 (find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9, 2017-08-08) due to breaking projects that used `PackageName_ROOT` variables themselves. Add policy `CMP0074` to restore the `PackageName_ROOT` variable behavior in a compatible way. Also revise the stack of root paths to store the paths themselves rather than the package names. This way the policy can be considered at the `find_package` call site instead of individual `find_` calls inside a find module. Co-Author: Chuck Atkins <chuck.atkins@kitware.com> Issue: #17144
* | Merge topic 'cmWorkingDirectory_success_checking'Brad King2018-03-091-1/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 5901699672 cmDepends: Remove attempt to change directory that always fails e60e4dfc88 cmWorkingDirectory: Check success of current dir changes e654622aee Tests: Add --build-and-test test case a865f0beb2 Tests: Confirm test working dir set successfully Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1817
| * | cmWorkingDirectory: Check success of current dir changesCraig Scott2018-03-081-1/+9
| | |
* | | cmTarget: Simplify ClearDependencyInformation signatureBrad King2018-03-061-1/+1
|/ / | | | | | | We don't need to pass an argument with the target's own name.
* | cmMakefile: Improve performance of GetSource for known filesFrank Winklmeier2018-02-231-0/+12
| | | | | | | | | | | | | | Store "Known" files separately in KnownFileSearchIndex. This avoids creating the rather expensive cmSourceFileLocation object for source files that are already known. For large projects this results in a factor 3-4 speedup of cmGlobalGenerator::Compute().
* | Tests management: add TESTS directory propertyMarc Chevrier2018-02-081-0/+14
|/ | | | Implements: #17680
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-15/+15
| | | | | | | | | | * 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.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-9/+8
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.