Getting a CMake Error: Cannot specify link libraries for target which is not built by the project

In addition to the accepted answer: An important detail is to place target_link_libraries after the add_executable and find_package lines, so all linked components are known.

Leave a Comment