[feature] location of the generated CMakeUserPresets.json
See original GitHub issueThe Conan documentation states:
If you declare a layout() in the recipe and your CMakeLists.txt file is found in the conanfile.source_folder folder, Conan will place a CMakeUserPresets.json to include the CMakePresets.json generated with the above specification.
However, there is no way to set the source folder from the conan install
command. Besides the obvious use case to override the defaults from the command line, such an option could also be useful in big projects to select which directory with CMakeLists.txt should be used as an entry point for CMake build. For example, if I have several standalone subprojects in the tree and only one conanfile.py to define the dependencies with conan install --source-folder
I could control where the CMakeUserPresets.json
is being generated and then build such a subproject in isolation using CMake presets.
Alternatively, CMakeUserPresets.json
could be generated in the path of conan install
invocation, but probably this is a worse solution.
- I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
I would just like to add another observation. I have been using
CMakeSettings.json
which is Visual Studio specific and a kind of precursor forCMakePresets.json
. Since the latest VS 2022 Microsoft is officially promoting usingCMakePresets.json
instead ofCMakeSettings.json
which is definitely a good move.However, the way
CMakeSettings.json
were andCMakePresets.json
are supposed to be used in VS IDE is quite different from whatconan
expects. So basically neitherconan
generatedCMakePresets.json
, norCMakeUserPresets.json
are really useful (in VS IDE context) and one would rather want a handcraftedCMakePresets.json
which will includeconan_toolchain.cmake
as it did before, and would not want havingconan
messing with that. So an option to not generate those files could be useful too.Hi, I renamed the issue and assigned it to the next release just to think about it. If we come up with some idea we could implement something.