Skip to content

Commit a5b65ea

Browse files
committed
ENH: Refine Qt6 include path resolution for macOS framework support
Enhance include directory parsing to handle macOS-specific framework paths, stripping `.framework/Headers` or `.framework` suffixes when appropriate. Ensure accurate and duplicate-free Qt6 include path collection.
1 parent 986707e commit a5b65ea

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

generator/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,28 @@ set(ALL_QT6_INCLUDE_DIRS)
9191
foreach(qt_target IN LISTS QT6_COMPONENTS_FOUND)
9292
get_target_property(_incs ${qt_target} INTERFACE_INCLUDE_DIRECTORIES)
9393
if(_incs)
94-
list(APPEND ALL_QT6_INCLUDE_DIRS ${_incs})
94+
foreach(_inc IN LISTS _incs)
95+
# Check if the string ends with ".framework/Headers"
96+
if(_inc MATCHES "\\.framework/Headers$")
97+
# Remove the suffix
98+
string(REGEX REPLACE "/[^/]+\\.framework/Headers$" "" framework_path "${_inc}")
99+
list(APPEND ALL_QT6_INCLUDE_DIRS ${framework_path})
100+
elseif(_inc MATCHES "\\.framework$")
101+
# Remove the suffix
102+
string(REGEX REPLACE "/[^/]+\\.framework$" "" framework_path "${_inc}")
103+
list(APPEND ALL_QT6_INCLUDE_DIRS ${framework_path})
104+
else()
105+
list(APPEND ALL_QT6_INCLUDE_DIRS ${_inc})
106+
endif()
107+
endforeach()
108+
95109
endif()
96110
endforeach()
97111
unset(QT6_COMPONENTS_FOUND)
98112

99113
# Optionally remove duplicates
100114
list(REMOVE_DUPLICATES ALL_QT6_INCLUDE_DIRS)
101115

102-
103116
# Copy resource to the build tree
104117
message(STATUS "Copying resource files from ${CMAKE_CURRENT_LIST_DIR} to ${CMAKE_CURRENT_BINARY_DIR}")
105118
file(GLOB resources_files *.txt *.xml qtscript_masterinclude.h)

0 commit comments

Comments
 (0)