Dear Eric,<br><br>Thank you very much for your quick reply.<br><br>INSTALL( PROGRAMS ... ) worked fine.<br>If I am using this, I also do not need to specify any IMPORTED related stuff.<br><br>As my understanding now, the following lines are sufficient for creating pack.<br>
<br>INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} ) // For Executable from the current CMakeLists.txt<br><br>INSTALL( PROGRAMS ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR} ) // For including external executable in the archive<br>
<br>INSTALL( FILES LIB1 LIB2 DESTINATION ${INSTALL_DIR} ) // For libraries (current or external) or any other files<br><br>A few clarifications required:<br><br>For an application using Qt libraries, should I pack the related Qt libraries (QtCore, QtGui, QtOpenGL) ?? or not ?? If I am giving this to somebody, I should include them or ask them to install on their machine ?<br>
<br>Also, what is the preferred path or tree for installing package? When RPM is installed, will it automatically be included in the $PATH or I have to do it someway?<br><br>Thanks once again. <br><br>--<br>regards,<br>Manoj <br>
<br><div class="gmail_quote">On Fri, Nov 9, 2012 at 2:24 PM, Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2012/11/9 Manoj Vaghela <<a href="mailto:manoj.vaghela@gmail.com">manoj.vaghela@gmail.com</a>>:<br>
<div class="im">> Dear Eric,<br>
><br>
> Thanks for your reply.<br>
><br>
> When I am using INSTALL (FILES... ) for adding external executable to my<br>
> CMakeLists.txt file, it shows the executable file in the RPM archive. But<br>
> it's execute permission is lost. What should I have to do for that?<br>
><br>
> Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this line<br>
> but when archive is created, it did not include my executable in it.<br>
<br>
</div>See my comment below:<br>
<div class="im"><br>
><br>
> This is sample of my CMakeLists.txt<br>
> -----------------------------------------------<br>
><br>
> SET( CPACK_GENERATOR "RPM" )<br>
><br>
> ##### MAIN EXE<br>
> SET( MAIN_EXE myExe)<br>
> ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )<br>
> SET( INSTALL_DIR "$ENV{HOME}/MANOJ" )<br>
> INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )<br>
><br>
> ##### EXTERNAL EXE<br>
> SET( EXTERNAL_EXE "/home/manoj/EXTERNAL/a.out.exe" )<br>
> SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )<br>
> ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the<br>
> executable<br>
<br>
</div>Once the external executable is imported as a TARGET<br>
you have to install it:<br>
INSTALL( TARGETS ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR} )<br>
<div class="im"><br>
><br>
> #INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This packs,<br>
> but permissions lost<br>
<br>
</div>My mistake for executable you should be using<br>
install(PROGRAMS files... DESTINATION <dir><br>
[PERMISSIONS permissions...]<br>
[CONFIGURATIONS [Debug|Release|...]]<br>
[COMPONENT <component>]<br>
[RENAME <name>] [OPTIONAL])<br>
<br>
signature.<br>
<div class="HOEnZb"><div class="h5">--<br>
Erk<br>
Le gouvernement représentatif n'est pas la démocratie --<br>
<a href="http://www.le-message.org" target="_blank">http://www.le-message.org</a><br>
</div></div></blockquote></div><br>