]> git.lyx.org Git - features.git/blobdiff - development/cmake/modules/LyXMacros.cmake
Cmake build: Add combo-values to the list of displayed lyx options
[features.git] / development / cmake / modules / LyXMacros.cmake
index dae7c5837f25c45a04a9403447f8c9d086adb935..4332830c251357430e3d648fe62ebcf0c8ed5367 100644 (file)
@@ -25,6 +25,8 @@
 #  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+include (MacroAddFileDependencies)
+
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
 
 macro(lyx_add_path _list _prefix)
@@ -39,9 +41,9 @@ endmacro(lyx_add_path _out _prefix)
 #create the implementation files from the ui files and add them
 #to the list of sources
 #usage: LYX_ADD_QT4_UI_FILES(foo_SRCS ${ui_files})
-macro(LYX_ADD_UI_FILES _sources _ui)
+macro(LYX_ADD_UI_FILES _sources _ui_files)
+       set(uifiles})
        foreach (_current_FILE ${ARGN})
-
                get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
                get_filename_component(_basename ${_tmp_FILE} NAME_WE)
                set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h)
@@ -51,9 +53,10 @@ macro(LYX_ADD_UI_FILES _sources _ui)
                # ######
                # Latest test showed on linux and windows show no bad consequeces,
                # so we removed the call to LyXuic.cmake
-               qt4_wrap_ui(${_header} ${_tmp_FILE} OPTIONS -tr lyx::qt_)
-               set(${_ui} ${${_ui}} ${_header})
-       endforeach (_current_FILE)
+               qt_wrap_uifiles(${_header} ${_tmp_FILE} OPTIONS -tr lyx::qt_)
+               list(APPEND uifiles ${_header})
+       endforeach()
+       set(${_ui_files} ${uifiles})
 endmacro(LYX_ADD_UI_FILES)
 
 
@@ -171,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}})
@@ -230,6 +233,13 @@ 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})
+  set(LYX_${_name}_show_message ON)
+  set(LYX_${_name}_description ${_description})
+endmacro()
 
 macro(LYX_OPTION_LIST_ALL)
        if(UNIX)
@@ -247,7 +257,10 @@ macro(LYX_OPTION_LIST_ALL)
        foreach(_option ${LYX_OPTIONS})
                if(${_option}_show_message OR ${ARGV0} STREQUAL "help")
                        string(SUBSTRING "${_option}                            " 0 25 _var)
-                       if(${_option})
+                        get_property(_prop CACHE ${_option} PROPERTY STRINGS)
+                        if(_prop)
+                          set(_isset ${${_option}})
+                       elseif(${_option})
                                set(_isset ON)
                        else()
                                set(_isset OFF)
@@ -288,3 +301,23 @@ macro(lyx_find_info_files group files)
        file(GLOB _filelist ${files})
        lyx_add_info_files(${group} ${_filelist})
 endmacro()
+
+macro(settestlabel testname)
+  get_property(_lab_list TEST ${testname} PROPERTY LABELS)
+  if(_lab_list)
+    list(APPEND _lab_list "${ARGN}")
+  else()
+    set(_lab_list "${ARGN}")
+  endif()
+  list(REMOVE_DUPLICATES _lab_list)
+  set_tests_properties(${testname} PROPERTIES LABELS "${_lab_list}")
+endmacro()
+
+macro(setmarkedtestlabel testname reverted)
+  if(reverted)
+    settestlabel(${testname} "reverted" ${ARGN})
+  else()
+    settestlabel(${testname} ${ARGN})
+  endif()
+endmacro()
+