summaryrefslogtreecommitdiffstats
path: root/Tests/Complex/VarTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Complex/VarTests.cmake')
-rw-r--r--Tests/Complex/VarTests.cmake30
1 files changed, 18 insertions, 12 deletions
diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index ee3faf3..1b6c337 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/VarTests.cmake
@@ -1,3 +1,6 @@
+#
+# Test SET
+#
SET (ZERO_VAR 0)
IF(ZERO_VAR)
@@ -7,12 +10,18 @@ ELSE(ZERO_VAR)
ENDIF(ZERO_VAR)
SET(ONE_VAR 1)
+SET(ONE_VAR2 1)
+SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
+#
+# Test VARIABLE_REQUIRES
+#
VARIABLE_REQUIRES(ONE_VAR
ONE_VAR_IS_DEFINED ONE_VAR)
-SET (ONE_VAR2 1)
-
+#
+# Test various IF/ELSE combinations
+#
IF(ONE_VAR AND ONE_VAR2)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND)
ELSE(ONE_VAR AND ONE_VAR2)
@@ -25,32 +34,29 @@ ELSE(ZERO_VAR OR ONE_VAR2)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR)
ENDIF(ZERO_VAR OR ONE_VAR2)
-SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
-
IF(STRING_VAR MATCHES "^CMake")
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES)
ELSE(STRING_VAR MATCHES "^CMake")
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES)
ENDIF(STRING_VAR MATCHES "^CMake")
+#
+# Test FOREACH
+#
FOREACH (INDEX 1 2)
SET(FOREACH_VAR${INDEX} "VALUE${INDEX}")
ENDFOREACH(INDEX)
+#
+# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
+#
FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH)
GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME)
GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME)
GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT)
-GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE)
+GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE)
FIND_PATH(PATH_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME)
-
-# Coverage only
-
-BUILD_COMMAND(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM})
-BUILD_NAME(BUILD_NAME_VAR)
-SITE_NAME(SITE_NAME_VAR)
-