Clion Add External Library [better] Page
find_package(Boost 1.75 REQUIRED COMPONENTS filesystem system) if(Boost_FOUND) target_link_libraries(my_app PRIVATE Boost::filesystem Boost::system) endif() CMake will automatically search standard system paths, or paths you hint via -DCMAKE_PREFIX_PATH . Not every library provides CMake configs. For those, you can use pkg-config (common on Linux):
Now go forth and link without fear! Have a library that just won’t cooperate? Drop the error message in the comments, and I’ll help you debug it. clion add external library
When you reload CMake in CLion, it will clone fmt , build it, and link it—all automatically. find_package(Boost 1
Example: Adding the popular fmt library: Have a library that just won’t cooperate
If you’re using , JetBrains’ powerful cross-platform IDE, you have several excellent—and sometimes confusing—options. Do you manually edit CMakeLists.txt ? Use find_package ? Or point and click in the settings?