-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question][dev2] How to prevent CMakeUserPresets.json/CMakePresets.json from being generated? #484
Comments
According to the Conan2 Docs of CMakeToolchian and cmake_layout,
when using CMakeToolchain generator. The cause seems to be that cmake-conan/conan_support.cmake Lines 140 to 145 in c389ff9
Since How about:
So that |
@hwhsu1231 I was wondering the same thing (in our case it IS messing with cmake configurations when we do not want to), do you have a workaround to disable the |
I'd like to know a bit more, what kind of messing is causing. Is it an IDE-integration thing? There is a way to disable it in the recipe: def generate(self):
tc = CMakeToolchain(self)
tc.user_presets_path = False
tc.generate() |
After researching for a while, I think the generation of CMakeUserPresets.json would not make the Git repository messy. According to the CMake Documentation:
In other words, unless we forgot to add @memsharded - However, I want to confirm whether there is a way for Conan to disable the generation of
|
I'll second that it would be useful to have a way of disabling this on the command-line. My use-case is that I want this generated when running non-Docker builds, as it's used by my IDE, but want to disable it when I run a Docker build, as it adds an entry that is invalid outside of Docker. I suppose I could add an option to my recipe, so I can disable this with a |
Problem Description
I tried to write my own
CMakePresets.json
specifying-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake
to simplify the step of configuring the project.Click to expand CMakePresets.json
However, I found that there will be a
CMakeUserPresets.json
in the root directory and aCMakePresets.json
inside the build directory generated byconan install
command.Since the original design of Conan 2.0 is to first run
conan
and thencmake
, it seems that Conan 2.0 will generateCMakePresets.json
/CMakeUserPresets.json
for us to configure our CMake project. However, I think that I won't need these generated files when using cmake-conan because the starting point iscmake
now. Therefore, I wondered:How to prevent CMakeUserPresets.json/CMakePresets.json from being generated?
when consuming the packages.
Version and Environment
2.0.2
3.25.1
Steps to reproduce
Extract the following archived file.
cmake-conan-provider.zip
Call
vcvarsall.bat x64
to initialize the MSVC env:Run the following
cmake
command to configure the porject:Logs
Click to expand logs
The text was updated successfully, but these errors were encountered: