summaryrefslogtreecommitdiffstats
path: root/Tests/ComplexOneConfig
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2004-04-26 15:12:19 (GMT)
committerKen Martin <ken.martin@kitware.com>2004-04-26 15:12:19 (GMT)
commitc63c23a61759b178c04ac1c492beff131be9d41b (patch)
treef6575298aade688e315de9eedc58a3d06bff3d9c /Tests/ComplexOneConfig
parent2d53fcf03522bfc13f0a3817c260576bbe496c7d (diff)
downloadCMake-c63c23a61759b178c04ac1c492beff131be9d41b.zip
CMake-c63c23a61759b178c04ac1c492beff131be9d41b.tar.gz
CMake-c63c23a61759b178c04ac1c492beff131be9d41b.tar.bz2
added tests for var args with macros
Diffstat (limited to 'Tests/ComplexOneConfig')
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt13
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx6
2 files changed, 19 insertions, 0 deletions
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