Use different variable for option definitions, otherwise CMake get confused somehow.
This commit was SVN r23553.
Этот коммит содержится в:
родитель
2914d11793
Коммит
33719634da
@ -18,7 +18,7 @@
|
|||||||
# VAR_FORMAT: whether we should use the variable name instead of the value
|
# VAR_FORMAT: whether we should use the variable name instead of the value
|
||||||
# in the template file.
|
# 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.
|
#We don't want to always generate the template file, but only when required.
|
||||||
IF(NOT WRITE_CONFIG_DONE)
|
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(${VAR_FORMAT})
|
||||||
IF(${IS_STR})
|
IF(${IS_STR})
|
||||||
IF(${FORCE_DEF})
|
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})
|
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(${FORCE_DEF})
|
||||||
ELSE(${IS_STR})
|
ELSE(${IS_STR})
|
||||||
IF(${FORCE_DEF})
|
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})
|
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(${FORCE_DEF})
|
||||||
ENDIF(${IS_STR})
|
ENDIF(${IS_STR})
|
||||||
ELSE(${VAR_FORMAT})
|
ELSE(${VAR_FORMAT})
|
||||||
@ -59,7 +59,7 @@ MACRO(APPEND_CONFIG_FILE NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT)
|
|||||||
${APPEND_STRING})
|
${APPEND_STRING})
|
||||||
ENDIF(NOT WRITE_CONFIG_DONE)
|
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
|
#define a name with value and
|
||||||
@ -68,7 +68,7 @@ MACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF)
|
|||||||
|
|
||||||
SET(${NAME} ${VALUE})
|
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)
|
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.
|
#write the line in template file.
|
||||||
MACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF)
|
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)
|
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}")
|
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)
|
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}")
|
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)
|
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})
|
OPTION(${NAME} "${DESC}" ${DEFAULT_VAL})
|
||||||
|
|
||||||
IF(${${NAME}} STREQUAL "OFF")
|
IF(${${NAME}} STREQUAL "OFF")
|
||||||
SET(${NAME} 0)
|
SET(${NAME}_VAL 0)
|
||||||
ELSE(${${NAME}} STREQUAL "OFF")
|
ELSE(${${NAME}} STREQUAL "OFF")
|
||||||
SET(${NAME} 1)
|
SET(${NAME}_VAL 1)
|
||||||
ENDIF(${${NAME}} STREQUAL "OFF")
|
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)
|
ENDMACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL)
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user