Clion Boost


Matt Godbolt

  1. Clion Booster Pump
  2. Clion Add External Library

Setup Boost in Clion A word about tools structure. D: SDK boost boost1680 # untouched Boost root boost rst.css.other. Obtain Boost Library Binary. I decided to build libraries from source with GCC. Create CLion project. Configure CLion. Go to (on Windows) File.

Compiler Explorer

CLion takes a lot of the toil out of C++, allowing me to concentrate on the interesting part: problem solving.

Boost.Build support for JetBrains CLion IDE. Contribute to grafikrobot/clion-boost-build development by creating an account on GitHub. Boost 1.75 release. Boost is often called a playground for the future C standard updates, which provides an interesting perspective from which to view its release. Version 1.75 that came out in December brought three new libraries to Boost: JSON: for JSON parsing and serialization in C11. Interestingly, it can be header-only and doesn’t have Boost dependencies (without Boost it requires C17). As workaround you could update boost headers by changing `#ifndef BOOSTHEADERGUARD` to `#if!defined(BOOSTHEADERGUARD) &&!defined(CLIONIDE)` to highly speed up the performance. But in this case completion, refactorings and some other features in code insight will stop working. Windows build 18362 CLion 2019.1.2 Boost 1.67 Toolchain mingw-64 I'm trying to setup a simple project in Clion using Boost. The problem is when I include a boost header #include boost/log/trivial.hpp, CLion cannot find the header file. My CMakeLists.txt.

CLion takes a lot of the toil out of C++, allowing me to concentrate on the interesting part: problem solving.

A power tool
for a power language

Who wouldn’t like to code at the speed of thought while the IDE does all the mundane development tasks for them? But is that really possible for a tricky language like C++, what with its modern standards and heavily templated libraries? Why, yes, yes it is! See it to believe it.

Smart C and C++ editor

Code assistance

Read and write code effectively with an editor that deeply understands C and C++. Have completion results filtered by type in Smart Completion. Use Breadcrumbs to track your location inside the hierarchy of scopes. Gain insight into function calls thanks to parameter name hints. Find the context usages of a symbol or simply jump to it by typing its name. CLion will even make sure your code conforms to coding guidelines, including formatting, naming, and more.

Code generation

Generate tons of boilerplate code instantly. Override and implement functions with simple shortcuts. Generate constructors and destructors, getters and setters, and equality, relational, and stream output operators. Wrap a block of code with a statement, or generate a declaration from a usage. Create custom live templates to reuse typical code blocks across your code base to save time and maintain a consistent style.

Safe refactoring

Rename symbols; inline a function, variable, or macro; move members through the hierarchy; change function signatures; and extract functions, variables, parameters, or a typedef. Whichever automated refactoring you use, rest assured CLion will safely propagate the appropriate changes throughout your code.

Quick Documentation

Inspect the code under the caret to learn just about anything: function signature details, review comments, preview Doxygen-style documentation, check out the inferred type for symbols lacking explicit types, and even see properly formatted final macro replacements.

Code analysis on the fly

Create code that's beautiful and correct. With CLion, potential code issues are detected instantly, as you type...


...and can be fixed at the touch of a button, while the IDE correctly handles the changes.

CLion runs its code analysis, Data Flow Analysis, other Clangd-based checks, and Clang-Tidy to detect unused and unreachable code, dangling pointers, missing type casts, no matching function overload, and many other issues.

Integrated debugger

Investigate and solve problems with ease in CLion's friendly debugger, with GDB or LLDB available as the backend.

Clion boosting

Attach to local processes or debug remotely. For embedded development, rely on OpenOCD and Embedded GDB Server configurations to do on-chip debugging with CLion.

Dive deeper with disassembly and memory views, and peripheral view for embedded devices.

Set breakpoints

Use line, symbol, exception, and conditional breakpoints to inspect your code’s execution. Log the events, remove breakpoints once hit, or disable them until another one is hit. All of this can be configured in a dedicated dialog.

Evaluate expressions

Make use of the Watches and the Variables views, or evaluate the result of a function call or some complicated expression when stopping at some execution point.

View values inline

Get a full view of your project with variables’ values shown right in the editor as you debug – with no need to switch to the Variables tab in the Debug tool window!

Fully Integrated C/C++ Development Environment

Project models

CLion uses the project model to inform its coding assistance, refactoring, coding style consistency, and other smart actions in the editor. Supported formats include CMake, Makefile, Gradle, and compilation database.

Keyboard-centric approach

To help you focus on code and raise your productivity, CLion has handy keyboard shortcuts for nearly all its features, actions, and commands.

Vim fans are welcome to install the Vim-emulation plugin.

Local and remote work

With an embedded terminal, run any command without leaving the IDE, locally or remotely using the SSH protocol.

