find_package(SDL2 CONFIG REQUIRED) target_link_libraries(my_game PRIVATE SDL2::SDL2)
This is a game-changer. No more manual downloads. CLion will fetch the library directly from Git or HTTP. clion add external library
vcpkg install sdl2 Then in CMake:
One of the first hurdles every C++ developer faces when moving from a simple "Hello World" to a real-world project is dependency management. You need logging, networking, graphics, or maybe just a handy utility library. But how do you tell your IDE and compiler where to find these external libraries? it will clone fmt
When you reload CMake in CLion, it will clone fmt , build it, and link it—all automatically. clion add external library
By Alex Mitchell | Estimated read time: 8 minutes
include(FetchContent) FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG master ) FetchContent_MakeAvailable(fmt) target_link_libraries(my_app PRIVATE fmt::fmt)