question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] Why is this project on hold until after the 2.0 release?

See original GitHub issue

Recently, I found that Conan decided to deprecate “cmake-conan” in Conan 2.X. For example, in this article of the blog:

The biggest drawback is you need to call conan install before cmake ... This sounds innocent at first but if you rely on third party tools that support cmake you no longer have the cmake-wrapper to call conan for you. The way CMake designed the toolchain support is that it needs to be preset at configuration before the project is declared.

Conan will no longer get its settings from CMake, rather Conan will convert its settings to CMake which you will need to pass explicitly.

Therefore, I want to confirm that:

The main reason is all about the “Chicken-And-Egg” problem which @memsharded mentioned in this issue that I posted before: https://github.com/conan-io/cmake-conan/issues/410#issuecomment-1095611994

In any case the conan_toolchain.cmake is mostly there to try go guarantee that your CMake configuration follows the Conan settings. As the goal of cmake-conan is the opposite, to obtain the Conan settings from the current CMake configuration, that renders the conan_toolchain.cmake mostly useles, because it should largely contain what is somewhat already defined in the current CMake run.

Am I correct?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

5reactions
SuTanTankcommented, Nov 4, 2022

In my practice, I only use conan-cmake with CMakeDeps generator to generate xxx-config.cmake files and then add the output directory to CMAKE_PREFIX_PATH. The build configurations inside the toolchain is good, but not that useful for an already-exist CMake project - many of them have their own cmake options to handle build configs on different platforms and even some already has their own toolchains.

Besides, almost all the modern C++ IDEs like CLion, VS 2022, Android Studio, have built-in CMake support, which makes it very inconvenient to manually call conan install with these IDEs cmake workflow.

Another inconvenience is submodule. When a project is consumed as a submodule and add_subdirectory(). conan-cmake works normally and the parent project doesn’t need to care about calling conan install as long as conan is installed in the environment, but now the inner project maintainer needs to tell the user: don’t use submodule, or call conan install and do a long list of things to adapt to conan and even start to learn how conan works. In the worst case, one needs to introduce conan to all the dev teams in the company and make them use it - it’s really difficult.

3reactions
marcus-freecommented, Dec 19, 2022

Sorry for more of topic but the design Conan 2.0 is a beautiful thing!

f = os.path.join(self.package_folder, "stm32_gcc.cmake")
self.conf_info.define("tools.cmake.cmaketoolchain:user_toolchain", [f])

and

cmake = CMakeDeps(self)
cmake.build_context_activated = ["gcc-arm-none-eabi"]
cmake.generate()

tc = CMakeToolchain(self,"Ninja")
tc.cache_variables["STM32_TARGET_TRIPLET"] = "arm-none-eabi"
tc.cache_variables["STM32_CUBE_G0_PATH"] = self.dependencies.host["stm32-cube-g0"].package_folder
tc.cache_variables["STM32_TOOLCHAIN_PATH"] = os.path.join(self.dependencies.build["gcc-arm-none-eabi"].package_folder,"bin")
tc.generate()

Gives me a CMakeLists.txt that have no idea that Conan exists.

And the conanfile.py if short and sweet!

It’s a beautiful thing!

Thanks for your hard work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is a Project Hold? (With Reasons and Tips) | Indeed.com
A project manager might issue a project hold when projects need more resources, lack certain material or labor requirements or need a review...
Read more >
Practical steps to take when a project is put on hold
The reasons for a project going on hold may be quite different, since every case is unique and every site needs different solutions....
Read more >
"On Hold" Indication - TechNet - Microsoft
1. Microsoft Project 2010 is a scheduling tool, so it needs a date when work will resume. Put in an estimated date, as...
Read more >
7 Steps to Nail the Project Management Closure Process
7 steps to closing a project · 1. Formally transfer all deliverables · 2. Confirm project completion · 3. Review all contracts and...
Read more >
What To Do When a Project Is on Hold | Purple, Rock, Scissors
After a setback in your timeline, it's time to create a new one to accommodate. Being on hold means the team's resources are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found