CMake/Tests/ComplexOneConfig/VarTests.cmake

57 lines
1.5 KiB
CMake
Raw Normal View History

2001-08-23 21:57:45 +04:00
SET (ZERO_VAR 0)
2002-01-18 20:03:32 +03:00
2001-08-23 21:57:45 +04:00
IF(ZERO_VAR)
2002-01-18 20:03:32 +03:00
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
2001-08-23 21:57:45 +04:00
ELSE(ZERO_VAR)
2002-01-18 20:03:32 +03:00
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
2001-08-23 21:57:45 +04:00
ENDIF(ZERO_VAR)
SET(ONE_VAR 1)
2002-01-18 20:03:32 +03:00
VARIABLE_REQUIRES(ONE_VAR
ONE_VAR_IS_DEFINED ONE_VAR)
2002-01-19 04:32:06 +03:00
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)
2001-08-23 21:57:45 +04:00
SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
2002-01-18 20:03:32 +03:00
2002-01-19 04:32:06 +03:00
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")
2002-01-18 20:03:32 +03:00
FOREACH (INDEX 1 2)
SET(FOREACH_VAR${INDEX} "VALUE${INDEX}")
ENDFOREACH(INDEX)
2002-01-19 04:32:06 +03:00
FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
2002-01-18 20:03:32 +03:00
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)
2002-01-19 04:32:06 +03:00
FIND_PATH(PATH_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
2002-01-18 20:03:32 +03:00
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)