summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
Commit message (Collapse)AuthorAgeFilesLines
* genex: Fix erroneous handling of recursion for $<GENEX_EVAL:>Marc Chevrier2019-02-131-2/+2
| | | | Fixes: #18894
* clang-tidy: Silence use-equals-default warningRegina Pfeifer2019-01-301-1/+1
| | | | | | clang-tidy 7 has an option to suppress this warning in macros which defaults to '1'. Set the option to '0' and silence the warning explicitly.
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-47/+49
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* Fortran: Add compiler ID/Version generator expressionsAndrew Paprocki2019-01-181-0/+46
| | | | | | | | | | | | Adds `Fortran_COMPILER_ID` and `Fortran_COMPILER_VERSION` generator expression support to match equivalent `C_COMPILER_ID`, `CXX_COMPILER_ID`, `C_COMPILER_VERSION`, and `CXX_COMPILER_VERSION` support. This is very helpful in the case where the C/C++ compiler suite is a different type of compiler from the platform Fortran compiler and projects use generator expressions to assign compiler flags and definitions. (e.g. `GNU` C/C++ and `SunPro` Fortran on Linux)
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-5/+6
| | | | Reduce the number of files relying on `cmake.h`.
* clang-tidy: Simplify boolean expressionsRegina Pfeifer2019-01-151-1/+1
|
* Genex: Add policy to handle empty list items in $<IN_LIST:...>Kyle Edwards2018-11-191-5/+30
| | | | | | | | | | The old behavior of $<IN_LIST:...> is inconsistent with that of if(IN_LIST), in that it does not find an empty search item even if the list contains empty items. This change adds a new policy to correctly handle empty items and make the behavior more consistent with if(IN_LIST). Fixes: #18556
* INTERFACE_POSITION_INDEPENDENT_CODE: add generator expressions supportMarc Chevrier2018-11-081-1/+2
| | | | Fixes: #16532
* Merge topic 'getsafedef-stdstring'Brad King2018-09-181-14/+16
|\ | | | | | | | | | | | | 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-14/+16
| |
* | Make internal TARGET_PROPERTY generator expressions more robustBrad King2018-09-121-1/+3
|/ | | | | | | | | | | | | 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.
* Fix transitive usage requirements through same-name imported targetsBrad King2018-09-101-7/+6
| | | | | | | | | | If two imported targets in different directories have the same name we should still be able to propagate transitive usage requirements from both. Fix the DAG checker to work with target pointers instead of target names since the pointers will not be duplicated even if the names are. Fixes: #18345
* Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-1/+1
| | | | Use the new IsOn(),IsOff() overloads.
* Remove unnecessary c_str() in RegularExpression::find callsVitaly Stakhovsky2018-08-071-1/+1
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-8/+11
| | | | | | | | | | | | 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.
* Genex: Allow COMPILE_LANGUAGE to name a language that is not loadedHenry Schreiner2018-05-031-9/+0
| | | | | | | | Evaluate to false on `$<COMPILE_LANGUAGE:Lang>` if language `Lang` is not loaded. This is helpful in exported targets consumed in other projects that may not enable all the same languages. Fixes: #17952
* Genex: Add $<TARGET_GENEX_EVAL:...> and $<GENEX_EVAL:...>Marc Chevrier2018-04-231-1/+112
| | | | Fixes: #17884
* cmGeneratorTarget: Make import library checks config-awareMichael Stürmer2018-04-051-1/+2
|
* genex: Add TARGET_NAME_IF_EXISTS expressionAlex Turbov2018-03-281-0/+35
| | | | | Define `$<TARGET_NAME_IF_EXISTS:tgt>` to mean `tgt` if the target exists and otherwise an empty string.
* genex: Add TARGET_EXISTS to check for target existenceAlex Turbov2018-03-091-0/+32
| | | | | Define `$<TARGET_EXISTS:a>` to `1` if `a` is an existed target name, else `0`.
* Genex: Add IN_LIST logical operatorMarc Chevrier2018-02-071-0/+26
| | | | Implements #17679
* Merge topic 'std-string-apis'Brad King2018-02-011-2/+1
|\ | | | | | | | | | | | | 653b8946 Reduce raw string pointers usage. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1729
| * Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-2/+1
| | | | | | | | | | | | | | | | | | | | * 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.
* | cmGeneratorExpressionNode: avoid some strlen in $<TARGET_PROPERTY>Ben Boeckel2018-01-311-1/+2
|/
* Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and XcodeBrad King2018-01-121-28/+9
| | | | | | | | | | | | | | | The set of compile flags used for a target's C and C++ sources is based on the linker language. By default this is always the C++ flags if any C++ sources appear in the target, and otherwise the C flags. Therefore we can define the `COMPILE_LANGUAGE` generator expression in `INCLUDE_DIRECTORIES` to match the selected language. This is not exactly the same as for other generators, but is the best VS and Xcode can do. It is also sufficient for many use cases since the set of include directories for C and C++ is frequently similar but may be distinct from those for other languages like CUDA. Fixes: #17435
* Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and XcodeBrad King2018-01-121-6/+6
| | | | | | | | | | | | | | | The set of compile flags used for a target's C and C++ sources is based on the linker language. By default this is always the C++ flags if any C++ sources appear in the target, and otherwise the C flags. Therefore we can define the `COMPILE_LANGUAGE` generator expression in `COMPILE_DEFINITIONS` to match the selected language. This is not exactly the same as for other generators, but is the best VS and Xcode can do. It is also sufficient for many use cases since the set of definitions for C and C++ is frequently similar but may be distinct from those for other languages like CUDA. Issue: #17435
* Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual StudioBrad King2017-11-201-3/+2
| | | | | | | | | | | | | | | | | | | Since commit v3.9.0-rc4~3^2~1 (VS: Fix target_compile_options for CUDA, 2017-06-21), the evaluation of `COMPILE_LANGUAGE` receives the proper language. The set of compile flags used for a target's C and C++ sources is based on the linker language. By default this is always the C++ flags if any C++ sources appear in the target, and otherwise the C flags. Therefore we can define the `COMPILE_LANGUAGE` generator expression in `COMPILE_OPTIONS` to match the selected language. This is not exactly the same as for other generators, but is the best VS can do. It is also sufficient for many use cases since the set of allowed flags for C and C++ is almost the same in Visual Studio. Furthermore, since the VS generator moves many of the flags to declarative `.vcxproj` elements, it will automatically avoid passing C++ flags for C sources. Issue: #17435
* Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual StudioBrad King2017-11-171-6/+10
| | | | Issue: #17435
* Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with XcodeBrad King2017-11-171-2/+2
| | | | | | | When rejecting the `COMPILE_LANGUAGE` generator expression on include directories and compile definitions with Xcode, add `file(GENERATE)` to the allowed set in the message. It is allowed and already covered by the `RunCMake.File_Generate` test `COMPILE_LANGUAGE-genex` case.
* 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.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-2/+2
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-212/+212
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-24/+18
| | | | | | 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-2/+2
|
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-9/+8
|
* cmGeneratorExpressionNode: add some missing commasBen Boeckel2017-08-031-1/+1
|
* Provide and use CM_FALLTHROUGHDaniel Pfeifer2017-06-031-0/+2
|
* Replace boolean `implib` parameters with enumGregor Jasny2017-04-201-2/+6
| | | | | Named enumeration values are much clearer at call sites and add more type safety.
* Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-181-16/+27
| | | | | | | | Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
* Genex: Allow TARGET_OBJECTS to be used everywhereRobert Maynard2017-04-181-7/+25
| | | | | | | | | Previously the `TARGET_OBJECTS` generator expression was limited only to use in a buildsystem context so that Xcode's placeholders in object file paths can be evaluated. Lift this restriction so that the expression can at least be used in most settings. Co-Author: Brad King <brad.king@kitware.com>
* Genex: Reject TARGET_OBJECTS on non-object libraries earlierBrad King2017-04-181-9/+8
| | | | | | | | Move the diagnostic that rejects the TARGET_OBJECTS generator expression in non-buildsystem context until after the check for whether the named target is an object library. This order will makes more sense than the previous order once TARGET_OBJECTS is allowed in non-buildsystem context.
* cmGeneratorTarget: Factor out a GetTargetObjectNames methodBrad King2017-04-181-29/+11
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-3/+3
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* cmMakefile: Create an explicit "Object Libraries" source groupBrad King2017-04-111-5/+5
| | | | | The generators should not need special logic to place object library object files in this group.
* Genex: Add `TARGET_BUNDLE_[CONTENT_]_DIR` generator expressionsGregor Jasny2017-03-301-0/+61
| | | | Closes #16733
* Genex: Add `IF` generator expressionColby Pike2017-01-261-0/+22
| | | | | | | | This allows a single condition to be used to choose between two alternatives. Without this the condition must be duplicated with one surrounded by `NOT`. Closes: #15585
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-2/+2
|
* Merge topic 'clang-tidy'Brad King2016-10-201-2/+2
|\ | | | | | | | | | | effa6c83 fix more issues reported by clang-tidy fb461cac silence selected clang-tidy violations
| * silence selected clang-tidy violationsDaniel Pfeifer2016-10-181-2/+2
| |