diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2002-01-20 02:24:55 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2002-01-20 02:24:55 (GMT) |
commit | c8d8e693cf24d657ced601c8173258f89b62e71a (patch) | |
tree | 2fcf0b3929d709ec76fced03145ce59897a8c04d /Tests/ComplexOneConfig/VarTests.cmake | |
parent | 30b3cc0755b43bf3ad04cf2fa4d5af441cbadfd7 (diff) | |
download | CMake-c8d8e693cf24d657ced601c8173258f89b62e71a.zip CMake-c8d8e693cf24d657ced601c8173258f89b62e71a.tar.gz CMake-c8d8e693cf24d657ced601c8173258f89b62e71a.tar.bz2 |
Add documentation, comments. Move some 'Complex' sub-tests into 2 new 'Wrapping' and 'Testing' tests.
Diffstat (limited to 'Tests/ComplexOneConfig/VarTests.cmake')
-rw-r--r-- | Tests/ComplexOneConfig/VarTests.cmake | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index ee3faf3..1b6c337 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/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) - |