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">&lt;<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>&gt;</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 &lt;<a href="mailto:manoj.vaghela@gmail.com">manoj.vaghela@gmail.com</a>&gt;:<br>
<div class="im">&gt; Dear Eric,<br>
&gt;<br>
&gt; Thanks for your reply.<br>
&gt;<br>
&gt; When I am using INSTALL (FILES... ) for adding external executable to my<br>
&gt; CMakeLists.txt file, it shows the executable file in the RPM archive. But<br>
&gt; it&#39;s execute permission is lost. What should I have to do for that?<br>
&gt;<br>
&gt; Also, ADD_EXECUTABLE( ... IMPORTED) did not work for me. I added this line<br>
&gt; 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>
&gt;<br>
&gt; This is sample of my CMakeLists.txt<br>
&gt; -----------------------------------------------<br>
&gt;<br>
&gt; SET( CPACK_GENERATOR &quot;RPM&quot; )<br>
&gt;<br>
&gt; ##### MAIN EXE<br>
&gt; SET( MAIN_EXE myExe)<br>
&gt; ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )<br>
&gt; SET( INSTALL_DIR &quot;$ENV{HOME}/MANOJ&quot; )<br>
&gt; INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )<br>
&gt;<br>
&gt; ##### EXTERNAL EXE<br>
&gt; SET( EXTERNAL_EXE &quot;/home/manoj/EXTERNAL/a.out.exe&quot; )<br>
&gt; SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )<br>
&gt; ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the<br>
&gt; 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>
&gt;<br>
&gt; #INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This packs,<br>
&gt; but permissions lost<br>
<br>
</div>My mistake for executable you should be using<br>
install(PROGRAMS files... DESTINATION &lt;dir&gt;<br>
                 [PERMISSIONS permissions...]<br>
                 [CONFIGURATIONS [Debug|Release|...]]<br>
                 [COMPONENT &lt;component&gt;]<br>
                 [RENAME &lt;name&gt;] [OPTIONAL])<br>
<br>
signature.<br>
<div class="HOEnZb"><div class="h5">--<br>
Erk<br>
Le gouvernement représentatif n&#39;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>