summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add the TARGET_DEFINED generator expressionStephen Kelly2013-01-131-0/+18
| | | | This tests whether the parameter is a usable target.
* Keep track of properties used to determine linker libraries.Stephen Kelly2013-01-081-0/+8
| | | | | Those properties can't later be implicitly defined by the interface of those link libraries.
* Merge topic 'interface-includes-defines'Brad King2013-01-071-5/+106
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 894f52f Handle INTERFACE properties transitively for includes and defines. f5b1980 Populate the ExportedTargets member early in GenerateMainFile c67b812 Make cycles in target properties ignored, not an error. d0f950f Use mapped config properties to evaluate $<CONFIG> 26def17 Make all relevant targets available in the genex context. 0c657dc Add API to populate INTERFACE properties in exported targets. e04f737 Add API to extract target names from a genex string. b0c8f73 Add the TARGET_NAME generator expression. 77475fe Allow generator expressions to require literals. b2f1700 GenEx: Add expressions to specify build- or install-only values
| * Handle INTERFACE properties transitively for includes and defines.Stephen Kelly2013-01-051-1/+29
| | | | | | | | | | Contextually, the behavior is as if the properties content from another target is included in the string and then the result is evaluated.
| * Make cycles in target properties ignored, not an error.Stephen Kelly2013-01-051-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constructs such as these are an error as they are direct self-references: set_property(TARGET foo APPEND PROPERTY INCLUDE_DIRECTORIES $<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES>) set_property(TARGET foo APPEND PROPERTY INCLUDE_DIRECTORIES $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>) However, this is an indirect self-reference in a cycle, and not an error: set_property(TARGET foo APPEND PROPERTY INCLUDE_DIRECTORIES $<TARGET_PROPERTY:bar,INCLUDE_DIRECTORIES>) set_property(TARGET bar APPEND PROPERTY INCLUDE_DIRECTORIES $<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES>)
| * Use mapped config properties to evaluate $<CONFIG>Stephen Kelly2013-01-051-2/+18
| |
| * Make all relevant targets available in the genex context.Stephen Kelly2013-01-051-1/+1
| | | | | | | | | | The current node being evaluated transitively in the generator expression must be available to resolve mapped configs.
| * Add the TARGET_NAME generator expression.Stephen Kelly2013-01-051-0/+24
| | | | | | | | It will be used as a preprocessing marker.
| * Allow generator expressions to require literals.Stephen Kelly2013-01-051-0/+17
| |
| * GenEx: Add expressions to specify build- or install-only valuesStephen Kelly2013-01-051-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for specifying INCLUDE_DIRECTORIES relevant to the build-location or the install location for example: set_property(TARGET foo PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>" "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>" ) A 'bar' target can then use: set_property(TARGET bar PROPERTY INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>" ) and it will work whether foo is in the same project, or an imported target from an installation location, or an imported target from a build location generated by the export() command. Because the generator expressions are only evaluated at build-time, these new expressions are equivalent to the ZeroNode and OneNode. The GeneratorExpression test is split into parts. Some shells can't run the custom command as it is getting too long.
* | Don't crash when a target is expected but is not available.Stephen Kelly2013-01-031-0/+15
|/
* Replace some 'if' with 'else if'Stephen Kelly2012-12-231-4/+4
| | | | For consistency with the rest of the method.
* Merge topic 'generator-expression-fixes'Brad King2012-11-271-3/+34
|\ | | | | | | | | | | | | b581be0 Genex: Don't segfault on $<FOO,> 07749e3 Genex: Ensure that $<0:...> has a parameter. ee96dc7 Genex: Extract a method to parse parameters.
| * Genex: Ensure that $<0:...> has a parameter.Stephen Kelly2012-11-271-0/+16
| |
| * Genex: Extract a method to parse parameters.Stephen Kelly2012-11-261-3/+18
| |
* | Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.Stephen Kelly2012-11-201-2/+2
|/ | | | | | | | | | | Following from the discussion here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3615/focus=5170 (Re: Generator expressisons in target properties, 26 Oct 12:10) we can't split cmTarget API for linking into cmGeneratorTarget. In the future we will probably also need to move the include and compile definitions API back to cmTarget so that it can be used by export().
* GenEx: Use case insensitive comparison for $<CONFIG:...>Stephen Kelly2012-11-051-1/+4
| | | | | This fixes a regression introduced by commit f1eacf0e (cmGeneratorExpression: Re-write for multi-stage evaluation).
* GexEx: Validate Target names and property names differently.Stephen Kelly2012-10-221-6/+11
| | | | | In the unit test, use the same IMPORTED_LOCATION trick that the ExportImport test uses.
* Attempt to fix the compile of cmake on Sun CC.Stephen Kelly2012-10-111-1/+4
| | | | | The problem may be that the reportError method is static, so make it non-static on that platform.
* GenEx: Don't use std::vector::at(int).Stephen Kelly2012-10-091-3/+3
| | | | It might not exist with GCC 2.9.
* GenEx: Ensure that the empty CONFIGURATION can be used conditionally.Stephen Kelly2012-10-091-5/+5
| | | | | The CONFIGURATION can not be manipulated at unit testing time, so this is not unit tested further.
* GenEx: Validate target and property names.Stephen Kelly2012-10-091-1/+46
| | | | They must be non-empty, and match a restrictive regexp.
* GenEx: Report actual target name not found, not "0" each time.Stephen Kelly2012-10-091-2/+3
|
* GenEx: Return after error reported.Stephen Kelly2012-10-091-0/+1
|
* Merge topic 'generator-expression-target-properties'Brad King2012-09-281-13/+156
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 083de7e Process generator expressions in the COMPILE_DEFINITIONS target property. 08cb4fa Process generator expressions in the INCLUDE_DIRECTORIES property. 0ef091d Early return if there is no target. eb250cd Add a self-reference check for target properties. 7e80747 Add API to check that dependent target properties form a DAG. 239ac84 Add a generator expression for target properties. e028381 Extend the generator expression language with more logic. b8e61d6 Refactor GetCompileDefinitions a bit. 2c2b25b Return a std::string from GetCompileDefinitions. b7e48e0 Add an AppendDefines std::string overload. 9a16087 Convert paths in INCLUDE_DIRECTORIES property to Unix slashes. 4557c8d Don't prepend a path before generator expressions in include_directories. c6abc41 Add include guard for cmGeneratorExpression. 0ff4e3f Port remaining code to GetCompileDefinitions(). f178d53 Fix indentation in the code blocks generator.
| * Add a self-reference check for target properties.Stephen Kelly2012-09-281-1/+16
| | | | | | | | | | | | | | | | | | | | Prevent constructs like: ... INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>" Indirect self-references (cycles) are also prevented here, but indirect generator expression references of any kind are not possible yet anyway.
| * Add API to check that dependent target properties form a DAG.Stephen Kelly2012-09-281-19/+36
| | | | | | | | | | | | Initially this will only be used to check for self-references, but can be extended to check for cycles when chaining properties of other targets.
| * Add a generator expression for target properties.Stephen Kelly2012-09-281-0/+43
| | | | | | | | | | | | | | | | There are two overloads, so that it can use the operational target when a target property is being evaluated, and a target can alternatively be specified by name. At this point, the generators don't chain. That comes later.
| * Extend the generator expression language with more logic.Stephen Kelly2012-09-281-0/+68
| | | | | | | | | | | | | | Generator expressions for comparing strings, evaluating strings as booleans, and for creating literal right-angle-brackets and commas are added. Those may be needed in some cases where they appear in literals.
* | Fix the regular expression validator for target names.Stephen Kelly2012-09-201-1/+1
|/ | | | | Regression introduced by f1eacf0e07759b57d100dbf5d83c70e4028bcb54. Target names have different valid contents to config names.
* cmGeneratorExpression: Re-write for multi-stage evaluationStephen Kelly2012-09-181-0/+568
The expressions may be parsed and then cached and evaluated multiple times. They are evaluated lazily so that literals such as ',' can be treated as universal parameter separators, and can be processed from results without appearing literally, and without interfering with the parsing/evaluation of the entire expression.