]> git.lyx.org Git - features.git/blobdiff - development/cmake/modules/LyXMacros.cmake
build with mingw on Windows and Linux
[features.git] / development / cmake / modules / LyXMacros.cmake
index 266a76f03c990036729d9a3ae038abbf33478398..2ef578900b668d9ec231df87d80277dfacedab20 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,11 +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
-               add_custom_command(OUTPUT ${_header}
-        COMMAND ${QT_UIC_EXECUTABLE} -tr lyx::qt_ ${_tmp_FILE} -o ${_header}
-                       MAIN_DEPENDENCY ${_tmp_FILE})
-               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)
 
 
@@ -290,3 +291,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()
+