]> git.lyx.org Git - features.git/blobdiff - development/cmake/modules/LyXMacros.cmake
Cmake build: Added convenience macro LYX_COMBO
[features.git] / development / cmake / modules / LyXMacros.cmake
index 48e29d8031f5ffc195276f37b3d05117a6d98f6d..2bddaaf079645d37fe499bf24b2af57d8bc9e8cf 100644 (file)
@@ -41,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)
@@ -54,8 +54,9 @@ 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
                qt_wrap_uifiles(${_header} ${_tmp_FILE} OPTIONS -tr lyx::qt_)
-               set(${_ui} ${${_ui}} ${_header})
-       endforeach (_current_FILE)
+               list(APPEND uifiles ${_header})
+       endforeach()
+       set(${_ui_files} ${uifiles})
 endmacro(LYX_ADD_UI_FILES)
 
 
@@ -173,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}})
@@ -232,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)