Tips & Tricks

Getting Started with the Conan CLion Plugin

Wondering how to add a package to your C++ project? In this guest blog post Javier G. Sogo from JFrog shares how to start with Conan package manager in CLion.

Javier G. Sogo Javier G. Sogo
Software Engineer at JFrog
After several years of C++ development, I moved to Python to learn the best practices and tools. Now I’m back building Conan, the C/C++ package manager.

Writing a C++ project from scratch is always a delightful challenge. Starting from a blank page writing your code and creating your functionalities, all the way through to building on top of solid and high-performance libraries… but wait! Sometimes it’s not easy to get those libraries available for your project to compile and link, and possibly you are not experienced in that build system or the library may require some patches to be built for your platform.
The lack of a package manager in the C++ world has slowed many projects down, requiring dedicated efforts to handling external libraries or rewriting functionalities to avoid using third parties.
Conan is an open source, decentralized package manager that simplifies the process of integrating and reusing C and C++ libraries and packages. It automatically manages and reuses binaries for any possible configuration, increasing development speed. Conan is also able to build and cross-build packages from sources, it integrates with any build system, with very high flexibility and customization capabilities.
In this blog post, we will show how to use Conan in your CLion workspace to get your preferred libraries ready to use in your project. We will use the Conan-CLion plugin to integrate both applications smoothly, for example, by building an MD5 hasher using an already available implementation from the Poco libraries.

Installing all the parts

1. Conan-CLion Plugin

To follow along with this example, you’ll need to install the Conan by JFrog plugin from the JetBrains marketplace. It can be easily installed using the Plugins section in the Preferences/Settings window, or from the welcome screen using the Configure>Plugins option.
Install Conan plugin for CLion from the Welcome screen

After restarting CLion a new “Conan” tool window will appear at the bottom of the IDE, which is ready for you to use.
Conan plugin inside CLion interface (Conan not installed yet)

2. Conan Client

Next, you’ll need to install Conan. Conan is a python application, you can install it using pip (pip install conan) inside a Python virtual environment or system-wide, or you can download a standalone application and unpack it into your system, choose the way that best fits your needs from the download page.
We highly recommend that you read the Conan documentation; although the default configuration is enough for this example, it is important for you to know about many other important features that are not covered in this article. Including, the distributed nature of Conan that allows mixing different origins for your libraries, JFrog Artifactory integrations, workspaces, etc. These features will help you in developing high-quality software.

The distributed architecture of Conan allows mixing different origins (and destinations) for your libraries

3. Conan Plugin Configuration

There are a couple of configuration points we need to address before running our example, these configurations only need to be done once for all your projects. First of all, you will need to provide the path to the Conan executable you want to use in the Preferences window (leave it empty to use Conan from the PATH).


Second, we need to define the correspondence between CLion CMake profiles and Conan profiles. CLion profiles are a handy way to create different configurations to build your project, the same as Conan profiles, that’s why both should match.


A Conan profile is a file where the user defines a set of settings, options, environment variables, and build requires, that can be reused to build any package. These files can be handled individually using `conan profile` commands or, if you are working with other people, you will probably want to maintain a shared configuration with your colleagues using `conan config install` commands. Create as many profiles as you want using the command line or copy an URL with your shared Conan configuration into the plugin settings. For more information related to this core feature of Conan, the documentation about using profiles is a good starting point.
Once your profiles are ready, match them with the CLion ones using the Button button, a window will pop up for you to make these assignments.
CMake profiles in CLion matched with profiles used by Conan

Creating the C++ project

After the configuration is complete, we can leap into C++. The following example demonstrates the MD5 hashing utility in the Poco library, a few lines of code should be enough to get us started:

#include "Poco/MD5Engine.h"
#include "Poco/DigestStream.h"
#include <iostream>

int main(int argc, char** argv)
     Poco::MD5Engine md5;
     Poco::DigestOutputStream ds(md5);
     ds << "abcdefghijklmnopqrstuvwxyz";
     std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl;
     return 0;

If we try to compile this project using CLion it will fail, because the Poco libraries are missing. This is where our package manager comes into action.

Getting your dependencies with Conan

Conan uses a separated file to store information related to a project. This can either be a plain `conanfile.txt` file, or a python `` file that handles more complex logic regarding your dependencies. The Conan plugin can work with both of these file types.
For this example we only need a couple of lines in a `conanfile.txt` that you should add to your repository:




These lines notify Conan that our project requires the Poco library, and provide the version and origin for it. Conan will look in the remotes and retrieve the recipe for Poco from there, it will also grab the binaries if they’re available for your configuration and, if not, it will trigger a compilation from sources. All of this will be done using the Conan install button, Conan icon , that can be found in the Conan tool window.

Conan installs the required library and transitive dependencies

As you can see, Conan not only installed the Poco libraries, but also OpenSSL and ZLib too. This is because they are transitive dependencies of Poco. If binaries matching your configuration are available in the remote, Conan will just download them, otherwise, Conan will compile these packages from sources no matter if they use CMake or other build systems (OpenSSL uses Makefiles).
Conan resolving the complete Poco dependency graph


