[question] What's the replacement of `virtualenv` generator in Conan 2?
Hello,
So, I have in an Conan 1 recipe:
generators = "cmake", "virtualenv"
How do I rewrite this in order to get the activate.bat script in Conan 2? Is it the VirtualRunEnv? I don't want to get fooled by a possibly misleading namesake.
best,
PC
Hi @PauloCarvalhoRJ thanks for your question.
Yes, the virtualenv generator was replaced with the VirtualRunEnv and VirtualBuildEnv generators. Those are available in Conan 1 too, and their usage is pretty similar, as described in their documentation sections
In fact, these 2 generators are injected by Conan 2 by default, so if you don't need to customize anything, you can drop them from the generators expression too :)
Let me know if this helps, we're always happy to help in the transition from Conan 1 to Conan 2!
Hello,
Thank you for the feedback. Continuing on the issue, I have a legacy Bootstrap.cmake script that expects a Conan 1-generated conanbuildinfo.cmake. What is the new name of the corresponding file in Conan 2? I found several .cmake files in the build directory, but I couldn't identify which one would do.
regards,
PC
In Conan 2 (and also using the CMakeDeps and CMakeToolchain integrations in Conan 1), the integration is transparent. No need to modify the CMakeLists.txt to include anything Conan-specific. Just standard find_package().
Check for example how it works:
mkdir dep && cd dep
conan new cmake_lib -d name=dep -d version=0.1
conan create
cd ..
mkdir pkg && cd pkg
conan new cmake_exe -d name=pkg -d version=0.1 -d requires=dep/0.1
conan build
The pkg uses the CMakeToolchain and CMakeDeps, inspect the CMakeLists.txt to see how it works.
Also, the tutorial, in the first section explains about this, see: https://docs.conan.io/2/tutorial/consuming_packages/build_simple_cmake_project.html
@PauloCarvalhoRJ do you have any other questions regarding the migration? Else we can mark this as solved and close the issue, but do feel free to create new issues if you find any other blockers, thanks!
Closing this ticket as answered, but don't hesitate to open new tickets if necessary, thanks for the feedback!