1
1

Use different variable for option definitions, otherwise CMake get confused somehow.

This commit was SVN r23553.
Этот коммит содержится в:
Shiqing Fan 2010-08-04 19:11:27 +00:00
родитель 2914d11793
Коммит 33719634da

Просмотреть файл

@ -18,7 +18,7 @@
# VAR_FORMAT: whether we should use the variable name instead of the value
# in the template file.
MACRO(APPEND_CONFIG_FILE NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
MACRO(APPEND_CONFIG_FILE NAME VAR_NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
#We don't want to always generate the template file, but only when required.
IF(NOT WRITE_CONFIG_DONE)
@ -28,15 +28,15 @@ MACRO(APPEND_CONFIG_FILE NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
IF(${VAR_FORMAT})
IF(${IS_STR})
IF(${FORCE_DEF})
SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \"\${${NAME}}\"\n\n")
SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \"\${${VAR_NAME}}\"\n\n")
ELSE(${FORCE_DEF})
SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \"\${${NAME}}\"\n\n")
SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \"\${${VAR_NAME}}\"\n\n")
ENDIF(${FORCE_DEF})
ELSE(${IS_STR})
IF(${FORCE_DEF})
SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \${${NAME}}\n\n")
SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \${${VAR_NAME}}\n\n")
ELSE(${FORCE_DEF})
SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \${${NAME}}\n\n")
SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \${${VAR_NAME}}\n\n")
ENDIF(${FORCE_DEF})
ENDIF(${IS_STR})
ELSE(${VAR_FORMAT})
@ -59,7 +59,7 @@ MACRO(APPEND_CONFIG_FILE NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
${APPEND_STRING})
ENDIF(NOT WRITE_CONFIG_DONE)
ENDMACRO(APPEND_CONFIG_FILE NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
ENDMACRO(APPEND_CONFIG_FILE NAME VAR_NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
#define a name with value and
@ -68,7 +68,7 @@ MACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF)
SET(${NAME} ${VALUE})
APPEND_CONFIG_FILE(${NAME} ${VALUE} ${DESC} ${IS_STR} ${FORCE_DEF} 0)
APPEND_CONFIG_FILE(${NAME} ${NAME} ${VALUE} ${DESC} ${IS_STR} ${FORCE_DEF} 0)
ENDMACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF)
@ -77,7 +77,7 @@ ENDMACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF)
#write the line in template file.
MACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF)
APPEND_CONFIG_FILE(${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1)
APPEND_CONFIG_FILE(${NAME} ${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1)
ENDMACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF)
@ -88,7 +88,7 @@ MACRO(OMPI_DEF_CACHE NAME VALUE CACHE_TYPE DESC IS_STR FORCE_DEF)
SET(${NAME} ${VALUE} CACHE ${CACHE_TYPE} "${DESC}")
APPEND_CONFIG_FILE(${NAME} ${VALUE} ${DESC} ${IS_STR} ${FORCE_DEF} 0)
APPEND_CONFIG_FILE(${NAME} ${NAME} ${VALUE} ${DESC} ${IS_STR} ${FORCE_DEF} 0)
ENDMACRO(OMPI_DEF_CACHE NAME VALUE OPT DESC IS_STR FORCE_DEF)
@ -99,7 +99,7 @@ MACRO(OMPI_DEF_CACHE_VAR NAME VALUE CACHE_TYPE DESC IS_STR FORCE_DEF)
SET(${NAME} ${VALUE} CACHE ${CACHE_TYPE} "${DESC}")
APPEND_CONFIG_FILE(${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1)
APPEND_CONFIG_FILE(${NAME} ${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1)
ENDMACRO(OMPI_DEF_CACHE_VAR NAME VALUE OPT DESC IS_STR FORCE_DEF)
@ -113,11 +113,11 @@ MACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL)
OPTION(${NAME} "${DESC}" ${DEFAULT_VAL})
IF(${${NAME}} STREQUAL "OFF")
SET(${NAME} 0)
SET(${NAME}_VAL 0)
ELSE(${${NAME}} STREQUAL "OFF")
SET(${NAME} 1)
SET(${NAME}_VAL 1)
ENDIF(${${NAME}} STREQUAL "OFF")
OMPI_DEF_VAR(${NAME} "${DESC}" 0 1)
APPEND_CONFIG_FILE(${NAME} ${NAME}_VAL "" ${DESC} 0 1 1)
ENDMACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL)