I’m searching for a rule of thumb to discover how the binary package name used in find_package()
is modified for use in target_link_libraries()
. In this fragment of CMakeLists.txt
file:
find_package(fmt REQUIRED)
find_package(OpenMP REQUIRED)
find_package(OpenCV REQUIRED)
find_package(ufomap REQUIRED)
...
target_link_libraries (hello
fmt::fmt
OpenMP::OpenMP_CXX
${OpenCV_LIBS}
/usr/local/lib/libMap.so
)
each package name follows different rules. Documentation at https://cmake.org/cmake/help/git-stage/guide/using-dependencies/index.html:
find_package(SomePackage REQUIRED)
...
target_link_libraries(MyExe PRIVATE SomePrefix::LibName)
doesn’t help with finding transformation from SomePackage
to SomePrefix::LibName
.
All binary packages listed in my example provide a package configuration file, but I don’t see that information there. Is there any other place to search for it?