After editing your code locally, build, run, or debug your application or unit tests locally, remotely, or on a chip.

Everything you need in one place

CLion includes all the essentials of everyday development: VCS (SVN, Git, GitHub, Mercurial, Perforce), Google Test, Catch and Boost.Test frameworks for unit testing, Doxygen, Database tools, and Markdown support.

What’s New in CLion 2021.1

Code analysis

You can count on CLion for the continuous analysis of your entire code base. It offers extended support for MISRA C and C++, Global Data Flow Analysis to help you catch dangling pointers, unreachable code, and other potential issues inside translation units, and Clazy analyzer integration for Qt projects.

Postfix completion

A new postfix completion for C and C++ in CLion lets you add code around an expression you’ve just typed. It can wrap an expression with a frequently used language construct, or pass the expression as the first argument of a free function.

Project models

To be more consistent across all toolchains, project models, and configurations, CLion 2021.1 introduces initial support for remote Makefile projects, enables dynamic analysis tools in remote mode, bundles CMake 3.19, and gives you the ability to share CMake Profiles in VCS.

What our customers say

Jason Turner

C++ Weekly, CppCast, Trainer, Consultant
'CLion has been indispensable for me when refactoring large codebases. The refactoring tools and the real-time feedback in the IDE about which lines still need to be updated are excellent time savers. Each release gets better and more responsive than the last!'
'CLion is fantastic, finally the C++ high quality cross-platform IDE with CMake as first class build system we were waiting for.'
'CLion’s powerful refactoring and code model that understands dependencies between items have already changed my software design process. One can dig out quite a bunch of bugs even before running the application.'
'Both of these tools (CLion and Rider) help our team on a daily basis, allowing developers to perform their tasks quickly and efficiently, all the while seamlessly integrating with numerous parts of our pipeline.'
Clion add include path

Companies worldwide trust JetBrains IDEs. Join the club!

Find Boost include dirs and libraries

Use this module by invoking find_package() with the form:

This module finds headers and requested component libraries OR a CMakepackage configuration file provided by a 'Boost CMake' build. For thelatter case skip to the Boost CMake section below.

New in version 3.7: bzip2 and zlib components (Windows only).

New in version 3.11: The OPTIONAL_COMPONENTS option.

New in version 3.19: bzip2 and zlib components on all platforms.

Result Variables¶

Clion Booster Pump

This module defines the following variables:


True if headers and requested libraries were found.


Boost include directories.


Link directories for Boost libraries.


Boost component libraries to be linked.


True if component <COMPONENT> was found (<COMPONENT> name is upper-case).


Libraries to link for component <COMPONENT> (may includetarget_link_libraries() debug/optimized keywords).


BOOST_VERSION value from boost/version.hpp.

Clion Add External Library


Boost version number in X.Y.Z format.


Boost version number in X.Y.Z format (same as Boost_VERSION_STRING).

Changed in version 3.15: In previous CMake versions, this variable used the raw version stringfrom the Boost header (same as Boost_VERSION_MACRO).See policy CMP0093.


Version string appended to library filenames.


Boost major version number (X in X.Y.Z).


Boost minor version number (Y in X.Y.Z).


Boost subminor version number (Z in X.Y.Z).


Amount of version components (3).


Pass to add_definitions() to have diagnosticinformation about Boost's automatic linkingdisplayed during compilation

New in version 3.15: The Boost_VERSION_<PART> variables.

Cache variables¶

Search results are saved persistently in CMake cache entries:


Directory containing Boost headers.


Directory containing release Boost libraries.


Directory containing debug Boost libraries.


Component <COMPONENT> library debug variant.


Component <COMPONENT> library release variant.

New in version 3.3: Per-configuration variables Boost_LIBRARY_DIR_RELEASE andBoost_LIBRARY_DIR_DEBUG.


This module reads hints about search locations from variables:


Preferred installation prefix.


Preferred include directory e.g. <prefix>/include.


Preferred library directory e.g. <prefix>/lib.


Set to ON to disable searching in locations notspecified by these hint variables. Default is OFF.


List of Boost versions not known to this module.(Boost install locations may contain the version).

Users may set these hints or results as CACHE entries. Projectsshould not read these entries directly but instead use the aboveresult variables. Note that some hint names start in upper-caseBOOST. One may specify these as environment variables if they arenot specified as CMake variables or cache entries.

