summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add generator APIs to get build settings with backtracesBrad King2018-10-181-34/+91
| | | | | | In cmGeneratorTarget and cmLocalGenerator we offer several APIs to get build settings like include directories, compile definitions, source files, etc. Add corresponding APIs that include backtrace information.
* cmLocalGenerator: Make MoveSystemIncludesToEnd file-localBrad King2018-10-181-5/+6
|
* cmGeneratorTarget::GetExportMacro: return const std::string*Vitaly Stakhovsky2018-10-161-2/+2
|
* Merge topic 'remove-AddCompileDefinitions'Brad King2018-10-111-11/+3
|\ | | | | | | | | | | | | 8f076acdb0 cmLocalGenerator: Remove AddCompileDefinitions method Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2470
| * cmLocalGenerator: Remove AddCompileDefinitions methodBrad King2018-10-101-11/+3
| | | | | | | | | | | | | | This method offers the same definitions as `GetTargetDefines` except that it excludes the "export" macro on shared libraries. Update call sites to use `GetTargetDefines` instead. Some of them were incorrectly excluding the export macro.
* | add_subdirectory: Run subdirectory install rules in correct orderKyle Edwards2018-10-101-16/+47
|/ | | | | | | | | 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.
* Restore possibly regressed CMP0018 logicBrad King2018-09-191-1/+1
| | | | | | 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.
* cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-6/+6
|
* Merge topic 'replace-os-x-name-with-macos'Brad King2018-09-111-1/+1
|\ | | | | | | | | | | | | | | | | | | ab2e35d614 Replace occurrences of "Mac OS X" with "macOS" in comments fc1602456a Help: Replace occurrences of "Mac OS X" with "macOS" Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Gregor Jasny <gjasny@googlemail.com> Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Merge-request: !2351
| * Replace occurrences of "Mac OS X" with "macOS" in commentsBartosz Kosiorek2018-09-101-1/+1
| | | | | | | | | | | | | | | | Apple's main Operating system changed their name from OS X to macOS: https://www.engadget.com/2016/06/13/os-x-is-now-macos/ Revise source comments accordingly.
* | Merge topic 'grd-stdstring'Brad King2018-09-061-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 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-1/+1
| |/ | | | | | | | | | | | | 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.
* Merge topic 'lg-directory'Brad King2018-08-281-4/+4
|\ | | | | | | | | | | | | 50fbfee3a0 cmLocalGenerator: return directories as const std::string& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2309
| * cmLocalGenerator: return directories as const std::string&Vitaly Stakhovsky2018-08-271-4/+4
| |
* | static library: add property STATIC_LIBRARY_OPTIONSMarc Chevrier2018-08-151-1/+7
|/ | | | issue: #18251
* cmStateDirectory: use const std::string& for return valuesVitaly Stakhovsky2018-08-121-2/+2
|
* Merge topic 'cleanup-find-cstr'Brad King2018-08-091-1/+1
|\ | | | | | | | | | | | | 69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2271
| * Remove unnecessary c_str() in RegularExpression::find callsVitaly Stakhovsky2018-08-071-1/+1
| |
* | cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-2/+2
|/ | | | | | | | | | | | | | | 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
* cmLocalGenerator: Respect user requested implicit include directories orderSebastian Holtermann2018-07-301-8/+7
| | | | | | | In ``cmLocalGenerator::GetIncludeDirectories`` append the user requested implicit include directories first, then append the remaining implicit include directories. By By doing so we keep the user requested order of implicit include directories.
* cmLocalGenerator: Extend the functionality of ``GetIncludeDirectories()``Sebastian Holtermann2018-07-251-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What ``cmLocalGenerator::GetIncludeDirectories`` does ----------------------------------------------------- In general it concatenates the 1. ``target->GetIncludeDirectories(LANG)`` and the 2. ``CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES``. Additionally it performs some sorting and special treatment of the - ``CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES``. By default all ``CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`` are stripped from the result list. When explicitly requested (by setting ``stripImplicitInclDirs=false``) *some* implicit directories are appended to the result list. The implicit directories that *are* appended are those that were requested to be included by 1. ``target->GetIncludeDirectories(LANG)`` or 2. ``CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES``. All other implicit directories are still stripped from the result list. The reason to not simply append all implicit directories is that Qt4's moc has problems to parse some headers that might be found in the implicit system include directories (See commit d2536579d51e77827b8e55f39123316324314781 and [QTBUG-28045](https://bugreports.qt.io/browse/QTBUG-28045) ). That has been solved in Qt5's moc though. Extension request to ``cmLocalGenerator::GetIncludeDirectories`` ---------------------------------------------------------------- For Qt5's moc we like to have an option that allows to append *all* implict include directories to the result list, not just those that were user requested. Changes to ``cmLocalGenerator::GetIncludeDirectories`` ------------------------------------------------------ - Shorten the function parameter name ``stripImplicitInclDirs`` to ``stripImplicitDirs``. - Add new boolean function parameter ``appendAllImplicitDirs`` with a default value ``false``. The old default behavior of the function stays the same, but a specialized behavior can be requested by AUTOMOC for Qt4/Qt5 respectively.
* cmLocalGenerator: Style changes: Private local variable renamesSebastian Holtermann2018-07-251-8/+8
| | | | | | Code style change in ``cmLocalGenerator::GetIncludeDirectories``. Rename a variable to reflect its purpose a little bit better.
* cmLocalGenerator: Style change: Wrap temporary strings and code in bracesSebastian Holtermann2018-07-251-14/+17
| | | | | | | Code style change in ``cmLocalGenerator::GetIncludeDirectories``. Embrace ``{}`` temporary strings and code that uses them to minimize their lifetime.
* cmLocalGenerator: Style change: Wrap temporary strings and code in bracesSebastian Holtermann2018-07-251-21/+24
| | | | | | | Code style change in ``cmLocalGenerator::GetIncludeDirectories``. Embrace ``{}`` temporary strings and code that uses them to minimize their lifetime.
* cmLocalGenerator: Style change: Use return value of std::set::insertSebastian Holtermann2018-07-251-23/+16
| | | | | | | Code style change in ``cmLocalGenerator::GetIncludeDirectories()``. Use the return value of ``std::set::insert`` instead of testing if the entry already exists in the set using ``std::find``.
* LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-0/+8
| | | | | | | | | | | | | | 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-6/+7
| | | | | | | | | | | | 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.
* Order SYSTEM include directories after non-system directoriesEphi Sinowitz2018-04-231-1/+22
| | | | | | | An effect of the `-isystem` flag is to search the directory after those specified via `-I` flags. Make behavior more consistent on compilers that do not have any `-isystem` flag by explicitly moving system include directories to the end.
* Merge topic 'features-c++20'Brad King2018-04-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 8570dc7f64 Help: Update compiler versions in cmake-compile-features.7.rst 874d3d2948 Help: Add release note for C++ 20 support 7f295b1bd3 Features: Activate C++ 20 support for Clang 5.0+ 71cb8ce3a1 Features: Activate C++ 20 support for GNU 8.0+ 8f146c4508 Features: Activate C++ 20 support for MSVC 19.12.25835+ 7fe580a362 Features: Add infrastructure for C++ 20 language standard 1b328e09a3 Features: Use -std=c++17 for C++ 17 on Clang 5.0+ 0bc3e5788a Features: Use -std=c++17 for C++ 17 on GNU 8.0+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1892
| * Features: Add infrastructure for C++ 20 language standardBrad King2018-03-271-0/+1
| | | | | | | | Issue: #17849
* | Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF"Brad King2018-03-261-7/+4
|/ | | | | | | | | | | | | Revert commit v3.8.0-rc1~305^2 (Remove CTestTestfile.cmake when BUILD_TESTING is OFF, 2016-11-14) again. We reverted it once in commit v3.8.0-rc3~22^2 (Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF", 2017-03-06) but it was accidentally restored by commit v3.11.0-rc1~387^2 (server: add "ctestInfo" request to get test info, 2017-10-25), perhaps due to conflict resolution during rebase. We cannot remove `CTestTestfile.cmake` when testing is off because it breaks projects that never enable testing but create their own `CTestTestfile.cmake` manually instead. Revert the change again and add a test case.
* Genex: Fix COMPILE_LANGUAGE in SYSTEM include directoriesBrad King2018-03-121-2/+2
| | | | | | | | | When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating `INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the compile language through to the generator expression evaluator so that it can support `$<COMPILE_LANGUAGE:...>`. Fixes: #17811
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-14/+14
| | | | | | | | | | * 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.
* cmLocalGenerator: change ImportedGeneratorTargets from vector to mapFrank Winklmeier2018-01-301-23/+5
| | | | | | | | For large number of targets significant amount of time is spent in cmLocalGenerator::FindGeneratorTargetToUse, which uses find_if on a vector to locate the given target. Using a map instead of vector for ImportedGeneratorTargets (as done for cmMakefile::ImportedTargets) provides a significant speedup (up to factor of 2).
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-5/+5
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* sourceFile properties: add property INCLUDE_DIRECTORIESMarc Chevrier2018-01-241-0/+48
|
* LocalGenerator: refactoringMarc Chevrier2018-01-231-15/+44
| | | | | Introduce method AppendCompileOptions to support future source file property COMPILE_OPTIONS.
* CMake: enable setting default dir creation permissionsDomen Vrankar2017-11-081-0/+14
| | | | | | | | | Introduces CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS variable which enables the user to specify the default permissions for directory creation. This setting is then used to auto set the permissions on directories which are implicitly created by install() and file(INSTALL) commands such as CMAKE_INSTALL_PREFIX directories.
* Merge topic 'server-test-info'Brad King2017-11-071-4/+7
|\ | | | | | | | | | | | | 35a52bd1 server: add "ctestInfo" request to get test info Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1414
| * server: add "ctestInfo" request to get test infoJustin Goshi2017-11-031-4/+7
| |
* | Replace cmArray{Begin,End,Size} by their standard counterpartsMatthias Maennich2017-10-231-2/+2
|/ | | | | | | | | | | std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14 and an standard compliant implementation has been introduced within the 'cm' namespace: cm::{cbegin,cend}. std::size is only part of C++17, hence exposing a compliant implementation within namespace cm (cm::size). where possible, the standard implementations are reused.
* Replace empty-string comparisons with checking against `empty()`.Pavel Solodovnikov2017-09-211-2/+2
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-145/+105
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-10/+10
|
* Performance: Add an index to Change cmLocalGenerator::GeneratorTargets.Aaron Orenstein2017-08-161-13/+14
| | | | | | | | | | | Add an index to Change cmLocalGenerator::GeneratorTargets for faster lookup by name. Also changed a bunch of uses of cmLocalGenerator::GetGeneratorTargets() to take const references instead of copying the vector. Represent generator targets as a map (name -> target) to make name lookups more efficient instead of looping through the entire vector to find the desired one.
* Allow language extensions without any standard to use a list of optionsBrad King2017-07-141-1/+5
| | | | | | | Fix the logic added by commit a2112257 (Add infrastructure to use language extensions without any standard, 2017-06-29) to support a list of options as has been done since commit v3.9.0-rc1~174^2~2 (CompileFeatures: Let STD compile options be a list, 2016-10-05).
* Merge branch 'backport-fix-lang-std-option-list' into fix-lang-std-option-listBrad King2017-07-141-2/+10
|\
| * Features: Fix support for a list of language standard optionsBrad King2017-07-141-2/+10
| | | | | | | | | | | | The change in commit v3.9.0-rc1~174^2~2 (CompileFeatures: Let STD compile options be a list, 2016-10-05) did not change all the places we add the language standard options. Expand the list in the other places.