File tree Expand file tree Collapse file tree
crates/qt-build-utils/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,8 +99,30 @@ impl TryFrom<PathBuf> for QtInstallationQMake {
9999}
100100
101101impl QtInstallation for QtInstallationQMake {
102- fn include_paths ( & self , _qt_modules : & [ String ] ) -> Vec < PathBuf > {
103- todo ! ( )
102+ fn include_paths ( & self , qt_modules : & [ String ] ) -> Vec < PathBuf > {
103+ let root_path = self . qmake_query ( "QT_INSTALL_HEADERS" ) ;
104+ let lib_path = self . qmake_query ( "QT_INSTALL_LIBS" ) ;
105+ let mut paths = Vec :: new ( ) ;
106+ for qt_module in qt_modules {
107+ // Add the usual location for the Qt module
108+ paths. push ( format ! ( "{root_path}/Qt{qt_module}" ) ) ;
109+
110+ // Ensure that we add any framework's headers path
111+ let header_path = format ! ( "{lib_path}/Qt{qt_module}.framework/Headers" ) ;
112+ if utils:: is_apple_target ( ) && Path :: new ( & header_path) . exists ( ) {
113+ paths. push ( header_path) ;
114+ }
115+ }
116+
117+ // Add the QT_INSTALL_HEADERS itself
118+ paths. push ( root_path) ;
119+
120+ paths
121+ . iter ( )
122+ . map ( PathBuf :: from)
123+ // Only add paths if they exist
124+ . filter ( |path| path. exists ( ) )
125+ . collect ( )
104126 }
105127
106128 fn link_modules ( & self , builder : & mut cc:: Build , qt_modules : & [ String ] ) {
Original file line number Diff line number Diff line change @@ -411,29 +411,7 @@ impl QtBuild {
411411 /// Get the include paths for Qt, including Qt module subdirectories. This is intended
412412 /// to be passed to whichever tool you are using to invoke the C++ compiler.
413413 pub fn include_paths ( & self ) -> Vec < PathBuf > {
414- let root_path = self . qmake_query ( "QT_INSTALL_HEADERS" ) ;
415- let lib_path = self . qmake_query ( "QT_INSTALL_LIBS" ) ;
416- let mut paths = Vec :: new ( ) ;
417- for qt_module in & self . qt_modules {
418- // Add the usual location for the Qt module
419- paths. push ( format ! ( "{root_path}/Qt{qt_module}" ) ) ;
420-
421- // Ensure that we add any framework's headers path
422- let header_path = format ! ( "{lib_path}/Qt{qt_module}.framework/Headers" ) ;
423- if utils:: is_apple_target ( ) && Path :: new ( & header_path) . exists ( ) {
424- paths. push ( header_path) ;
425- }
426- }
427-
428- // Add the QT_INSTALL_HEADERS itself
429- paths. push ( root_path) ;
430-
431- paths
432- . iter ( )
433- . map ( PathBuf :: from)
434- // Only add paths if they exist
435- . filter ( |path| path. exists ( ) )
436- . collect ( )
414+ self . qt_installation . include_paths ( & self . qt_modules )
437415 }
438416
439417 /// Version of the detected Qt installation
You can’t perform that action at this time.
0 commit comments