Dear Eric,<br><br>Thanks for your reply.<br><br>When I am using INSTALL (FILES... ) for adding external executable to my CMakeLists.txt file, it shows the executable file in the RPM archive. But it&#39;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 but when archive is created, it did not include my executable in it. <br><br>This is sample of my CMakeLists.txt<br>-----------------------------------------------<br>

<br>SET( CPACK_GENERATOR &quot;RPM&quot; )<br><br>##### MAIN EXE<br>SET( MAIN_EXE myExe)<br>ADD_EXECUTABLE(${MAIN_EXE} SOME_SOURCE_FILES )<br>SET( INSTALL_DIR &quot;$ENV{HOME}/MANOJ&quot; )<br>INSTALL( TARGETS ${MAIN_EXEC} DESTINATION ${INSTALL_DIR} )<br>

<br>##### EXTERNAL EXE<br>SET( EXTERNAL_EXE &quot;/home/manoj/EXTERNAL/a.out.exe&quot; )<br>SET( IMPORTED_LOCATION ${EXTERNAL_EXE} )<br>ADD_EXECUTABLE( ${EXTERNAL_EXE} IMPORTED) // This does not pack the executable<br><br>

#INSTALL( FILES ${EXTERNAL_EXE} DESTINATION ${INSTALL_DIR}) // This packs, but permissions lost<br><br>##### EXTERNAL LIB<br>INSTALL( FILES EXTERNAL_LIB DESTINATION ${INSTALL_DIR} )<br><br>INCLUDE(CPack)<br><br>Can you please tell me what is the error in this file?<br>

Thanks..<br><br>--<br>regards,<br>Manoj<br><br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 1:18 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; Hi cmake,<br>
&gt;<br>
&gt; I have just started learning use of CPack for my application.<br>
&gt;<br>
&gt; I have an application which uses Qt and other third party libraries.<br>
&gt;<br>
&gt; In CMakeLists.txt,<br>
&gt;<br>
&gt; For adding libraries of external package, I used<br>
&gt; INSTALL( FILES Lib1 lib2 DESTINATION ${INSTALL_DIR} )<br>
&gt;<br>
&gt; For installing target generated from this CMakeLists.txt,<br>
&gt; INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} )<br>
&gt;<br>
&gt; Here, while installing TARGETS, I want to add an executable of external<br>
&gt; package.<br>
&gt; When I included it with the above INSTALL, it says that &quot;install TARGETS<br>
&gt; given target &quot;some/path/exe&quot; which does not  exist in this directory.&quot;<br>
<br>
</div>INSTALL(TARGETS ...)<br>
signature is only for *targets* which are build or imported by your<br>
current project.<br>
IMPORTED target may be defined using<br>
<br>
add_executable(... IMPORTED)<br>
or<br>
add_library(... IMPORTED)<br>
<br>
If you want to install other file/executable you can use:<br>
INSTALL(FILE ...)<br>
<br>
reading the builtin doc will certainly help you<br>
<br>
cmake --help-command add_library<br>
cmake --help-command add_executable<br>
cmake --help-command install<br>
<div class="im"><br>
<br>
&gt; I want to do it without copying in to the CMakeLists.txt folder. Is there<br>
&gt; any other way?<br>
<br>
</div>see above.<br>
<div class="im"><br>
&gt; Also, can somebody throw some light on while making package, which type of<br>
&gt; libraries should I include ?? SHARED or STATIC ??<br>
<br>
</div>This is not really a packaging choice.<br>
If your executable use shared lib then you should include those.<br>
Putting STATIC libs in your package usually means your package is offering<br>
the use of those libs to the user.<br>
<br>
Concerning including Qt libs in your installer you shoud find many<br>
reference of this<br>
on the ML list archive.<br>
<br>
A good starting point may be Mike&#39;s blog entry on DeployQt4 as well:<br>
<a href="http://mikemcquaid.com/2012/01/04/deploying-qt-applications-with-deployqt4/" target="_blank">http://mikemcquaid.com/2012/01/04/deploying-qt-applications-with-deployqt4/</a><br>
<span class="HOEnZb"><font color="#888888">--<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>
</font></span></blockquote></div><br>