summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add the ALIAS target concept for libraries and executables.Stephen Kelly2013-08-021-0/+12
| | | | | | | | | | | | | | | | | * The ALIAS name must match a validity regex. * Executables and libraries may be aliased. * An ALIAS acts immutable. It can not be used as the lhs of target_link_libraries or other commands. * An ALIAS can be used with add_custom_command, add_custom_target, and add_test in the same way regular targets can. * The target of an ALIAS can be retrieved with the ALIASED_TARGET target property. * An ALIAS does not appear in the generated buildsystem. It is kept separate from cmMakefile::Targets for that reason. * A target may have multiple aliases. * An ALIAS target may not itself have an alias. * An IMPORTED target may not have an alias. * An ALIAS may not be exported or imported.
* Genex: Disallow LINKER_LANGUAGE only when used on a static library.Stephen Kelly2013-07-261-2/+3
| | | | | For shared libraries and executables, the linker_language is indepenedent of the linked libraries.
* Merge topic 'fix-mapped-config-genex'Brad King2013-07-241-2/+18
|\ | | | | | | | | 10a069b Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
| * Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.Stephen Kelly2013-07-241-2/+18
| | | | | | | | | | | | | | | | The old code checked only that there was a LOCATION for the specified config, but did not check whether the config actually mapped. Task-number: 14292
* | Remove the LINK_LANGUAGE generator expression.Stephen Kelly2013-07-241-65/+13
| | | | | | | | | | | | | | | | | | | | | | It accepted an optional argument to test for equality, but no way to get the linker language of a particular target. TARGET_PROPERTY provides this flexibility and STREQUAL provides the necessary API for equality test. Extend the CompileDefinitions test to cover accessing the property of another target.
* | Merge topic 'tid-system-argument'Brad King2013-07-161-0/+4
|\ \ | |/ |/| | | | | | | | | | | | | | | 9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. 1925cff Add a SYSTEM parameter to target_include_directories (#14180) 286f227 Extend the cmTargetPropCommandBase interface property handling. 83498d4 Store system include directories in the cmTarget. f1fcbe3 Add Target API to determine if an include is a system include. 2679a34 Remove unused variable.
| * Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.Stephen Kelly2013-07-161-0/+4
| | | | | | | | | | | | | | | | Unlike other target properties, this does not have a corresponding non-INTERFACE variant. This allows propagation of system attribute on include directories from link dependents.
* | Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICYStephen Kelly2013-07-111-15/+21
| | | | | | | | | | | | Use preprocessor loops and add a unit test for the appropriate policies. All policies whose value is recorded at target creation time should be part of this list.
* | Introduce the LINK_ONLY generator expression.Stephen Kelly2013-07-071-0/+20
| | | | | | | | | | This is an internal expression for use by target_link_libraries for static libraries.
* | GenexEval: Add abstracted access to link interface for a target.Stephen Kelly2013-07-071-5/+6
|/ | | | | | This can be extended with special handling for static libraries so that we can process the link dependencies separately from the usage dependencies.
* Add generator expressions for compiler versions.Stephen Kelly2013-06-281-0/+100
| | | | | New generator expressions allow retrieval of the version per language, as well as equality comparison.
* Merge topic 'dag-LINKER_LANGUAGE'Brad King2013-06-261-2/+17
|\ | | | | | | | | | | | | | | ff015ee Genex: Report error if a target file is needed to evaluate link libraries. b58aff9 Genex: Extend EvaluatingLinkLibraries to also check the top target name. b1c19ce Genex: Make LINK_LANGUAGE report an error when evaluating link libraries. 0e1cb07 Add missing return after error report.
| * Genex: Report error if a target file is needed to evaluate link libraries.Stephen Kelly2013-06-241-1/+8
| | | | | | | | | | | | | | | | Constructs such as target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,foo.so>:bar>) segfault before this patch.
| * Genex: Make LINK_LANGUAGE report an error when evaluating link libraries.Stephen Kelly2013-06-241-1/+8
| |
| * Add missing return after error report.Stephen Kelly2013-06-241-0/+1
| |
* | Merge topic 'version-compare-genex'Brad King2013-06-261-0/+60
|\ \ | |/ |/| | | | | | | e605528 Add generator expressions for version comparision. 48bb48e De-duplicate version comparison code.
| * Add generator expressions for version comparision.Stephen Kelly2013-06-121-0/+60
| |
* | Merge topic 'transitive-property-PP-FOR_EACH'Brad King2013-06-241-9/+15
|\ \ | | | | | | | | | | | | 0d8db25 Use a preprocessor loop to manage the valid transitive properties.
| * | Use a preprocessor loop to manage the valid transitive properties.Stephen Kelly2013-06-101-9/+15
| |/ | | | | | | | | Hopefully this will prevent regressions when adding further transitive properties in the future.
* | Style: Don't put an else after a return.Stephen Kelly2013-06-111-3/+0
|/
* Merge topic 'fix-genex-HEAD-target'Brad King2013-06-051-4/+9
|\ | | | | | | | | 5b22235 Genex: Fix the HEAD target used for evaluated expressions
| * Genex: Fix the HEAD target used for evaluated expressionsStephen Kelly2013-06-051-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the expression $<TARGET_PROPERTY:prop> appears in the content of a target property, the target that prop is read from is the 'head target' of the expression. In contexts such as evaluating the content of a target property during generation, such as INCLUDE_DIRECTORIES, the 'head target' is the one on which the initial request was made. If evaluating a generator expression which is not a target property content, the target must be explicitly specified. Such contexts include add_custom_command and file(GENERATE). The content might then look like $<TARGET_PROPERTY:tgt,prop> However, as there is no HeadTarget set, any generator expressions evaluated as part of reading prop from tgt which do not specify the tgt directly report an error. Modify the logic of the TARGET_PROPERTY generator expression so that in such contexts, the 'head target' is set to the appropriate target which was first encountered.
* | Add COMPILE_OPTIONS target property.Stephen Kelly2013-06-021-1/+8
| | | | | | | | | | | | This method reads generator expressions from the COMPILE_OPTIONS target property, as well as INTERFACE_COMPILE_OPTIONS from linked dependents.
* | Add <LANG>_COMPILER_ID generator expressions.Stephen Kelly2013-06-021-0/+102
| | | | | | | | | | | | These expressions evaluate to the id of the compiler used to build the target, or can be used to test if the compiler id matches a specified value.
* | Merge topic 'fix-INCLUDE_DIRECTORIES-genex-read'Brad King2013-05-311-37/+77
|\ \ | |/ | | | | | | | | | | 3aa9ce4 GenexEval: Fix evaluation of INCLUDE_DIRECTORIES target property. 0b39fef GenexEval: Extract a getLinkedTargetsContent from TargetPropertyNode. 53164ac cmTarget: Remove some hardcoding of transitive property names.
| * GenexEval: Fix evaluation of INCLUDE_DIRECTORIES target property.Stephen Kelly2013-05-301-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This property should come from the content of the property itself, plus the INTERFACE_INCLUDE_DIRECTORIES of the link *implementation*. In contrast, when the INTERFACE_INCLUDE_DIRECTORIES is evaluated for a target, the INTERFACE_INCLUDE_DIRECTORIES of the link *interface* is used. Similar logic applies for the COMPILE_DEFINITIONS target properties. If the propertyName is already an INTERFACE_ variant of the property, ie, the expression is similar to $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES> then the INTERFACE_INCLUDE_DIRECTORIES of the link *interface* of foo is used. However, if the propertyName is not an INTERFACE_ variant, and the interfacePropertyName is, ie, the expression is similar to: $<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES> then the INTERFACE_INCLUDE_DIRECTORIES of the link *implementation* of foo is used.
| * GenexEval: Extract a getLinkedTargetsContent from TargetPropertyNode.Stephen Kelly2013-05-301-35/+46
| | | | | | | | | | | | | | | | | | | | This will be used to process transitive components of properties which depend on linked targets. Currently only the link interface of the target can be used as the source of the linked targets, but in the next commit it will be possible to use the link implementation as the source of link targets. This commit does not change the semantics of the code.
| * cmTarget: Remove some hardcoding of transitive property names.Stephen Kelly2013-05-301-2/+17
| |
* | Merge topic 'language-generator-expressions'Brad King2013-05-241-5/+67
|\ \ | | | | | | | | | | | | 3241014 Add $<LINK_LANGUAGE> generator expression
| * | Add $<LINK_LANGUAGE> generator expressionStephen Kelly2013-05-241-5/+67
| | | | | | | | | | | | | | | | | | They can't be used when evaluating link libraries, but they can be used for include directories and compile definitions. Later they can be used for compile options.
* | | Merge topic 'join-genex'Brad King2013-05-221-48/+106
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | a7ba452 Add the JOIN generator expression. 96ec314 Make it possible for any genex to have arbitrary content at the end. bd638ee Rename the method determining if a genex accepts arbitrary content. dc742fe Extract the ProcessArbitraryContent method.
| * | Add the JOIN generator expression.Stephen Kelly2013-05-161-0/+30
| | | | | | | | | | | | | | | | | | This generator expression joins a list with a separator. The separator may contain arbitrary content, such as commas, which is ordinarily a delimiter in the generator expression syntax.
| * | Make it possible for any genex to have arbitrary content at the end.Stephen Kelly2013-05-161-1/+14
| | |
| * | Rename the method determining if a genex accepts arbitrary content.Stephen Kelly2013-05-161-6/+8
| | | | | | | | | | | | | | | The meaning of this will be expanded to generator expressions with more than a single parameter.
| * | Extract the ProcessArbitraryContent method.Stephen Kelly2013-05-161-41/+54
| | |
* | | Merge topic 'fix-genex-comma-parse'Brad King2013-05-211-5/+4
|\ \ \ | |/ / | | | | | | | | | 05bf972 Fix handling of commas in arbitrary content in genexes.
| * | Fix handling of commas in arbitrary content in genexes.Stephen Kelly2013-05-161-5/+4
| |/ | | | | | | | | As the comma is the parameter separator, it needs to be re-added when evaluating to reconstruct arbitrary content.
* | Remove unused typedef.Stephen Kelly2013-05-171-1/+0
|/
* Add $<SEMICOLON> generator expression.Jean-Christophe Fillion-Robin2013-03-121-0/+18
| | | | | This expression is useful to put a ';' in a command line argument without dividing the argument during CMake list expansion.
* Merge topic 'remove-TARGET_DEFINED-genex'Brad King2013-03-041-18/+0
|\ | | | | | | | | | | | | | | cbf0756 Revert "Add the TARGET_DEFINED generator expression" 21a342c Remove use of TARGET_DEFINED from the target_link_libraries test. 47b8d32 Remove use of TARGET_DEFINED from the ExportImport test. 2e39d21 Remove use of TARGET_DEFINED from target_include_directories test.
| * Revert "Add the TARGET_DEFINED generator expression"Stephen Kelly2013-02-251-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2bee6f5ba5b3f33817cc00e056a7df60d05c9399. This expression is not used, and has a semantic which is not completely optimal (namely considering utility targets to be targets, though usually we are interested in linkable targets). Remove it so that we have more freedom to define better expressions in the future. Conflicts: Source/cmGeneratorExpressionEvaluator.cxx Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt Tests/CMakeCommands/target_compile_definitions/consumer.cpp
* | Merge topic 'interface-property-external-read'Brad King2013-02-251-36/+61
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 8dfdf1c Fix the tests for evaluating includes and defines. 98a6725 Fix constness of accessors. 7e70744 Expand includes and defines transitively in 'external' genexes. d1a2729 Fix DAG checker finding cycling dependencies. e72eaad Workaround broken code where a target has itself in its link iface. ec2c67b Strip stray semicolons when evaluating generator expressions.
| * | Expand includes and defines transitively in 'external' genexes.Stephen Kelly2013-02-231-36/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means that we can use expressions of the form $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES> to get a list of the interface include directories of foo, including those coming from dependencies. We can't have a test of a target which has a single include directory in its INCLUDE_DIRECTORIES because the shell on the MSYS platforms transforms a single include directory to include a prefix, which is not what the test expects. We test a target with two directories instead as a means to test a target with no link dependencies.
| * | Workaround broken code where a target has itself in its link iface.Stephen Kelly2013-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | | There is a test for this since commit 8e756d2b (Tolerate cycles in shared library link interfaces (#12647), 2012-01-12), so make sure it continues to pass, even as we require no self-references in new INTERFACE_ property generator expressions.
| * | Strip stray semicolons when evaluating generator expressions.Stephen Kelly2013-02-181-0/+3
| |/
* | Keep track of all targets seen while evaluating a genex.Stephen Kelly2013-02-221-1/+3
|/ | | | | As dependencies of the generator expression, these will re-exported in try_compile generated code.
* Revert "Add the $<LINKED:...> generator expression."Stephen Kelly2013-02-131-94/+0
| | | | | | | | | This reverts commit 0b92602b816e2584db3781b120a1e5200da72ada. Conflicts: Source/cmGeneratorExpressionEvaluator.cxx Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt Tests/CMakeCommands/target_include_directories/CMakeLists.txt
* Revert "Don't allow utility or global targets in the LINKED expression."Stephen Kelly2013-02-131-8/+0
| | | | This reverts commit 9712362b4580fb92394ecf8ff57be186571f4319.
* Use the link information as a source of compile definitions and includes.Stephen Kelly2013-02-131-6/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After evaluating the INTERFACE_INCLUDE_DIRECTORIES, of a target in a generator expression, also read the INTERFACE_INCLUDE_DIRECTORIES of its link interface dependencies. That means that code such as this will result in the 'user' target using /bar/include and /foo/include: add_library(foo ...) target_include_directories(foo INTERFACE /foo/include) add_library(bar ...) target_include_directories(bar INTERFACE /bar/include) target_link_libraries(bar LINK_PUBLIC foo) add_executable(user ...) target_include_directories(user PRIVATE $<TARGET_PROPERTY:bar,INTERFACE_INCLUDE_DIRECTORIES>) Also process the interface include directories from direct link dependencies for in-build targets. The situation is similar for the INTERFACE_COMPILE_DEFINITIONS. The include directories related code is currently more complex because we also need to store a backtrace at configure-time for the purpose of debugging includes. The compile definitions related code will use the same pattern in the future. This is not a change in behavior, as existing code has the same effect, but that existing code will be removed in follow-up commits.
* Don't allow utility or global targets in the LINKED expression.Stephen Kelly2013-02-081-0/+8
| | | | | | The LINKED expression is exclusively for handling INTERFACE content and it does not make sense for utility targets to have INTERFACE content.