Brad King ebf05abda1 Add boolean generator expressions
Add generator expressions that combine and use boolean test results:

 $<0:...>         = empty string (ignores "...")
 $<1:...>         = content of "..."
 $<AND:?[,?]...>  = '1' if all '?' are '1', else '0'
 $<OR:?[,?]...>   = '0' if all '?' are '0', else '1'
 $<NOT:?>         = '0' if '?' is '1', else '1'

These will be useful to evaluate (future) boolean query expressions and
condition content on the results.  Include tests and documentation.
2012-08-15 11:44:49 -04:00

27 lines
705 B
CMake

cmake_minimum_required (VERSION 2.8.8)
project(GeneratorExpression NONE)
add_custom_target(check ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_0=$<0:nothing>
-Dtest_1=$<1:content>
-Dconfig=$<CONFIGURATION>
-Dtest_and_0=$<AND:0>
-Dtest_and_0_0=$<AND:0,0>
-Dtest_and_0_1=$<AND:0,1>
-Dtest_and_1=$<AND:1>
-Dtest_and_1_0=$<AND:1,0>
-Dtest_and_1_1=$<AND:1,1>
-Dtest_not_0=$<NOT:0>
-Dtest_not_1=$<NOT:1>
-Dtest_or_0=$<OR:0>
-Dtest_or_0_0=$<OR:0,0>
-Dtest_or_0_1=$<OR:0,1>
-Dtest_or_1=$<OR:1>
-Dtest_or_1_0=$<OR:1,0>
-Dtest_or_1_1=$<OR:1,1>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done"
VERBATIM
)