]> git.lyx.org Git - features.git/commitdiff
Cmake build: Added convenience macro LYX_COMBO
authorKornel Benko <kornel@lyx.org>
Sat, 7 Jun 2014 08:45:13 +0000 (10:45 +0200)
committerKornel Benko <kornel@lyx.org>
Sat, 7 Jun 2014 08:45:13 +0000 (10:45 +0200)
Will be used later to allow selection between multiple alternatives.

CMakeLists.txt
development/cmake/modules/LyXMacros.cmake

index 5e403abc27e8bc8efdbe4fec86d2cdcbcccf3923..8f1047951aa650b204da32559db6ee333fe25c93 100644 (file)
@@ -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)
 
 
index 2ef578900b668d9ec231df87d80277dfacedab20..2bddaaf079645d37fe499bf24b2af57d8bc9e8cf 100644 (file)
@@ -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)