Closed firaatozkan closed 1 year ago
Maybe if you could, could you delete the ConanPresets.json and run the commands in the "run_example.py" step by step? I think you will agree with me then.
Cheers, Fırat
Hi @firaatozkan
Not sure what you mean. The example you are changing has CI enabled, it is being tested and it seems to work fine, while your changes seems to break it, you can have a look to https://ci.conan.io/blue/organizations/jenkins/Examples2.0/detail/PR-88/1/pipeline
What ConanPresets.json
is to be deleted, there is no such file in the repo https://github.com/conan-io/examples2/tree/main/examples/tools/cmake/cmake_toolchain/extend_own_cmake_presets, it is automatically created, then it is included by the existing user CMakePresets.json
in https://github.com/conan-io/examples2/blob/main/examples/tools/cmake/cmake_toolchain/extend_own_cmake_presets/CMakePresets.json#L3, if that file doesn't exist, it will obviously fail
Okay, what I meant here was that: I'd been fooling around to see if I can create a basic template for a C++ project. I deleted all files but CMakeLists.txt and conanfile.py. Then I ran the commands in conanfile.py, step by step.
After I ran "cmake --preset
I realized that the conanfile.py creates a ConanPresets.json file, but I think this file was meant to be named "CMakePresets.json", just like the one in the repository. Because the file structure of ConanPresets.json is that of a "CMakePresets.json" file. The example may work fine, because it already has a "CMakePresets.json" file.
I hope I could be clear :)
Okay, what I meant here was that: I'd been fooling around to see if I can create a basic template for a C++ project. I deleted all files but CMakeLists.txt and conanfile.py. Then I ran the commands in conanfile.py, step by step.
Ok, yes, that clarifies a bit the issue. Let me clarify also the purpose of this example folder which implements this user story:
CMakePresets.json
, that they want to keep using. It is their own existing file, not the Conan one.CMakePresets.json
.CMake**.json
file, and it is necessary that it generates something with a different name.If you are removing the CMakePresets.json
you are invalidating the starting hypothesis of this particular example.
So it seems mostly a confusion about the purpose of this example and this folder, it would be better to start from another starting point, and leave this folder as-is, because it still seems correct and working fine. If you have some general question about the generated presets by Conan you can create a question in the main Conan client repo. Thanks!
Thank you for your clarification and your time!
Changed tc.user_presets_path = 'ConanPresets.json' to tc.user_presets_path = 'CMakePresets.json'.
I also changed "release" and "debug" names used for CMake presets to have "conan-" before their names.