CLion 2024.3 Help

Conan plugin

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.

Install Conan

  1. Follow the official installation guide to install Conan on your system.

Install the Conan plugin

  1. Go to Settings | Plugins.

  2. Search for Conan in the Marketplace tab.

    Install the Conan plugin from CLion
  3. Click Install.

  4. In the dialog that opens, click Accept:

    Accept installing a third party plugin
  5. Restart CLion.

Configure the plugin

  1. Select View | Tool windows | Conan from the main menu or click the Conan icon to open the plugin tool window:

    Conan tool window icon
  2. Click .

  3. Conan plugin settings
    • 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.

  4. Click Ok.

Add libraries to your project

  1. Start typing the library name in the search field and select from the list of results:

    Search for a library
  2. Choose the library version and click Use in project:

    Adding a library to the project
  3. Click .

    Explore the added libraries

    This dialog shows all the libraries added to the project, with basic target information and code snippets to be added to CMake.

  4. Add commands to CMakeLists.txt according to the instructions. For example:

    find_package(CURL) target_link_libraries(calendar_run CURL::libcurl)
  5. Click the CMake reload icon in the editor or select Tools | CMake | Reload CMake project.

    Reload CMake project

    After the CMake configuration finishes, you can build and run/debug your application as usual.

Update packages

  1. Click in the Conan tool window to update the packages and the dependency provider:

    Update packages
Last modified: 26 May 2024