From: Kornel Benko Date: Sat, 7 Jun 2014 08:45:13 +0000 (+0200) Subject: Cmake build: Added convenience macro LYX_COMBO X-Git-Tag: 2.2.0alpha1~1855 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8c0e1b5c70b72bf1bdc23764890c742f6e88add6;p=features.git Cmake build: Added convenience macro LYX_COMBO Will be used later to allow selection between multiple alternatives. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e403abc27..8f1047951a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,11 @@ include(LyXMacros) # 3. parameter: default value, ON or OFF # 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() @@ -135,6 +140,7 @@ LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC) # APPLE specific LYX_OPTION(DMG "Build as Mac bundle, needed for .dmg (experimental) " 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) @@ -836,6 +842,7 @@ endif() message(STATUS) message(STATUS "Build options, switch LYX_* variables by -DLYX_*=ON or OFF:") message(STATUS) + LYX_OPTION_LIST_ALL(used) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index 2ef578900b..2bddaaf079 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -174,7 +174,7 @@ macro(lyx_const_touched_files _allinone_name _list) else() lyx_add_info_files(MergedFiles ${${_list}}) endif() - + set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files}) foreach (_current_FILE ${${_list}}) @@ -233,6 +233,11 @@ macro(LYX_OPTION _name _description _default _sys) set(LYX_${_name}_show_message ${_msg}) 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) if(UNIX)