From 19e891532a915d1fa4fcf4cdba6254d28c2adc6c Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 26 Jun 2008 13:01:35 -0400 Subject: ENH: support parenthesis as arguments and in conditionals feature request #6191 --- Tests/Complex/CMakeLists.txt | 6 ++++++ Tests/Complex/Executable/complex.cxx | 6 ++++++ Tests/Complex/cmTestConfigure.h.in | 4 ++++ 3 files changed, 16 insertions(+) (limited to 'Tests/Complex') diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 1814528cdd..c3f94b72a0 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -336,6 +336,12 @@ if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) endif (NOT ELSEIF_RESULT EQUAL 2) +# test handling of parenthetical groups in conditionals +if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) + set(CONDITIONAL_PARENTHESES 1) +endif() + + # # Configure file # (plug vars to #define so that they can be tested) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 95e77b6403..0ecd8fe2ee 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -369,6 +369,12 @@ int main() cmFailed("ELSEIF did not work"); #endif +#ifdef CONDITIONAL_PARENTHESES + cmPassed("CONDITIONAL_PARENTHESES did work"); +#else + cmFailed("CONDITIONAL_PARENTHESES did not work"); +#endif + if(file2() != 1) { cmFailed("Call to file2 function from library failed."); diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index 80342036a4..d7952da1ea 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -81,3 +81,7 @@ // test elseif #cmakedefine ELSEIF_RESULT + +// test parenthesis in conditionals +#cmakedefine CONDITIONAL_PARENTHESES + -- cgit v1.2.1