blob: 0626b18a62963d9bbfafbee0b41315c60e446311 (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#
# Resolve dependencies
#
if (NOT MAIN_DEP_FILE)
message(FATAL_ERROR "MAIN_DEP_FILE file not specified")
endif()
if (NOT QT_INSTALL_DIR)
message(FATAL_ERROR "QT_INSTALL_DIR was not specified")
endif()
if (NOT OUTPUT_FILE)
message(FATAL_ERROR "OUTPUT_FILE not specified")
endif()
# Read main dep file
if (NOT EXISTS "${MAIN_DEP_FILE}")
message(FATAL_ERROR "${MAIN_DEP_FILE} does not exist")
endif()
file(STRINGS "${MAIN_DEP_FILE}" remaining)
set(metatypes_list)
while(remaining)
# Pop element off the list
list(POP_FRONT remaining current)
string(REPLACE "=" ";" file_list "${current}")
list(GET file_list 0 metatypes_file)
list(GET file_list 1 metatypes_dep_file)
if (NOT IS_ABSOLUTE "${metatypes_file}")
set(metatypes_file "${QT_INSTALL_DIR}/${metatypes_file}")
set(metatypes_dep_file "${QT_INSTALL_DIR}/${metatypes_dep_file}")
endif()
if (NOT EXISTS "${metatypes_file}")
message(FATAL_ERROR "${metatypes_file} does not exist")
endif()
if (NOT EXISTS "${metatypes_dep_file}")
message(FATAL_ERROR "${metatypes_dep_file} does not exist")
endif()
list(APPEND metatypes_list "${metatypes_file}")
file(STRINGS ${metatypes_dep_file} dep_string)
if (dep_string)
list(APPEND remaining "${dep_string}")
endif()
endwhile()
list(REMOVE_DUPLICATES metatypes_list)
list(JOIN metatypes_list "," metatypes)
if (metatypes)
file(WRITE ${OUTPUT_FILE} "--foreign-types=${metatypes}\n")
else()
file(WRITE ${OUTPUT_FILE} "\n")
endif()
|