|
6 | 6 |
|
7 | 7 | include_guard(GLOBAL)
|
8 | 8 |
|
9 |
| -# find_qt: Macro to find best possible Qt version for use with the project: |
10 |
| -macro(find_qt) |
11 |
| - set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC COMPONENTS_LINUX) |
12 |
| - cmake_parse_arguments(find_qt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) |
13 |
| - |
14 |
| - # Do not use versionless targets in the first step to avoid Qt::Core being clobbered by later opportunistic |
15 |
| - # find_package runs |
16 |
| - set(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE) |
17 |
| - |
18 |
| - message(DEBUG "Attempting to find Qt 6") |
19 |
| - find_package( |
20 |
| - Qt6 |
21 |
| - COMPONENTS Core |
22 |
| - REQUIRED) |
23 |
| - |
24 |
| - # Enable versionless targets for the remaining Qt components |
25 |
| - set(QT_NO_CREATE_VERSIONLESS_TARGETS FALSE) |
26 |
| - |
27 |
| - set(qt_components ${find_qt_COMPONENTS}) |
28 |
| - if(OS_WINDOWS) |
29 |
| - list(APPEND qt_components ${find_qt_COMPONENTS_WIN}) |
30 |
| - elseif(OS_MACOS) |
31 |
| - list(APPEND qt_components ${find_qt_COMPONENTS_MAC}) |
32 |
| - else() |
33 |
| - list(APPEND qt_components ${find_qt_COMPONENTS_LINUX}) |
34 |
| - endif() |
35 |
| - message(DEBUG "Trying to find Qt components ${qt_components}...") |
36 |
| - |
37 |
| - find_package(Qt6 REQUIRED ${qt_components}) |
38 |
| - |
39 |
| - list(APPEND qt_components Core) |
40 |
| - |
41 |
| - if("Gui" IN_LIST find_qt_COMPONENTS_LINUX) |
42 |
| - list(APPEND qt_components "GuiPrivate") |
43 |
| - endif() |
44 |
| - |
45 |
| - # Check for versionless targets of each requested component and create if necessary |
46 |
| - foreach(component IN LISTS qt_components) |
47 |
| - message(DEBUG "Checking for target Qt::${component}") |
48 |
| - if(NOT TARGET Qt::${component} AND TARGET Qt6::${component}) |
49 |
| - add_library(Qt::${component} INTERFACE IMPORTED) |
50 |
| - set_target_properties(Qt::${component} PROPERTIES INTERFACE_LINK_LIBRARIES Qt6::${component}) |
51 |
| - endif() |
52 |
| - set_property(TARGET Qt::${component} PROPERTY INTERFACE_COMPILE_FEATURES "") |
53 |
| - endforeach() |
54 |
| - |
55 |
| -endmacro() |
56 |
| - |
57 | 9 | # check_uuid: Helper function to check for valid UUID
|
58 | 10 | function(check_uuid uuid_string return_value)
|
59 | 11 | set(valid_uuid TRUE)
|
|
0 commit comments