The best method depends on how the library is provided (e.g., system-wide, as a folder of files, or through a package manager). Method 1: Using find_package (Recommended)
find_package(PkgConfig REQUIRED) pkg_check_modules(LIBUSB REQUIRED libusb-1.0) target_link_libraries(my_app PRIVATE $LIBUSB_LIBRARIES) target_include_directories(my_app PRIVATE $LIBUSB_INCLUDE_DIRS) clion add external library
#include <json.hpp>
| Estimated read time: 8 minutes