Changeset 139 in pacpusframework for branches/2.0-beta1/cmake


Ignore:
Timestamp:
Jul 30, 2013, 4:47:01 PM (11 years ago)
Author:
Marek Kurdej
Message:

Fixed: qt_wrap_ui, qt_wrap_moc compatibility macros for Qt4/Qt5.
Added: qt_add_resources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/cmake/PacpusUtilities.cmake

    r135 r139  
    1111## Qt macro compatibility Qt4 / Qt5
    1212## ========================================
    13 function(qt_wrap_cpp OUT_MOC_SRCS FILES_TO_MOC)
     13function(qt_wrap_cpp OUT_MOC_SRCS)
     14    set(FILES_TO_MOC ${ARGN})
    1415    if(QT4_FOUND)
    1516        qt4_wrap_cpp(MOC_SRCS ${FILES_TO_MOC})
     
    1718        qt5_wrap_cpp(MOC_SRCS ${FILES_TO_MOC})
    1819    else()
    19         message(WARNING "QT not found, can't wrap moc File")
     20        message(WARNING "QT not found, cannot wrap moc files")
    2021    endif()
    2122
     
    2627## Qt macro compatibility Qt4 / Qt5
    2728## ========================================
    28 function(qt_wrap_ui OUT_UI_SRCS UI_FILES)
     29function(qt_wrap_ui OUT_UI_SRCS)
     30    set(UI_FILES ${ARGN})
    2931    if(QT4_FOUND)
    3032        qt4_wrap_ui( UI_SRCS ${UI_FILES})
     
    3234        qt5_wrap_ui( UI_SRCS ${UI_FILES})
    3335    else()
    34         message(WARNING "QT not found, can't wrap ui File")
     36        message(WARNING "QT not found, cannot wrap ui files")
    3537    endif()
    3638
    3739    set(${OUT_UI_SRCS} ${UI_SRCS} PARENT_SCOPE)
     40endfunction()
     41
     42## ========================================
     43## Qt macro compatibility Qt4 / Qt5
     44## ========================================
     45function(qt_add_resources OUT_RESOURCES)
     46    set(RCS_FILES ${ARGN})
     47    if(QT4_FOUND)
     48        qt4_add_resources( RESOURCES ${RCS_FILES})
     49    elseif(Qt5Core_FOUND)
     50        qt5_add_resources( RESOURCES ${RCS_FILES})
     51    else()
     52        message(WARNING "QT not found, cannot add resources")
     53    endif()
     54
     55    set(${OUT_RESOURCES} ${RESOURCES} PARENT_SCOPE)
    3856endfunction()
    3957
Note: See TracChangeset for help on using the changeset viewer.