<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br>I have a question on the use of CPack.&nbsp; I have CMake setup to generate binaries and shared libraries.&nbsp; Up until now I have only created a TGZ with rpath set to ".".&nbsp; This has worked nicely, but now I would like to create a Debian package for proper installation.&nbsp; I have added DEB to CPACK_GENERATOR and I've created my own cpack_config.cmake file.&nbsp; My goal is:<br><br>1. Run cmake/make package once and create the tar.gz file with all exe/libs in the root folder of the tar.gz file with rpath set to ".".<br>2. Create new .deb package with exes in /usr/local/bin and libs in /usr/local/lib.&nbsp; Alternatively, since files are private, all could be put in /usr/local/&lt;some folder&gt;.<br><br>I've attempted this by creating my own cpack_config.cmake file to try
 to override some settings per generator.&nbsp; Some observations:<br><br>1. I've been unable to set the install(&lt;target&gt; DESTINATION) path per generator in my cpack_config.cmake file.&nbsp; Whatever the variable is set to when the install(...) is processed in the CMakeLists.txt file is what is used for all generators.&nbsp; Just want to confirm changing this isn't an option per generator.<br><br>The above has prevented me from having my install lines like:<br>&nbsp; &nbsp; install(&lt;target&gt; DESTINATION ${BIN_PATH})<br>&nbsp; &nbsp; install(&lt;target&gt; DESTINATION ${LIB_PATH})<br>and then setting BIN_PATH to bin and LIB_PATH to lib for DEB, but setting them to "." for TGZ, since I can't change the variable in cpack_config.cmake.<br><br>My current solution is to set CMAKE_INSTALL_PREFIX (before first project tag) to /usr/local/&lt;some folder&gt; and set BIN_PATH and LIB_PATH to ".".&nbsp; I also have to set CPACK_SET_DESTDIR to OFF in the
 cpack config to have the TGZ just use ".".&nbsp; Am I missing a better way?<br><br>2. I would also like to set the rpath per generator.&nbsp; So the targets in the TGZ only look in "." while the DEB installed targets only look in /usr/local/&lt;some folder&gt;.&nbsp; But I haven't been able to update the rpath per generator in cpack_config.cmake.&nbsp; I've tried both setting CMAKE_INSTALL_RPATH and using set_target_properties(... PROPERTIES INSTALL_RPATH).&nbsp; Again, I'm assuming this can't be changed at CPack time.<br><br>I've worked around this be setting CMAKE_INSTALL_RPATH to ".;/usr/local/&lt;some folder&gt;".&nbsp; The downside is that if a platform has both a DEB package installed and the TGZ extracted, if you run the /usr/local/&lt;some folder&gt; exe (assuming in path) from the folder where the tar.gz is extracted, then it may pick up the wrong libraries. I'm currently not versioning my libraries and perhaps that's the right way to handle
 it.&nbsp; But I was hoping to simply set the rpath per generator.&nbsp; Do I need to run cpack separately changing the variables before hand?&nbsp; I suppose that would mean 2 builds cycles also, once for each generator.<br><br>Thanks for any help,<br>Daryl<br><br></div>
</div><br>







      </body></html>