macro(LYX_OPTION_INIT)
set(LYX_OPTIONS)
+ set(LYX_OPTION_STRINGS)
endmacro()
set(${_lyx_name}_show_message ON)
string(REGEX REPLACE ";" " " _use_list "${_combo_list}")
set(${_lyx_name}_description "${_description} (${_use_list})")
+ list(APPEND LYX_OPTION_STRINGS ${_lyx_name})
# Now check the value
list(FIND _combo_list ${${_lyx_name}} _idx)
if (_idx LESS 0)
endif()
endmacro()
+macro(LYX_STRING _name _description _default)
+ set(_lyx_name "LYX_${_name}")
+ list(APPEND LYX_OPTIONS ${_lyx_name})
+ set(${_lyx_name}_show_message ON)
+ set(${_lyx_name}_description "${_description}")
+ list(APPEND LYX_OPTION_STRINGS ${_lyx_name})
+ # Now check the value
+ # Should not contain ' '
+ set(tmp_lyx_name ${${_lyx_name}})
+ if (NOT "${${_lyx_name}}" STREQUAL "")
+ if (NOT "${tmp_lyx_name}" MATCHES "^\\..*$")
+ set(tmp_lyx_name ".${tmp_lyx_name}")
+ endif()
+ if (NOT "${tmp_lyx_name}" MATCHES "^\\.[a-zA-Z_\\.]+$")
+ message(FATAL_ERROR "Invalid string for lyx suffix (${tmp_lyx_name})")
+ endif()
+ endif()
+ set(${_lyx_name} "${tmp_lyx_name}" CACHE STRING "${_description}" FORCE)
+endmacro()
+
macro(LYX_OPTION_LIST_ALL)
if(UNIX)
set(run_cmake ${CMAKE_BINARY_DIR}/run_cmake.sh)
if(${_option}_show_message OR ${ARGV0} STREQUAL "help")
string(SUBSTRING "${_option} " 0 25 _var)
get_property(_prop CACHE ${_option} PROPERTY STRINGS)
- if(_prop)
+ list(FIND LYX_OPTION_STRINGS ${_option} _index)
+ if (${_index} GREATER -1)
+ #message(STATUS "${_option} is of type string")
set(_isset ${${_option}})
elseif(${_option})
set(_isset ON)