Conan will create a file for each of the generators listed here, as CLion uses CMake we need that generator. These files contain all the information of the requirements, including: paths to includes, libraries or resources, and compile flags. Basically, everything that needs to be consumed by your project. You only need to include this file into your build system, there is no need to change anything else, and you’re ready to go.
Modify your `CMakeLists.txt` to include this automatically generated file, named `conanbuildinfo.cmake`:

cmake_minimum_required(VERSION 2.8.12)


add_executable(md5_hasher main.cpp)
target_link_libraries(md5_hasher ${CONAN_LIBS})

Compile again and run your project. Conan will take care of your dependencies, by locating and downloading (or compiling) them, making them available for your project. If you feel that this implementation requires modifying your project, you can try other CMake related generators available in Conan, such as `cmake_find_package` or `cmake_paths`. Additional information on how to activate these generators can be found in the Conan documentation.


Alongside CMake and CLion, Conan has become one of the big C’s for the C++ language. Having a package manager encourages the community to share their libraries and build functionalities on top of existing ones, modernizing the C++ ecosystem towards a more mature and useful one. It also allows companies to have a professional tool to build all their internal libraries and third-parties using the same process, preserving consistency and reproducibility of their builds, and keeping their developers focused on their job.
The plugin in its first version implements just some basic functionalities of Conan, we highly recommend you to use it in your projects, but also to explore all the functionalities that Conan provides. We’re always happy to receive feedback related to both the CLion plugin and Conan in general.

Happy Coding!

Comments below can no longer be edited.

