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'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 "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 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"><<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">> Hi cmake,<br>
><br>
> I have just started learning use of CPack for my application.<br>
><br>
> I have an application which uses Qt and other third party libraries.<br>
><br>
> In CMakeLists.txt,<br>
><br>
> For adding libraries of external package, I used<br>
> INSTALL( FILES Lib1 lib2 DESTINATION ${INSTALL_DIR} )<br>
><br>
> For installing target generated from this CMakeLists.txt,<br>
> INSTALL( TARGETS ${EXECUTABLE_NAME} DESTINATION ${INSTALL_DIR} )<br>
><br>
> Here, while installing TARGETS, I want to add an executable of external<br>
> package.<br>
> When I included it with the above INSTALL, it says that "install TARGETS<br>
> given target "some/path/exe" which does not exist in this directory."<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>
> I want to do it without copying in to the CMakeLists.txt folder. Is there<br>
> any other way?<br>
<br>
</div>see above.<br>
<div class="im"><br>
> Also, can somebody throw some light on while making package, which type of<br>
> 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'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'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>