summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-29 21:41:33 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-29 21:41:33 (GMT)
commit28f6e1b194cd71af7308cd2c91b438d8de72bc0d (patch)
treeca59d213a0c4924ed38c806ba473e19b09795fa4 /Tests
parent8750f1c277d8bf3fdf2d2986f473c5f09e293ea5 (diff)
downloadCMake-28f6e1b194cd71af7308cd2c91b438d8de72bc0d.zip
CMake-28f6e1b194cd71af7308cd2c91b438d8de72bc0d.tar.gz
CMake-28f6e1b194cd71af7308cd2c91b438d8de72bc0d.tar.bz2
ENH: Add ARGV and ARGN support to MACRO command. ARGV is the list of all arguments and ARGN is the list of all nonexpected arguments
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Complex/CMakeLists.txt15
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt15
-rw-r--r--Tests/ComplexRelativePaths/CMakeLists.txt15
3 files changed, 45 insertions, 0 deletions
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index ef0ff80..c8a0ec3 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -29,6 +29,21 @@ ENDMACRO(TEST_ARGC)
# invoke the macro
TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
+MACRO(TEST_VAR_ARG fa)
+ IF("${ARGV}" MATCHES "^1;2;3$")
+ MESSAGE(STATUS "ARGV works")
+ ELSE("${ARGV}" MATCHES "^1;2;3$")
+ MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
+ ENDIF("${ARGV}" MATCHES "^1;2;3$")
+ IF("${ARGN}" MATCHES "^2;3$")
+ MESSAGE(STATUS "ARGN works")
+ ELSE("${ARGN}" MATCHES "^2;3$")
+ MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
+ ENDIF("${ARGN}" MATCHES "^2;3$")
+ENDMACRO(TEST_VAR_ARG)
+
+TEST_VAR_ARG(1 2 3)
+
#
# Use the ansi CXX compile flag for building cmake
#
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index ef0ff80..c8a0ec3 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -29,6 +29,21 @@ ENDMACRO(TEST_ARGC)
# invoke the macro
TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
+MACRO(TEST_VAR_ARG fa)
+ IF("${ARGV}" MATCHES "^1;2;3$")
+ MESSAGE(STATUS "ARGV works")
+ ELSE("${ARGV}" MATCHES "^1;2;3$")
+ MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
+ ENDIF("${ARGV}" MATCHES "^1;2;3$")
+ IF("${ARGN}" MATCHES "^2;3$")
+ MESSAGE(STATUS "ARGN works")
+ ELSE("${ARGN}" MATCHES "^2;3$")
+ MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
+ ENDIF("${ARGN}" MATCHES "^2;3$")
+ENDMACRO(TEST_VAR_ARG)
+
+TEST_VAR_ARG(1 2 3)
+
#
# Use the ansi CXX compile flag for building cmake
#
diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt
index ef0ff80..c8a0ec3 100644
--- a/Tests/ComplexRelativePaths/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/CMakeLists.txt
@@ -29,6 +29,21 @@ ENDMACRO(TEST_ARGC)
# invoke the macro
TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
+MACRO(TEST_VAR_ARG fa)
+ IF("${ARGV}" MATCHES "^1;2;3$")
+ MESSAGE(STATUS "ARGV works")
+ ELSE("${ARGV}" MATCHES "^1;2;3$")
+ MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
+ ENDIF("${ARGV}" MATCHES "^1;2;3$")
+ IF("${ARGN}" MATCHES "^2;3$")
+ MESSAGE(STATUS "ARGN works")
+ ELSE("${ARGN}" MATCHES "^2;3$")
+ MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
+ ENDIF("${ARGN}" MATCHES "^2;3$")
+ENDMACRO(TEST_VAR_ARG)
+
+TEST_VAR_ARG(1 2 3)
+
#
# Use the ansi CXX compile flag for building cmake
#