26 Responses to Getting Started with the Conan CLion Plugin

  1. Avatar

    Jens Riboe says:

    May 22, 2019

    Really interesting. However, it seems to me that the plugin do no (yet) support WSL.
    Unless, I missed out something in the instructions.

    Running CLion @ Win10 and GCC @ WSL is the way to go, for us windows users.
    So, please implement WSL support for the plugin as well.

    • Avatar

      Javier G. Sogo says:

      May 22, 2019

      Hi, Jens! Thanks for your kind words.

      This is just the first release, we will be adding more features to the plugin in the following versions, take it for granted. For features requests, you can open an issue in the Github repository:, we keep track of the development there and it helps us to prioritize the roadmap.

      • Avatar

        Jens Riboe says:

        May 22, 2019

        Ok, thanks for the GitHub link.
        I noticed that there already was an open ticket (2018 June) for this:

        Please, prioritize this. As far as I know, the majority of CLion users are running on Windows (corporate PCs) and the CLion WSL integration is really vital for effective development.

  2. Avatar

    Paul B says:

    May 22, 2019

    Your last code sample, showing linking the libraries in Cmake, has a bunch of tags scattered through it.

    • Avatar

      Paul B says:

      May 22, 2019

      I mean <strong> tags, whoops.

      • Anastasia Kazakova

        Anastasia Kazakova says:

        May 22, 2019

        oops, thanks, sometimes WordPress is not friendly)
        Updated the text. Sorry for the inconvenience.

  3. Avatar

    mipko says:

    May 22, 2019


    I have a stopper no matter what I do, I constantly get info “Could not find Conan client in path.” although conan client exists in /opt/conan/conan and there is a link in /usr/bin. Both directories are in path.


    • Avatar

      Javier G. Sogo says:

      May 22, 2019

      Inside the configuration window of the plugin (have a look at section 3 of this blog post) you can set the full path to the Conan _executable_. Can you check what’s the path you have there? Can you put there the path to your Conan (`/usr/bin/conan`) and try again?


      • Avatar

        mipko says:

        May 22, 2019

        Hi Javier,

        I have put the full path to the conan binary i.e. /usr/bin/conan and yet nothing changes. I can use conan on command line as usual.


  4. Avatar

    Henry Borchers says:

    May 22, 2019

    Wasn’t requesting a Conan plugin. (I’m more excited about MSVC debugging to be honest) However, I’m very interested in this.

    I tried Conan a year or so ago and wasn’t very happy with it because I didn’t like the idea of having to incorporate “Conan commands” in my CMakeLists.txt. However, with the cmake_find_package generator, using Conan is more transparent. I will absolutely play with this pluggin.

    • Anastasia Kazakova

      Anastasia Kazakova says:

      May 22, 2019

      Conan plugin is maintained by Conan/JFrog team. So it doesn’t affect the MSVC debugging at all, which is under development now, we hope to have it in 2019.2 or 2019.3 ready to some extent.

  5. Avatar

    Gareth Lloyd says:

    May 23, 2019

    I have to populate CMAKE_MODULE_PATH manually when using cmake_find_package

  6. Avatar

    Quazi Irfan says:

    May 24, 2019

    Hello, I am a Conan novice and could not follow the blog post. For example, I do not know where to create the CLion Cmake profile. Also I do not know where to place the conanfile.txt file. Perhaps a video tutorial would be very helpful.

    Thank you for your hard work.

    • Anastasia Kazakova

      Anastasia Kazakova says:

      May 24, 2019

      CMake profiles are configured in Settings/Preferences | Build, Execution, Deployment | CMake

  7. Avatar

    Quazi Irfan says:

    May 26, 2019

    Thank you for the blog post.

    As I was trying to follow the instructions, I could not figure out where to add the content of the ‘CLion CMake profiles’, and what to do after adding the `conanfile.txt` file. I was wondering if you guys can make a video showing us the setup.

    • Avatar

      Javier G. Sogo says:

      May 27, 2019

      CMake profiles for CLion are configured in Settings/Preferences | Build, Execution, Deployment | CMake. For the Conan’s ones, if you have doubts, you can visit the documentation about Conan ( Once you have this setup (and the conanfile), just click the “Conan install” button in the Conan tool window.

      A video is a really good idea, we could include this set up in one webinar and then link to it. Thanks for the suggestion.

  8. Avatar

    Gerard says:

    June 4, 2019

    Thank you for releasing this plugin!

    My CLion project has a structure as follows:

    mylibrary/conanfile.txt (references external requirements needed for mylibrary)

    mylibrary/unit_tests/conanfile.txt (references mylibrary as a requirement)

    The plugin is working perfectly for pulling in requirements for the top-level mylibrary conanfile. Thank you!

    On the other hand, I still have to manually run ‘conan install’ within the unit_tests folder. Is my project organization wrong or is the desire to be able to use the plugin button to run ‘conan install’ on both the top-level folder and unit_tests folder a practical use case? If so, I will submit a feature request.

    • Avatar

      Javier G. Sogo says:

      August 14, 2019

      Hi, Gerard!

      The current version for this plugin allows only one conanfile per project (feel free to open a issue in the repo if you think that it is needed), nevertheless you won’t have such problem if you use a different approach for your library and use only one conanfile: if your tests require some library (catch2, doctest,…) you can add it as a `build_require` and it won’t be propagated to the consumers, and at the same time everything related to your library would be managed by a single conanfile. This is what we recommend for any library.


  9. Avatar

    Stefan Eicher says:

    August 14, 2019

    I am having similar issued as Gerard. I am also new to cmake and conan and would like to follow your blog. But I am struggling to fully understand “3. Conan Plugin Configuration”.
    I would also like to see a video tutorial but a git project contains the source would most probably much easier and also help a lot.

    • Avatar

      Javier G. Sogo says:

      August 14, 2019

      Hi, Stefan.

      Conan is an external tool and this plugin helps to use it without leaving CLion IDE. In order to make it work properly, the plugin needs to find Conan installed in the system (it has to be in the PATH or you have to provide the path to the executable) and we need to map the configuration used by CLion to the one requested by Conan and the most flexible and easy way to do it is pairing CMake profiles (used by CLion) to Conan profiles.

      You can use any example from our repository ( that uses a CMakeLists.txt to try this plugin, it should work out-of-the-box if you follow the steps described in this blogpost.

      I hope this briefs explanation helps you to get started with Conan and with the plugin, if you have more doubts don’t hesitate to ask.


  10. Avatar

    Kevin Lafayette says:

    August 28, 2019

    I have some questions.

    Say I add 350 dependency lines to the requires section in a conanfile.txt.
    It seems excessive to have to use ${CONAN_LIBS} everywhere.

    How do I get JUST pistache where I only use pistache, or JUST boost_regex where I am using boost regex?

    Does FindBoost continue to work? Or do I have to
    set(Boost_NO_SYSTEM_PATHS ON)
    before I can find_packag(Boost …)?

    • Avatar

      Javier García Sogo says:

      August 30, 2019

      Hi Kevin,

      Conan provides different generators that you can use to consume the dependencies using CMake (you can read about all of them in our docs: Just a quick draft here:

      Basic usage is the cmake generator, with conan_basic_setup() and ${CONAN_LIBS}, it has the problem you have pointed out.

      With the cmake generator you can use the targets approach with conan_basic_setup(TARGETS), then you will have CMake targets like boost::boost available for you to use.

      Other generators like cmake_find_package will generate the typical files FindXXXX.cmake that CMake will consume with find_package. Pay attention to use Conan generated ones and not system ones, adjust CMAKE_MODULE_PATH accordingly.

      As a side note, we are also preparing a new feature (most likely for Conan v1.19) that will allow defining a custom name for the target, that will be very useful to match existing CMake names. Here it is the PR:

  11. Avatar

    dhairoot says:

    February 25, 2020

    thank you for you tool Conan and Conan-plugin
    I wrote Java before using Cpp.
    It is intolerable to write code without a tool like maven untill Conan.
    Thank you so much. (≧∇≦)ノ

  12. Avatar

    Maral says:

    April 4, 2020

    Inside the configuration window of the plugin (have a look at section 3 of this blog post) you can set the full path to the Conan _executable_. Can you check what’s the path you have there? Can you put there the path to your Conan (/usr/bin/conan) and try again?

  13. Avatar

    Steve says:

    April 27, 2020

    Will this plugin work with a Remote Host?

Discover more