This module first searches for the Boost header files using the abovehint variables (excluding BOOST_LIBRARYDIR) and saves the result inBoost_INCLUDE_DIR. Then it searches for requested component librariesusing the above hints (excluding BOOST_INCLUDEDIR andBoost_ADDITIONAL_VERSIONS), 'lib' directories near Boost_INCLUDE_DIR,and the library name configuration settings below. It saves thelibrary directories in Boost_LIBRARY_DIR_DEBUG andBoost_LIBRARY_DIR_RELEASE and individual librarylocations in Boost_<COMPONENT>_LIBRARY_DEBUG and Boost_<COMPONENT>_LIBRARY_RELEASE.When one changes settings used by previous searches in the same buildtree (excluding environment variables) this module discards previoussearch results affected by the changes and searches again.

Imported Targets¶

This module defines the following IMPORTED targets:


Target for header-only dependencies. (Boost include directory).


New in version 3.15: Alias for Boost::boost.


Target for specific component dependency (shared or static library);<component> name is lower-case.


Interface target to enable diagnostic information about Boost's automaticlinking during compilation (adds -DBOOST_LIB_DIAGNOSTIC).


Interface target to disable automatic linking with MSVC(adds -DBOOST_ALL_NO_LIB).


Interface target to enable dynamic linking linking with MSVC(adds -DBOOST_ALL_DYN_LINK).

Implicit dependencies such as Boost::filesystem requiringBoost::system will be automatically detected and satisfied, evenif system is not specified when using find_package() and ifBoost::system is not added to target_link_libraries(). If usingBoost::thread, then Threads::Threads will also be added automatically.

It is important to note that the imported targets behave differentlythan variables created by this module: multiple calls tofind_package(Boost) in the same directory or sub-directories withdifferent options (e.g. static or shared) will not override thevalues of the targets created by the first call.

Boost cpp library

Other Variables¶

Boost libraries come in many variants encoded in their file name.Users or projects may tell this module which variant to find bysetting variables:


Set to ON or OFF to specify whether to search and use the debuglibraries. Default is ON.


New in version 3.10.

Set to ON or OFF to specify whether to search and use the releaselibraries. Default is ON.


Set to OFF to use the non-multithreaded libraries ('mt' tag). Default isON.


Set to ON to force the use of the static libraries. Default is OFF.


Set to ON or OFF to specify whether to use libraries linkedstatically to the C++ runtime ('s' tag). Default is platform dependent.


Set to ON or OFF to specify whether to use libraries linked to theMS debug C++ runtime ('g' tag). Default is ON.


Set to ON to use libraries compiled with a debug Python build ('y'tag). Default is OFF.


Set to ON to use libraries compiled with STLPort ('p' tag). Default isOFF.


Set to ON to use libraries compiled with STLPort deprecated 'nativeiostreams' ('n' tag). Default is OFF.


Set to the compiler-specific library suffix (e.g. -gcc43). Default isauto-computed for the C++ compiler in use.

Changed in version 3.9: A list may be used if multiple compatible suffixes should be tested for,in decreasing order of preference.


Set to the platform-specific library name prefix (e.g. lib) used byBoost static libs. This is needed only on platforms where CMake does notknow the prefix by default.


New in version 3.13.

Set to the architecture-specific library suffix (e.g. -x64).Default is auto-computed for the C++ compiler in use.


Suffix for thread component library name, such as pthread orwin32. Names with and without this suffix will both be tried.


Alternate namespace used to build boost with e.g. if set to myboost,will search for myboost_thread instead of boost_thread.

Other variables one may set to control this module are:


Set to ON to enable debug output from FindBoost.Please enable this before filing any bug report.


Set to ON to resolve symlinks for discovered libraries to assist withpackaging. For example, the 'system' component library may be resolved to/usr/lib/ instead of/usr/lib/ This does not affect linking and shouldnot be enabled unless the user needs this information.


Default value for Boost_LIBRARY_DIR_RELEASE andBoost_LIBRARY_DIR_DEBUG.


Set to ON to suppress the warning about unknown dependencies for newBoost versions.

On Visual Studio and Borland compilers Boost headers request automaticlinking to corresponding libraries. This requires matching librariesto be linked explicitly or available in the link library search path.In this case setting Boost_USE_STATIC_LIBS to OFF may not achievedynamic linking. Boost automatic linking typically requests staticlibraries with a few exceptions (such as Boost.Python). Use:

to ask Boost to report information about automatic linking requests.


Find Boost headers only:

Find Boost libraries and use imported targets:

Find Boost Python 3.6 libraries and use imported targets:

Find Boost headers and some static (release only) libraries:

Boost CMake¶

If Boost was built using the boost-cmake project or from Boost 1.70.0 onit provides a package configuration file for use with find_package's config mode.This module looks for the package configuration file calledBoostConfig.cmake or boost-config.cmake and stores the result inCACHE entry Boost_DIR. If found, the package configuration file is loadedand this module returns with no further action. See documentation ofthe Boost CMake package configuration for details on what it provides.

Set Boost_NO_BOOST_CMAKE to ON, to disable the search for boost-cmake.