qtuic.cmake
978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# @brief Creates the qt5 ui_ headers for the specified designer files.
# @param SRC_LIST The current source list of the project, to which to add the created moc files.
# @param UIC_LIST The list of designer files for which to create qt5 headers.
macro(create_ui SRC_LIST UIC_LIST)
message( STATUS "${PROJECT_NAME} Creating headers for: ${ARGN}")
set( UICABLE_LIST
${ARGN}
)
# Empty the UIC_LIST variable
set( ${UIC_LIST}
)
# Create the UIC_LIST
QT6_WRAP_UI( ${UIC_LIST} ${UICABLE_LIST} )
# Append SRC_LIST with UIC_LIST
list ( APPEND SRC_LIST
${${UIC_LIST}}
)
# Avoid warnings by including a generated header file.
include_directories( ${SYSTEMORNOT}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}
)
message( STATUS "${PROJECT_NAME} UIC_LIST: ${${UIC_LIST}}")
message( STATUS "${PROJECT_NAME} SRC_LIST: ${${SRC_LIST}}")
set_source_files_properties(
${${UIC_LIST}}
PROPERTIES
COMPILE_FLAGS -Wno-undefined-reinterpret-cast
)
endmacro()