Kaynağa Gözat

ENH: Support .hpp with automoc.

Clinton Stimpson 17 yıl önce
ebeveyn
işleme
dda19cd36f
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      Modules/FindQt4.cmake

+ 5 - 1
Modules/FindQt4.cmake

@@ -1167,7 +1167,11 @@ IF (QT4_QMAKE_FOUND)
                FOREACH (_current_MOC_INC ${_match})
                   STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
                   GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
-                  SET(_header ${_abs_PATH}/${_basename}.h)
+                  IF(EXISTS ${_abs_PATH}/${_basename}.hpp)
+                    SET(_header ${_abs_PATH}/${_basename}.hpp)
+                  ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp)
+                    SET(_header ${_abs_PATH}/${_basename}.h)
+                  ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp)
                   SET(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
                   QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
                   MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})