summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/Complex/CMakeLists.txt13
-rw-r--r--Tests/Complex/Executable/complex.cxx6
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt13
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx6
-rw-r--r--Tests/ComplexRelativePaths/CMakeLists.txt13
-rw-r--r--Tests/ComplexRelativePaths/Executable/complex.cxx6
6 files changed, 57 insertions, 0 deletions
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index c93713e..ef0ff80 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -17,6 +17,19 @@ ENDMACRO(ASSERT)
ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
#
+# Define a var args macro, it must take two or four args
+#
+MACRO(TEST_ARGC value1 value2)
+ ADD_DEFINITIONS(${value1} ${value2})
+ IF (${ARGC} MATCHES 4)
+ ADD_DEFINITIONS(${ARGV2} ${ARGV3})
+ ENDIF (${ARGC} MATCHES 4)
+ENDMACRO(TEST_ARGC)
+
+# invoke the macro
+TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
+
+#
# Use the ansi CXX compile flag for building cmake
#
IF (CMAKE_ANSI_CXXFLAGS)
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 7ad9997..5cbe51c 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -194,6 +194,12 @@ int main()
cmPassed("CMAKE_IS_FUN is defined.");
#endif
+#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4)
+ cmPassed("Variable args for MACROs are working.");
+#else
+ cmFailed("Variable args for MACROs are failing.");
+#endif
+
// ----------------------------------------------------------------------
// Test SET, VARIABLE_REQUIRES
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index c93713e..ef0ff80 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -17,6 +17,19 @@ ENDMACRO(ASSERT)
ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
#
+# Define a var args macro, it must take two or four args
+#
+MACRO(TEST_ARGC value1 value2)
+ ADD_DEFINITIONS(${value1} ${value2})
+ IF (${ARGC} MATCHES 4)
+ ADD_DEFINITIONS(${ARGV2} ${ARGV3})
+ ENDIF (${ARGC} MATCHES 4)
+ENDMACRO(TEST_ARGC)
+
+# invoke the macro
+TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
+
+#
# Use the ansi CXX compile flag for building cmake
#
IF (CMAKE_ANSI_CXXFLAGS)
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 7ad9997..5cbe51c 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -194,6 +194,12 @@ int main()
cmPassed("CMAKE_IS_FUN is defined.");
#endif
+#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4)
+ cmPassed("Variable args for MACROs are working.");
+#else
+ cmFailed("Variable args for MACROs are failing.");
+#endif
+
// ----------------------------------------------------------------------
// Test SET, VARIABLE_REQUIRES
diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt
index c93713e..ef0ff80 100644
--- a/Tests/ComplexRelativePaths/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/CMakeLists.txt
@@ -17,6 +17,19 @@ ENDMACRO(ASSERT)
ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
#
+# Define a var args macro, it must take two or four args
+#
+MACRO(TEST_ARGC value1 value2)
+ ADD_DEFINITIONS(${value1} ${value2})
+ IF (${ARGC} MATCHES 4)
+ ADD_DEFINITIONS(${ARGV2} ${ARGV3})
+ ENDIF (${ARGC} MATCHES 4)
+ENDMACRO(TEST_ARGC)
+
+# invoke the macro
+TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
+
+#
# Use the ansi CXX compile flag for building cmake
#
IF (CMAKE_ANSI_CXXFLAGS)
diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx
index 7ad9997..5cbe51c 100644
--- a/Tests/ComplexRelativePaths/Executable/complex.cxx
+++ b/Tests/ComplexRelativePaths/Executable/complex.cxx
@@ -194,6 +194,12 @@ int main()
cmPassed("CMAKE_IS_FUN is defined.");
#endif
+#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4)
+ cmPassed("Variable args for MACROs are working.");
+#else
+ cmFailed("Variable args for MACROs are failing.");
+#endif
+
// ----------------------------------------------------------------------
// Test SET, VARIABLE_REQUIRES