File tree 4 files changed +43
-2
lines changed
4 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,12 @@ messages.after-failure = ""
307
307
# A message to print after a successful build.
308
308
messages.after-success = " "
309
309
310
+ # Add the wheel install path to the CMake prefix paths.
311
+ search.use-install-prefix = true
312
+
313
+ # Add the wheel build path to the CMake prefix paths.
314
+ search.use-build-prefix = true
315
+
310
316
# List dynamic metadata fields and hook locations in this table.
311
317
metadata = {}
312
318
Original file line number Diff line number Diff line change @@ -132,10 +132,12 @@ def configure(
132
132
133
133
# Add site-packages to the prefix path for CMake
134
134
site_packages = Path (sysconfig .get_path ("purelib" ))
135
- self .config .prefix_dirs .append (site_packages )
135
+ if self .settings .search .use_install_prefix :
136
+ self .config .prefix_dirs .append (site_packages )
136
137
logger .debug ("SITE_PACKAGES: {}" , site_packages )
137
138
if site_packages != DIR .parent .parent :
138
- self .config .prefix_dirs .append (DIR .parent .parent )
139
+ if self .settings .search .use_build_prefix :
140
+ self .config .prefix_dirs .append (DIR .parent .parent )
139
141
logger .debug ("Extra SITE_PACKAGES: {}" , site_packages )
140
142
141
143
# Add the FindPython backport if needed
Original file line number Diff line number Diff line change 93
93
}
94
94
}
95
95
},
96
+ "search" : {
97
+ "additionalProperties" : false ,
98
+ "properties" : {
99
+ "use-build-prefix" : {
100
+ "default" : true ,
101
+ "description" : " Add the wheel build path to the CMake prefix paths." ,
102
+ "type" : " boolean"
103
+ },
104
+ "use-install-prefix" : {
105
+ "default" : true ,
106
+ "description" : " Add the wheel install path to the CMake prefix paths." ,
107
+ "type" : " boolean"
108
+ }
109
+ },
110
+ "type" : " object"
111
+ },
96
112
"ninja" : {
97
113
"type" : " object" ,
98
114
"additionalProperties" : false ,
599
615
"metadata" : {
600
616
"$ref" : " #/properties/metadata"
601
617
},
618
+ "search" : {
619
+ "$ref" : " #/properties/search"
620
+ },
602
621
"strict-config" : {
603
622
"$ref" : " #/properties/strict-config"
604
623
},
Original file line number Diff line number Diff line change @@ -80,6 +80,19 @@ class CMakeSettings:
80
80
"""
81
81
82
82
83
+ @dataclasses .dataclass
84
+ class SearchSettings :
85
+ use_install_prefix : bool = True
86
+ """
87
+ Add the wheel install path to the CMake prefix paths.
88
+ """
89
+
90
+ use_build_prefix : bool = True
91
+ """
92
+ Add the wheel build path to the CMake prefix paths.
93
+ """
94
+
95
+
83
96
@dataclasses .dataclass
84
97
class NinjaSettings :
85
98
minimum_version : Optional [Version ] = None
@@ -325,6 +338,7 @@ class ScikitBuildSettings:
325
338
install : InstallSettings = dataclasses .field (default_factory = InstallSettings )
326
339
generate : List [GenerateSettings ] = dataclasses .field (default_factory = list )
327
340
messages : MessagesSettings = dataclasses .field (default_factory = MessagesSettings )
341
+ search : SearchSettings = dataclasses .field (default_factory = SearchSettings )
328
342
329
343
metadata : Dict [str , Dict [str , Any ]] = dataclasses .field (default_factory = dict )
330
344
"""
You can’t perform that action at this time.
0 commit comments