find_package(CURL REQUIRED) target_link_libraries(A PUBLIC CURL::libcurl)
target_link_libraries(B PRIVATE A)
When configure for B
CMake Error at CMakeLists.txt:53 (add_executable): Target "B" links to target "CURL::libcurl" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
Does B have to
BTW, if not using modern cmake, i.e. using
CURL_LIBRARIES, no such a problem.