@@ -87,7 +87,7 @@ def _install_dependencies(self, *, update: bool = False, groups: list[str] | Non
8787 raise ProviderInstallationError ('conan' , f'Failed to prepare { operation } environment: { e } ' , e ) from e
8888
8989 try :
90- build_types = [ 'Release' , 'Debug' ]
90+ build_types = self . data . build_types
9191 for build_type in build_types :
9292 logger .info ('Installing dependencies for build type: %s' , build_type )
9393 self ._run_conan_install (conanfile_path , update , build_type , logger )
@@ -161,6 +161,13 @@ def _run_conan_install(self, conanfile_path: Path, update: bool, build_type: str
161161 # Build conan install command arguments
162162 command_args = ['install' , str (conanfile_path )]
163163
164+ # Use build_path as the output folder directly
165+ output_folder = self .core_data .cppython_data .build_path
166+ command_args .extend (['--output-folder' , str (output_folder )])
167+
168+ # Override cmake_layout's default 'build' subfolder to normalize path structure
169+ command_args .extend (['-c' , 'tools.cmake.cmake_layout:build_folder=.' ])
170+
164171 # Add build missing flag
165172 command_args .extend (['--build' , 'missing' ])
166173
@@ -276,6 +283,8 @@ def _create_cmake_sync_data(self) -> CMakeSyncData:
276283 Returns:
277284 CMakeSyncData configured for Conan integration
278285 """
286+ # With tools.cmake.cmake_layout:build_folder=. and --output-folder=build_path,
287+ # generators are placed directly in build_path/generators/
279288 conan_toolchain_path = self .core_data .cppython_data .build_path / 'generators' / 'conan_toolchain.cmake'
280289
281290 return CMakeSyncData (
0 commit comments