Blame view

qtmoc.cmake 812 Bytes
772ec5a4   Peter M. Groen   Added cmake envir...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  # @brief Creates the qt5 mocs for the specified header files.
  # @param SRC_LIST The current source list of the project, to which to add the created moc files.
  # @param MOC_LIST The list of header files for which to create qt5 mocs.
  macro(create_mocs SRC_LIST MOC_LIST)
  
  message( STATUS "${PROJECT_NAME} Creating mocs for: ${ARGN}")
  
  set( MOCABLE_LIST
      ${ARGN}
  )
  
  # Empty the MOC_LIST variable
  set( ${MOC_LIST}
  )
  
  # Create the MOC_LIST
7fb8f0ba   Steven de Ridder   updated to qt6
17
  QT6_WRAP_CPP( ${MOC_LIST} ${MOCABLE_LIST} )
772ec5a4   Peter M. Groen   Added cmake envir...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  
  # Append SRC_LIST with MOC_LIST
  list ( APPEND SRC_LIST
      ${${MOC_LIST}}
  )
  
  message( STATUS "${PROJECT_NAME} MOC_LIST: ${${MOC_LIST}}")
  message( STATUS "${PROJECT_NAME} SRC_LIST: ${${SRC_LIST}}")
  
  set_source_files_properties(
      ${${MOC_LIST}}
      PROPERTIES
          COMPILE_FLAGS -Wno-undefined-reinterpret-cast
  )
  
  endmacro()