diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2002-01-19 01:32:06 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2002-01-19 01:32:06 (GMT) |
commit | c26008ccf3999156cab5a05172a04c562bed9cc8 (patch) | |
tree | ee95576b1664de2b2dbc8d97be121dc168292b9f /Tests/ComplexRelativePaths/VarTests.cmake | |
parent | 2b5bb96e2367e28e980d4dcc3ddbcbebe34d08af (diff) | |
download | CMake-c26008ccf3999156cab5a05172a04c562bed9cc8.zip CMake-c26008ccf3999156cab5a05172a04c562bed9cc8.tar.gz CMake-c26008ccf3999156cab5a05172a04c562bed9cc8.tar.bz2 |
ENH: Increase test + coverage
Diffstat (limited to 'Tests/ComplexRelativePaths/VarTests.cmake')
-rw-r--r-- | Tests/ComplexRelativePaths/VarTests.cmake | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Tests/ComplexRelativePaths/VarTests.cmake b/Tests/ComplexRelativePaths/VarTests.cmake new file mode 100644 index 0000000..ee3faf3 --- /dev/null +++ b/Tests/ComplexRelativePaths/VarTests.cmake @@ -0,0 +1,56 @@ +SET (ZERO_VAR 0) + +IF(ZERO_VAR) + ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED) +ELSE(ZERO_VAR) + ADD_DEFINITIONS(-DSHOULD_BE_DEFINED) +ENDIF(ZERO_VAR) + +SET(ONE_VAR 1) + +VARIABLE_REQUIRES(ONE_VAR + ONE_VAR_IS_DEFINED ONE_VAR) + +SET (ONE_VAR2 1) + +IF(ONE_VAR AND ONE_VAR2) + ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND) +ELSE(ONE_VAR AND ONE_VAR2) + ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND) +ENDIF(ONE_VAR AND ONE_VAR2) + +IF(ZERO_VAR OR ONE_VAR2) + ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR) +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") + +FOREACH (INDEX 1 2) + SET(FOREACH_VAR${INDEX} "VALUE${INDEX}") +ENDFOREACH(INDEX) + +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) + +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) + |