Changeset 135 in pacpusframework
- Timestamp:
- Jul 30, 2013, 3:15:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/cmake/PacpusUtilities.cmake
r134 r135 8 8 ################################################# 9 9 10 11 # TODO Compatibility macro12 10 ## ======================================== 13 11 ## Qt macro compatibility Qt4 / Qt5 14 12 ## ======================================== 15 13 function(qt_wrap_cpp OUT_MOC_SRCS FILES_TO_MOC) 16 17 if(QT4_FOUNDED) 14 if(QT4_FOUND) 18 15 qt4_wrap_cpp(MOC_SRCS ${FILES_TO_MOC}) 19 20 16 elseif(Qt5Core_FOUND) 21 17 qt5_wrap_cpp(MOC_SRCS ${FILES_TO_MOC}) 22 23 18 else() 24 19 message(WARNING "QT not found, can't wrap moc File") … … 26 21 27 22 set(${OUT_MOC_SRCS} ${MOC_SRCS} PARENT_SCOPE) 28 29 23 endfunction(qt_wrap_cpp) 30 24 … … 35 29 if(QT4_FOUND) 36 30 qt4_wrap_ui( UI_SRCS ${UI_FILES}) 37 38 31 elseif(Qt5Core_FOUND) 39 32 qt5_wrap_ui( UI_SRCS ${UI_FILES}) 40 41 33 else() 42 34 message(WARNING "QT not found, can't wrap ui File") … … 44 36 45 37 set(${OUT_UI_SRCS} ${UI_SRCS} PARENT_SCOPE) 46 47 38 endfunction() 48 39 … … 51 42 # ======================================== 52 43 function(PACPUS_PLUGIN OUT_CPP OUT_H PLUGIN_NAME) 53 54 44 if(QT4_FOUND) 55 45 pacpus_plugin_qt4(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} ) 56 #message("Create QT4 Plugin")57 58 46 elseif(Qt5Core_FOUND) 59 47 pacpus_plugin_qt5(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} ) 60 61 48 else() 62 49 message(WARNING "QT not found, can't create Plugin") … … 65 52 set(${OUT_CPP} ${PLUGIN_CPP} PARENT_SCOPE) 66 53 set(${OUT_H} ${PLUGIN_H} PARENT_SCOPE) 67 68 54 endfunction(PACPUS_PLUGIN) 69 55 … … 72 58 # ======================================== 73 59 function(PACPUS_PLUGIN_QT4 OUT_CPP OUT_H PLUGIN_NAME) 74 75 60 set(PLUGIN_NAME ${PLUGIN_NAME}Plugin) 76 61 set(${OUT_CPP} ${PLUGIN_NAME}.cpp PARENT_SCOPE) … … 139 124 # ======================================== 140 125 function(PACPUS_PLUGIN_QT5 OUT_CPP OUT_H PLUGIN_NAME) 141 142 126 set(PLUGIN_NAME ${PLUGIN_NAME}Plugin) 143 127 set(${OUT_CPP} ${PLUGIN_NAME}.cpp ${PLUGIN_NAME}.json PARENT_SCOPE) … … 166 150 " Q_OBJECT\n" 167 151 " //Qt5 Plugins Macro\n" 168 " Q_PLUGIN_METADATA(IID \"pa pus." ${PLUGIN_NAME} "\" FILE \"" ${PLUGIN_NAME} ".json\")\n"152 " Q_PLUGIN_METADATA(IID \"pacpus." ${PLUGIN_NAME} "\" FILE \"" ${PLUGIN_NAME} ".json\")\n" 169 153 " Q_INTERFACES(PacpusPluginInterface)\n" 170 154 "\n" … … 208 192 " \"Keys\": [\""${PLUGIN_NAME} "\"]\n" 209 193 "}\n" 210 194 ) 211 195 endfunction(PACPUS_PLUGIN_QT5) 212 196
Note:
See TracChangeset
for help on using the changeset viewer.