<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background-image:initial;background-repeat:initial">Dear list members,<br><br>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 different results on windows and linux systems when trying to find dependencies of our targets. <br>

<br>We had a look at the GetPrerequisites Module of CMake (2.8.12).We have successfully used the following CMake code to get the full path of a CMake target (BINARY) dependency (_libFile) on linux, however we don't get a the full path of the dependency on windows. On Windows the variable dependency_realpath holds something like ${CMAKE_SOURCE_DIR}/DEPENDENCY_FILE, which is not the correct path to the dependency.<br>

<br>string(TOUPPER "${CMAKE_BUILD_TYPE}" CONFIG)<br>GET_TARGET_PROPERTY(MY_BINARY_LOCATION ${BINARY} LOCATION_${CONFIG} )<br>GET_PREREQUISITES(${MY_BINARY_LOCATION} DEPENDENCIES 0 0 "" "")<br>

<br>foreach( DEPENDENCY_FILE ${DEPENDENCIES})<br>    get_filename_component( dependency_realpath ${DEPENDENCY_FILE} REALPATH)<br><br>So the question would be: Why are we getting different results for the dependency locations on windows and linux? <br>

<br>Disclaimer: this is a clone question also asked on <a href="http://stackoverflow.com/questions/24367033/how-to-use-the-cmake-functions-get-prerequisites-and-get-filename-component-for" style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">http://stackoverflow.com/questions/24367033/how-to-use-the-cmake-functions-get-prerequisites-and-get-filename-component-for</a></p>

<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px;background-image:initial;background-repeat:initial">

Regards,</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px;background-image:initial;background-repeat:initial">

Stefan</p><div></div></div>