diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-09-11 19:53:38 +0200 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-18 17:02:23 -0400 |
commit | f1eacf0e07759b57d100dbf5d83c70e4028bcb54 (patch) | |
tree | 8ccbb516aa96dd286e81f690845b7ddf72741f35 /Tests | |
parent | 1d3db6b34df827566ffe5615d568de0ef64d3e61 (diff) | |
download | cmake-f1eacf0e07759b57d100dbf5d83c70e4028bcb54.tar.gz |
cmGeneratorExpression: Re-write for multi-stage evaluation
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.
Diffstat (limited to 'Tests')
8 files changed, 136 insertions, 7 deletions
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt index ced21d8065..36302db9bb 100644 --- a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt @@ -1,9 +1,18 @@ CMake Error at BadAND.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<AND> + + \$<AND> expression requires at least one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<AND:> - AND requires one or more comma-separated '0' or '1' values. + Parameters to \$<AND> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -12,6 +21,24 @@ CMake Error at BadAND.cmake:1 \(add_custom_target\): \$<AND:,> - AND requires one or more comma-separated '0' or '1' values. + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:01> + + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:nothing> + + Parameters to \$<AND> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadAND.cmake b/Tests/RunCMake/GeneratorExpression/BadAND.cmake index 7926540469..265e4149b7 100644 --- a/Tests/RunCMake/GeneratorExpression/BadAND.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadAND.cmake @@ -1,4 +1,7 @@ add_custom_target(check ALL COMMAND check + $<AND> $<AND:> $<AND:,> + $<AND:01> + $<AND:nothing> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 7c86b250f9..1cfbf404e4 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -1,8 +1,44 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<CONFIG> + + \$<CONFIG> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<CONFIG:.> Expression syntax not recognized. Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo,Bar> + + \$<CONFIG> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo-Bar> + + Expression syntax not recognized. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo-Nested> + + Expression syntax not recognized. +Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index 0c13f8944f..c27ea5f736 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -1,3 +1,7 @@ add_custom_target(check ALL COMMAND check + $<CONFIG> $<CONFIG:.> + $<CONFIG:Foo,Bar> + $<CONFIG:Foo-Bar> + $<$<CONFIG:Foo-Nested>:foo> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt index 5721f5fe15..32169c537a 100644 --- a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt @@ -1,9 +1,17 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<NOT> + + \$<NOT> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<NOT:> - NOT requires exactly one '0' or '1' value. + \$<NOT> parameter must resolve to exactly one '0' or '1' value. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -12,7 +20,7 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): \$<NOT:,> - NOT requires exactly one '0' or '1' value. + \$<NOT> parameter must resolve to exactly one '0' or '1' value. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -21,6 +29,24 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): \$<NOT:0,1> - NOT requires exactly one '0' or '1' value. + \$<NOT> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<NOT:01> + + \$<NOT> parameter must resolve to exactly one '0' or '1' value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<NOT:nothing> + + \$<NOT> parameter must resolve to exactly one '0' or '1' value. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT.cmake b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake index 452293b8d5..c2dada3c20 100644 --- a/Tests/RunCMake/GeneratorExpression/BadNOT.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake @@ -1,5 +1,8 @@ add_custom_target(check ALL COMMAND check + $<NOT> $<NOT:> $<NOT:,> $<NOT:0,1> + $<NOT:01> + $<NOT:nothing> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt index 72ef2dd3cb..d4ccab74ca 100644 --- a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt @@ -1,9 +1,18 @@ CMake Error at BadOR.cmake:1 \(add_custom_target\): Error evaluating generator expression: + \$<OR> + + \$<OR> expression requires at least one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + \$<OR:> - OR requires one or more comma-separated '0' or '1' values. + Parameters to \$<OR> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + @@ -12,6 +21,24 @@ CMake Error at BadOR.cmake:1 \(add_custom_target\): \$<OR:,> - OR requires one or more comma-separated '0' or '1' values. + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:01> + + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:nothing> + + Parameters to \$<OR> must resolve to either '0' or '1'. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadOR.cmake b/Tests/RunCMake/GeneratorExpression/BadOR.cmake index f16f56a3cf..0813400d6b 100644 --- a/Tests/RunCMake/GeneratorExpression/BadOR.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadOR.cmake @@ -1,4 +1,7 @@ add_custom_target(check ALL COMMAND check + $<OR> $<OR:> $<OR:,> + $<OR:01> + $<OR:nothing> VERBATIM) |