Attached Files | or_equal.patch [^] (22,838 bytes) 2008-12-04 02:01 [Show Content] [Hide Content]Index: Docs/cmake-syntax.vim
===================================================================
RCS file: /cvsroot/CMake/CMake/Docs/cmake-syntax.vim,v
retrieving revision 1.10
diff -u -r1.10 cmake-syntax.vim
--- Docs/cmake-syntax.vim 25 Aug 2008 14:31:28 -0000 1.10
+++ Docs/cmake-syntax.vim 4 Dec 2008 06:44:25 -0000
@@ -43,7 +43,7 @@
syn keyword cmakeSystemVariables
\ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90
syn keyword cmakeOperators
- \ ABSOLUTE AND BOOL CACHE COMMAND DEFINED DOC EQUAL EXISTS EXT FALSE GREATER INTERNAL LESS MATCHES NAME NAMES NAME_WE NOT OFF ON OR PATH PATHS PROGRAM STREQUAL STRGREATER STRING STRLESS TRUE
+ \ ABSOLUTE AND BOOL CACHE COMMAND DEFINED DOC EQUAL EXISTS EXT FALSE GREATER GREATER_OR_EQUAL INTERNAL LESS LESS_OR_EQUAL MATCHES NAME NAMES NAME_WE NOT OFF ON OR PATH PATHS PROGRAM STREQUAL STRGREATER STRING STRLESS TRUE VERSION_LESS VERSION_GREATER VERSION_EQUAL VERSION_LESS_OR_EQUAL VERSION_GREATER_OR_EQUAL
\ contained
syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_REMOVE VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WRAP_EXCLUDE_FILES
\ nextgroup=cmakeArguments
Index: Source/cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.90
diff -u -r1.90 cmIfCommand.cxx
--- Source/cmIfCommand.cxx 1 Oct 2008 13:04:27 -0000 1.90
+++ Source/cmIfCommand.cxx 4 Dec 2008 04:44:59 -0000
@@ -285,7 +285,7 @@
}
//=========================================================================
- enum Op { OpLess, OpEqual, OpGreater };
+ enum Op { OpLess, OpEqual, OpGreater, OpGreaterOrEqual, OpLessOrEqual };
bool HandleVersionCompare(Op op, const char* lhs_str, const char* rhs_str)
{
// Parse out up to 4 components.
@@ -299,17 +299,17 @@
{
if(lhs[i] < rhs[i])
{
- // lhs < rhs, so true if operation is LESS
- return op == OpLess;
+ // lhs < rhs, so version is less
+ return (op == OpLess) || (op == OpLessOrEqual);
}
else if(lhs[i] > rhs[i])
{
- // lhs > rhs, so true if operation is GREATER
- return op == OpGreater;
+ // lhs > rhs, so version is greater
+ return (op == OpGreater) || (op == OpGreaterOrEqual);
}
}
- // lhs == rhs, so true if operation is EQUAL
- return op == OpEqual;
+ // lhs == rhs, so version is equal
+ return (op == OpEqual) || (op == OpGreaterOrEqual) || (op == OpLessOrEqual);
}
//=========================================================================
@@ -528,7 +528,8 @@
if (argP1 != newArgs.end() && argP2 != newArgs.end() &&
(*(argP1) == "LESS" || *(argP1) == "GREATER" ||
- *(argP1) == "EQUAL"))
+ *(argP1) == "EQUAL" || *(argP1) == "GREATER_OR_EQUAL" ||
+ *(argP1) == "LESS_OR_EQUAL" ))
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
@@ -548,7 +549,15 @@
{
result = (lhs > rhs);
}
- else
+ else if (*(argP1) == "GREATER_OR_EQUAL")
+ {
+ result = (lhs >= rhs);
+ }
+ else if (*(argP1) == "LESS_OR_EQUAL")
+ {
+ result = (lhs <= rhs);
+ }
+ else // EQUAL
{
result = (lhs == rhs);
}
@@ -583,7 +592,10 @@
if (argP1 != newArgs.end() && argP2 != newArgs.end() &&
(*(argP1) == "VERSION_LESS" || *(argP1) == "VERSION_GREATER" ||
- *(argP1) == "VERSION_EQUAL"))
+ *(argP1) == "VERSION_EQUAL" ||
+ *(argP1) == "VERSION_GREATER_OR_EQUAL" ||
+ *(argP1) == "VERSION_LESS_OR_EQUAL"
+ ))
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
@@ -596,6 +608,14 @@
{
op = OpGreater;
}
+ else if(*argP1 == "VERSION_GREATER_OR_EQUAL")
+ {
+ op = OpGreaterOrEqual;
+ }
+ else if(*argP1 == "VERSION_LESS_OR_EQUAL")
+ {
+ op = OpLessOrEqual;
+ }
bool result = HandleVersionCompare(op, def, def2);
HandleBinaryOp(result,
reducible, arg, newArgs, argP1, argP2);
@@ -703,7 +723,8 @@
// order of operations,
// 1. ( ) -- parenthetical groups
// 2. IS_DIRECTORY EXISTS COMMAND DEFINED etc predicates
-// 3. MATCHES LESS GREATER EQUAL STRLESS STRGREATER STREQUAL etc binary ops
+// 3. MATCHES LESS GREATER LESS_OR_EQUAL GREATER_OR_EQUAL EQUAL STRLESS
+// STRGREATER STREQUAL etc binary ops
// 4. NOT
// 5. AND OR
//
Index: Source/cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.50
diff -u -r1.50 cmIfCommand.h
--- Source/cmIfCommand.h 10 Sep 2008 15:58:40 -0000 1.50
+++ Source/cmIfCommand.h 4 Dec 2008 04:01:29 -0000
@@ -123,7 +123,8 @@
"the same expression must be given to if, and endif. Long "
"expressions can be used and the order or precedence is that the "
"EXISTS, COMMAND, and DEFINED operators will be evaluated first. "
- "Then any EQUAL, LESS, GREATER, STRLESS, STRGREATER, STREQUAL, MATCHES "
+ "Then any EQUAL, LESS, GREATER, LESS_OR_EQUAL, GREATER_OR_EQUAL "
+ "STRLESS, STRGREATER, STREQUAL, MATCHES "
"will be evaluated. Then NOT operators and finally AND, OR operators "
"will be evaluated. Possible expressions are:\n"
" if(variable)\n"
@@ -167,6 +168,10 @@
" if(string GREATER number)\n"
" if(variable EQUAL number)\n"
" if(string EQUAL number)\n"
+ " if(variable LESS_OR_EQUAL number)\n"
+ " if(string LESS_OR_EQUAL number)\n"
+ " if(variable GREATER_OR_EQUAL number)\n"
+ " if(string GREATER_OR_EQUAL number)\n"
"True if the given string or variable's value is a valid number and "
"the inequality or equality is true.\n"
" if(variable STRLESS string)\n"
@@ -180,6 +185,8 @@
" if(version1 VERSION_LESS version2)\n"
" if(version1 VERSION_EQUAL version2)\n"
" if(version1 VERSION_GREATER version2)\n"
+ " if(version1 VERSION_GREATER_OR_EQUAL version2)\n"
+ " if(version1 VERSION_LESS_OR_EQUAL version2)\n"
"Component-wise integer version number comparison (version format is "
"major[.minor[.patch[.tweak]]]).\n"
" if(DEFINED variable)\n"
Index: Tests/Complex/CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/CMakeLists.txt,v
retrieving revision 1.72
diff -u -r1.72 CMakeLists.txt
--- Tests/Complex/CMakeLists.txt 18 Aug 2008 13:53:06 -0000 1.72
+++ Tests/Complex/CMakeLists.txt 4 Dec 2008 04:50:29 -0000
@@ -71,10 +71,57 @@
IF(2.4 GREATER 2.4)
MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
ENDIF(2.4 GREATER 2.4)
+IF(2.4 LESS_OR_EQUAL 2.3)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 LESS_OR_EQUAL 2.3")
+ENDIF(2.4 LESS_OR_EQUAL 2.3)
+IF(2.3 GREATER_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.3 GREATER_OR_EQUAL 2.4")
+ENDIF(2.3 GREATER_OR_EQUAL 2.4)
+IF(NOT 2.4 LESS_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 LESS_OR_EQUAL 2.4")
+ENDIF(NOT 2.4 LESS_OR_EQUAL 2.4)
+IF(NOT 2.4 GREATER_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 GREATER_OR_EQUAL 2.4")
+ENDIF(NOT 2.4 GREATER_OR_EQUAL 2.4)
IF(NOT 2.4 EQUAL 2.4)
MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
ENDIF(NOT 2.4 EQUAL 2.4)
+# Numerical version comparison test.
+IF(2.4 VERSION_LESS 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 VERSION_LESS 2.4")
+ENDIF()
+IF(2.4.0 VERSION_LESS 2.4.0)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0 VERSION_LESS 2.4.0")
+ENDIF()
+IF(2.4.0.0 VERSION_LESS 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_LESS 2.4.0.0")
+ENDIF()
+IF(2.4.0.0 VERSION_LESS 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_LESS 2.3.9.9")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.3.9.9)
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.4.0.0)
+ENDIF()
+IF(NOT 2.3.9.9 VERSION_LESS_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.3.9.9 VERSION_LESS_OR_EQUAL 2.4.0.0")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_LESS_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_LESS_OR_EQUAL 2.4.0.0")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_EQUAL 2.4.0.0")
+ENDIF()
+IF(2.4.0.0 VERSION_GREATER 2.4.0.1)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_GREATER 2.4.0.1")
+ENDIF()
+IF(NOT 2.4.1.0 VERSION_GREATER 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.1.0 VERSION_GREATER 2.3.9.9")
+ENDIF()
+
#
# Use the ansi CXX compile flag for building cmake
#
Index: Tests/Complex/VarTests.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/VarTests.cmake,v
retrieving revision 1.10
diff -u -r1.10 VarTests.cmake
--- Tests/Complex/VarTests.cmake 22 Mar 2006 20:01:22 -0000 1.10
+++ Tests/Complex/VarTests.cmake 4 Dec 2008 04:57:41 -0000
@@ -144,6 +144,31 @@
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2)
ENDIF (SNUM1_VAR GREATER SNUM2_VAR)
+IF (SNUM2_VAR GREATER_OR_EQUAL SNUM1_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER_OR_EQUAL)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER_OR_EQUAL)
+ENDIF()
+
+IF (SNUM1_VAR GREATER_OR_EQUAL SNUM3_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER_OR_EQUAL2)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER_OR_EQUAL2)
+ENDIF()
+
+IF (SNUM1_VAR LESS_OR_EQUAL SNUM2_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS_OR_EQUAL)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS_OR_EQUAL)
+ENDIF()
+
+IF (SNUM1_VAR LESS_OR_EQUAL SNUM3_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS_OR_EQUAL2)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS_OR_EQUAL2)
+ENDIF()
+
+
SET (SSTR1_VAR "abc")
SET (SSTR2_VAR "bcd")
Index: Tests/Complex/Executable/complex.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/Executable/complex.cxx,v
retrieving revision 1.99
diff -u -r1.99 complex.cxx
--- Tests/Complex/Executable/complex.cxx 26 Jun 2008 17:01:35 -0000 1.99
+++ Tests/Complex/Executable/complex.cxx 4 Dec 2008 05:02:48 -0000
@@ -722,6 +722,30 @@
#else
cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined.");
#endif
+
+#ifndef SHOULD_BE_DEFINED_GREATER_OR_EQUAL
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER_OR_EQUAL is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_GREATER_OR_EQUAL is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_GREATER_OR_EQUAL2
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER_OR_EQUAL2 is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_GREATER_OR_EQUAL2 is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_LESS_OR_EQUAL
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS_OR_EQUAL is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_LESS_OR_EQUAL is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_LESS_OR_EQUAL2
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS_OR_EQUAL2 is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_LESS_OR_EQUAL2 is defined.");
+#endif
#ifdef SHOULD_NOT_BE_DEFINED_STRLESS
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined.");
Index: Tests/ComplexOneConfig/CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexOneConfig/CMakeLists.txt,v
retrieving revision 1.72
diff -u -r1.72 CMakeLists.txt
--- Tests/ComplexOneConfig/CMakeLists.txt 18 Aug 2008 13:53:06 -0000 1.72
+++ Tests/ComplexOneConfig/CMakeLists.txt 4 Dec 2008 05:04:22 -0000
@@ -71,10 +71,57 @@
IF(2.4 GREATER 2.4)
MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
ENDIF(2.4 GREATER 2.4)
+IF(2.4 LESS_OR_EQUAL 2.3)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 LESS_OR_EQUAL 2.3")
+ENDIF(2.4 LESS_OR_EQUAL 2.3)
+IF(2.3 GREATER_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.3 GREATER_OR_EQUAL 2.4")
+ENDIF(2.3 GREATER_OR_EQUAL 2.4)
+IF(NOT 2.4 LESS_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 LESS_OR_EQUAL 2.4")
+ENDIF(NOT 2.4 LESS_OR_EQUAL 2.4)
+IF(NOT 2.4 GREATER_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 GREATER_OR_EQUAL 2.4")
+ENDIF(NOT 2.4 GREATER_OR_EQUAL 2.4)
IF(NOT 2.4 EQUAL 2.4)
MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
ENDIF(NOT 2.4 EQUAL 2.4)
+# Numerical version comparison test.
+IF(2.4 VERSION_LESS 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 VERSION_LESS 2.4")
+ENDIF()
+IF(2.4.0 VERSION_LESS 2.4.0)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0 VERSION_LESS 2.4.0")
+ENDIF()
+IF(2.4.0.0 VERSION_LESS 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_LESS 2.4.0.0")
+ENDIF()
+IF(2.4.0.0 VERSION_LESS 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_LESS 2.3.9.9")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.3.9.9)
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.4.0.0)
+ENDIF()
+IF(NOT 2.3.9.9 VERSION_LESS_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.3.9.9 VERSION_LESS_OR_EQUAL 2.4.0.0")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_LESS_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_LESS_OR_EQUAL 2.4.0.0")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_EQUAL 2.4.0.0")
+ENDIF()
+IF(2.4.0.0 VERSION_GREATER 2.4.0.1)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_GREATER 2.4.0.1")
+ENDIF()
+IF(NOT 2.4.1.0 VERSION_GREATER 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.1.0 VERSION_GREATER 2.3.9.9")
+ENDIF()
+
#
# Use the ansi CXX compile flag for building cmake
#
Index: Tests/ComplexOneConfig/VarTests.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexOneConfig/VarTests.cmake,v
retrieving revision 1.10
diff -u -r1.10 VarTests.cmake
--- Tests/ComplexOneConfig/VarTests.cmake 22 Mar 2006 20:01:22 -0000 1.10
+++ Tests/ComplexOneConfig/VarTests.cmake 4 Dec 2008 05:04:27 -0000
@@ -144,6 +144,31 @@
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2)
ENDIF (SNUM1_VAR GREATER SNUM2_VAR)
+IF (SNUM2_VAR GREATER_OR_EQUAL SNUM1_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER_OR_EQUAL)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER_OR_EQUAL)
+ENDIF()
+
+IF (SNUM1_VAR GREATER_OR_EQUAL SNUM3_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER_OR_EQUAL2)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER_OR_EQUAL2)
+ENDIF()
+
+IF (SNUM1_VAR LESS_OR_EQUAL SNUM2_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS_OR_EQUAL)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS_OR_EQUAL)
+ENDIF()
+
+IF (SNUM1_VAR LESS_OR_EQUAL SNUM3_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS_OR_EQUAL2)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS_OR_EQUAL2)
+ENDIF()
+
+
SET (SSTR1_VAR "abc")
SET (SSTR2_VAR "bcd")
Index: Tests/ComplexOneConfig/Executable/complex.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexOneConfig/Executable/complex.cxx,v
retrieving revision 1.99
diff -u -r1.99 complex.cxx
--- Tests/ComplexOneConfig/Executable/complex.cxx 26 Jun 2008 17:01:35 -0000 1.99
+++ Tests/ComplexOneConfig/Executable/complex.cxx 4 Dec 2008 05:04:33 -0000
@@ -722,6 +722,30 @@
#else
cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined.");
#endif
+
+#ifndef SHOULD_BE_DEFINED_GREATER_OR_EQUAL
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER_OR_EQUAL is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_GREATER_OR_EQUAL is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_GREATER_OR_EQUAL2
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER_OR_EQUAL2 is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_GREATER_OR_EQUAL2 is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_LESS_OR_EQUAL
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS_OR_EQUAL is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_LESS_OR_EQUAL is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_LESS_OR_EQUAL2
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS_OR_EQUAL2 is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_LESS_OR_EQUAL2 is defined.");
+#endif
#ifdef SHOULD_NOT_BE_DEFINED_STRLESS
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined.");
Index: Tests/ComplexRelativePaths/CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexRelativePaths/CMakeLists.txt,v
retrieving revision 1.72
diff -u -r1.72 CMakeLists.txt
--- Tests/ComplexRelativePaths/CMakeLists.txt 18 Aug 2008 13:53:06 -0000 1.72
+++ Tests/ComplexRelativePaths/CMakeLists.txt 4 Dec 2008 05:07:33 -0000
@@ -71,10 +71,57 @@
IF(2.4 GREATER 2.4)
MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
ENDIF(2.4 GREATER 2.4)
+IF(2.4 LESS_OR_EQUAL 2.3)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 LESS_OR_EQUAL 2.3")
+ENDIF(2.4 LESS_OR_EQUAL 2.3)
+IF(2.3 GREATER_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.3 GREATER_OR_EQUAL 2.4")
+ENDIF(2.3 GREATER_OR_EQUAL 2.4)
+IF(NOT 2.4 LESS_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 LESS_OR_EQUAL 2.4")
+ENDIF(NOT 2.4 LESS_OR_EQUAL 2.4)
+IF(NOT 2.4 GREATER_OR_EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 GREATER_OR_EQUAL 2.4")
+ENDIF(NOT 2.4 GREATER_OR_EQUAL 2.4)
IF(NOT 2.4 EQUAL 2.4)
MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
ENDIF(NOT 2.4 EQUAL 2.4)
+# Numerical version comparison test.
+IF(2.4 VERSION_LESS 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 VERSION_LESS 2.4")
+ENDIF()
+IF(2.4.0 VERSION_LESS 2.4.0)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0 VERSION_LESS 2.4.0")
+ENDIF()
+IF(2.4.0.0 VERSION_LESS 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_LESS 2.4.0.0")
+ENDIF()
+IF(2.4.0.0 VERSION_LESS 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_LESS 2.3.9.9")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.3.9.9)
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_GREATER_OR_EQUAL 2.4.0.0)
+ENDIF()
+IF(NOT 2.3.9.9 VERSION_LESS_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.3.9.9 VERSION_LESS_OR_EQUAL 2.4.0.0")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_LESS_OR_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_LESS_OR_EQUAL 2.4.0.0")
+ENDIF()
+IF(NOT 2.4.0.0 VERSION_EQUAL 2.4.0.0)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.0.0 VERSION_EQUAL 2.4.0.0")
+ENDIF()
+IF(2.4.0.0 VERSION_GREATER 2.4.0.1)
+ MESSAGE(FATAL_ERROR "Failed: 2.4.0.0 VERSION_GREATER 2.4.0.1")
+ENDIF()
+IF(NOT 2.4.1.0 VERSION_GREATER 2.3.9.9)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4.1.0 VERSION_GREATER 2.3.9.9")
+ENDIF()
+
#
# Use the ansi CXX compile flag for building cmake
#
Index: Tests/ComplexRelativePaths/VarTests.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexRelativePaths/VarTests.cmake,v
retrieving revision 1.10
diff -u -r1.10 VarTests.cmake
--- Tests/ComplexRelativePaths/VarTests.cmake 22 Mar 2006 20:01:22 -0000 1.10
+++ Tests/ComplexRelativePaths/VarTests.cmake 4 Dec 2008 05:07:35 -0000
@@ -144,6 +144,31 @@
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2)
ENDIF (SNUM1_VAR GREATER SNUM2_VAR)
+IF (SNUM2_VAR GREATER_OR_EQUAL SNUM1_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER_OR_EQUAL)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER_OR_EQUAL)
+ENDIF()
+
+IF (SNUM1_VAR GREATER_OR_EQUAL SNUM3_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER_OR_EQUAL2)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER_OR_EQUAL2)
+ENDIF()
+
+IF (SNUM1_VAR LESS_OR_EQUAL SNUM2_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS_OR_EQUAL)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS_OR_EQUAL)
+ENDIF()
+
+IF (SNUM1_VAR LESS_OR_EQUAL SNUM3_VAR)
+ ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS_OR_EQUAL2)
+ELSE()
+ ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS_OR_EQUAL2)
+ENDIF()
+
+
SET (SSTR1_VAR "abc")
SET (SSTR2_VAR "bcd")
Index: Tests/ComplexRelativePaths/Executable/complex.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexRelativePaths/Executable/complex.cxx,v
retrieving revision 1.99
diff -u -r1.99 complex.cxx
--- Tests/ComplexRelativePaths/Executable/complex.cxx 26 Jun 2008 17:01:35 -0000 1.99
+++ Tests/ComplexRelativePaths/Executable/complex.cxx 4 Dec 2008 05:07:40 -0000
@@ -722,6 +722,30 @@
#else
cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined.");
#endif
+
+#ifndef SHOULD_BE_DEFINED_GREATER_OR_EQUAL
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER_OR_EQUAL is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_GREATER_OR_EQUAL is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_GREATER_OR_EQUAL2
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER_OR_EQUAL2 is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_GREATER_OR_EQUAL2 is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_LESS_OR_EQUAL
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS_OR_EQUAL is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_LESS_OR_EQUAL is defined.");
+#endif
+
+#ifndef SHOULD_BE_DEFINED_LESS_OR_EQUAL2
+ cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS_OR_EQUAL2 is not defined.\n");
+#else
+ cmPassed("SHOULD_BE_DEFINED_LESS_OR_EQUAL2 is defined.");
+#endif
#ifdef SHOULD_NOT_BE_DEFINED_STRLESS
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined.");
|