Conan plugin
Plugin: Conan (not bundled)
Conan version: 2.0.5 or later
Project format: CMake
CMake version: 3.24 or later
The Conan plugin by JFrog allows you to work with Conan, a package manager for C/C++, without leaving CLion. The plugin integrates Conan with CMake using a dependency provider, cmake-conan. This dependency provider translates the CMake configuration to Conan.
Follow the official installation guide to install Conan on your system.
Go to Settings | Plugins.
Search for Conan in the Marketplace tab.
Click Install.
In the dialog that opens, click Accept:
Restart CLion.
Select View | Tool windows | Conan from the main menu or click the Conan icon to open the plugin tool window:
Click
.
Provide the path to the Conan client executable or set the Use Conan installed in the system checkbox to use the one installed at the system level.
In the Use Conan for the following configurations section, set or clear the checkboxes that correspond to CMake profiles.
The Automatically add Conan support for all configurations option is enabled by default: the plugin will add Conan support for new profiles.
The last checkbox, also enabled by default, allows Conan to run CMake sequentially instead of running it in parallel. This is needed as the Conan cache is not concurrent up to Conan 2.0.9 version.
Click Ok.
note
You will see a warning in the CMake output indicating that the
find_package()
commands are not added to CMakeLists.txt. These commands will be added later, so you can safely ignore this warning.
Start typing the library name in the search field and select from the list of results:
Choose the library version and click Use in project:
Click
.
This dialog shows all the libraries added to the project, with basic target information and code snippets to be added to CMake.
tip
Conan stores information about the used packages in a conandata.yml file located in the project folder. This file is read by conanfile.py. These files can be customized for advanced usage of the plugin.
Add commands to CMakeLists.txt according to the instructions. For example:
find_package(CURL) target_link_libraries(calendar_run CURL::libcurl)
Click the CMake reload icon in the editor or select Tools | CMake | Reload CMake project.
note
The libraries are installed at the CMake configuration step.
After the CMake configuration finishes, you can build and run/debug your application as usual.
Click
in the Conan tool window to update the packages and the dependency provider:
Thanks for your feedback!