We have set up a cmake project with external shared library dependencies. We want to package the binaries and dependencies of our project using CPack. However we are getting
The references that get_prerequisites returns are not absolute full path references, and they are also not resolve-able to absolute references via a simple get_filename_component call. (On Mac, they may contain @executable_path, for instance.)
However, there is another function in the GetPrerequisites.cmake module called gp_resolve_item that can help you here.
Try this:
get_prerequisites(${MY_BINARY_LOCATION} DEPENDENCIES 0 0 "" "")
foreach(DEPENDENCY_FILE ${DEPENDENCIES})
gp_resolve_item("${MY_BINARY_LOCATION}" "${DEPENDENCY_FILE}" "" "" resolved_file)
message("resolved_file='${resolved_file}'")
endforeach()
That should convert DLL names into full path locations of the DLLs, assuming they are in your PATH. If they are in some other directories, you may need to provide those as the "dirs" arguments to get_prerequisites and gp_resolve_item.
The documentation for the GetPrerequisites.cmake module is here: http://www.cmake.org/cmake/help/v3.0/module/GetPrerequisites.html
Also, possibly dig into the BundleUtilities.cmake module to see how it uses GetPrerequisites.