Zero build complexity. Cons: Doesn’t work for compiled libraries; hard to version or share with a team.
add_executable(MyProject main.cpp) target_link_libraries(MyProject PRIVATE LibraryName::LibraryName) Use code with caution. clion add external library
If you add_subdirectory(libs/somelibrary) , open that library's CMakeLists.txt and look for a line that says add_library(NameOfLibrary ...) . You must use that exact NameOfLibrary in your target_link_libraries line. Zero build complexity
target_link_libraries(my_app PRIVATE fmt::fmt) clion add external library
Zero build complexity. Cons: Doesn’t work for compiled libraries; hard to version or share with a team.
add_executable(MyProject main.cpp) target_link_libraries(MyProject PRIVATE LibraryName::LibraryName) Use code with caution.
If you add_subdirectory(libs/somelibrary) , open that library's CMakeLists.txt and look for a line that says add_library(NameOfLibrary ...) . You must use that exact NameOfLibrary in your target_link_libraries line.
target_link_libraries(my_app PRIVATE fmt::fmt)