Clion Add External Library -
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) Best for: Automatically downloading libraries from GitHub during configuration.
vcpkg install fmt And use it in CMake like magic: clion add external library
This is a game-changer. No more manual downloads. CLion will fetch the library directly from Git or HTTP. JetBrains’ powerful cross-platform IDE
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? clion add external library
find_package(SDL2 CONFIG REQUIRED) target_link_libraries(my_game PRIVATE SDL2::SDL2)
By Alex Mitchell | Estimated read time: 8 minutes