Cmake build: Added convenience macro LYX_COMBO

Will be used later to allow selection between multiple alternatives.
This commit is contained in:
Kornel Benko 2014-06-07 10:45:13 +02:00
parent 6b4c3036aa
commit 8c0e1b5c70
2 changed files with 13 additions and 1 deletions

View File

@ -89,6 +89,11 @@ include(LyXMacros)
# 3. parameter: default value, ON or OFF # 3. parameter: default value, ON or OFF
# 4. parameter: system on which option is used: ALL, GCC, MSVC, ... # 4. parameter: system on which option is used: ALL, GCC, MSVC, ...
# Usage LYX_COMBO
# 1. parameter: name without prefix 'LYX_'
# 2. parameter: description
# 3. parameter: default value
# 4-n parameter: possible other string values
LYX_OPTION_INIT() LYX_OPTION_INIT()
@ -135,6 +140,7 @@ LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC)
# APPLE specific # APPLE specific
LYX_OPTION(DMG "Build as Mac bundle, needed for .dmg (experimental) " OFF MAC) LYX_OPTION(DMG "Build as Mac bundle, needed for .dmg (experimental) " OFF MAC)
LYX_OPTION(COCOA "Use Cocoa on Mac" OFF MAC) LYX_OPTION(COCOA "Use Cocoa on Mac" OFF MAC)
LYX_COMBO(USE_QT "Use Qt version as frontend (QT4 QT5)" QT4 QT5)
if(help OR HELP) if(help OR HELP)
@ -836,6 +842,7 @@ endif()
message(STATUS) message(STATUS)
message(STATUS "Build options, switch LYX_* variables by -DLYX_*=ON or OFF:") message(STATUS "Build options, switch LYX_* variables by -DLYX_*=ON or OFF:")
message(STATUS) message(STATUS)
LYX_OPTION_LIST_ALL(used) LYX_OPTION_LIST_ALL(used)

View File

@ -174,7 +174,7 @@ macro(lyx_const_touched_files _allinone_name _list)
else() else()
lyx_add_info_files(MergedFiles ${${_list}}) lyx_add_info_files(MergedFiles ${${_list}})
endif() endif()
set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files}) set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files})
foreach (_current_FILE ${${_list}}) foreach (_current_FILE ${${_list}})
@ -233,6 +233,11 @@ macro(LYX_OPTION _name _description _default _sys)
set(LYX_${_name}_show_message ${_msg}) set(LYX_${_name}_show_message ${_msg})
endmacro() endmacro()
macro(LYX_COMBO _name _description _default)
set(LYX_${_name} ${_default} CACHE STRING "${_description}")
set_property(CACHE LYX_${_name} PROPERTY STRINGS ${_default} ${ARGN})
list(APPEND LYX_OPTIONS LYX_${_name})
endmacro()
macro(LYX_OPTION_LIST_ALL) macro(LYX_OPTION_LIST_ALL)
if(UNIX) if(UNIX)