<br><br>
<div class="gmail_quote">2009/3/16 Mattias Helsing <span dir="ltr">&lt;<a href="mailto:helsing72@gmail.com">helsing72@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello Ankit,<br><br>I think I know what you are trying to do. Correct me if I&#39;m wrong.<br><br>Your CMake code produces an executable file (you can&#39;t run libraries<br>
from the commandline) and you want to produce a shellscript that calls<br>this executable?<br></blockquote>
<div> </div>
<div>Thanks for the reply but iam sorry that you misunderstand my question. </div>
<div>My cmake genrates a library. iam not generating a shel script from cmake.</div>
<div>i already written it. only thing is that iam esxecuting this shell script through cmake like normal executables. what i want is to link this shell script with the cmake generated library.</div>
<div>thats it. like we link a cmake generated executable to cmake generated library.</div>
<div>here the diff. is that the shell script is not generatde by cmake.</div>
<div> </div>
<div>Hope its clear.iam giving my folder structure to you.</div>
<div> </div>
<div>Main</div>
<div>....cmakelist.txt</div>
<div>....shell_script.sh</div>
<div> </div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span>Libraries are stored in some other folder outside main folder.<br></blockquote>
<div>ankit</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span>You could for example create a shell script template and use the<br>configure_file command, e.i.<br>
<br>in file <a href="http://shscript.sh.in/" target="_blank">shscript.sh.in</a>:<br>#!/bin/sh<br>#<br>@PROJECT_BINARY_DIR@/bin/@TARGET_NAME@ $1 $2 $3<br><br>in file CMakeLists.txt<br>set(TARGET_NAME &lt;your_executable_target&gt;)<br>
configure_file(<a href="http://shscript.sh.in/" target="_blank">shscript.sh.in</a> ${PROJECT_BINARY_DIR}/bin/shscript.sh)<br><br>not at all the prettiest solution and I&#39;m not really sure why you want<br>to do this but good luck<br>
<font color="#888888">Mattias<br></font>
<div>
<div></div>
<div class="h5"><br>On 3/13/09, ankit jain &lt;<a href="mailto:ankitguddu@gmail.com">ankitguddu@gmail.com</a>&gt; wrote:<br>&gt; 2009/3/13 Mattias Helsing &lt;<a href="mailto:helsing72@gmail.com">helsing72@gmail.com</a>&gt;<br>
&gt;<br>&gt;&gt; Hello Ankit,<br>&gt;&gt;<br>&gt;&gt; On 3/13/09, ankit jain &lt;<a href="mailto:ankitguddu@gmail.com">ankitguddu@gmail.com</a>&gt; wrote:<br>&gt;&gt; &gt; Hi all,<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; I have a shell script. I want to link it with a library that i have<br>
&gt;&gt; &gt; build<br>&gt;&gt; &gt; using cmake. Is it possible to do so.<br>&gt;&gt; &gt; I am running this shell script using cmake.<br>&gt;&gt;<br>&gt;&gt; You need to describe what you want to do in much more detail. What<br>
&gt;&gt; kind of link are you talking about? The first interpretation I made<br>&gt;&gt; was that you are using a linker to link a library and a shell script<br>&gt;&gt; into &lt;whatever&gt;. Is it that you<br>&gt;&gt; * want to call the linker from the script?<br>
&gt;&gt; * linking them in the context of packaging so they get installed<br>&gt;&gt; together?<br>&gt;&gt; * &lt;more wild guesses&gt;<br>&gt;&gt;<br>&gt;&gt; Perhaps you could take a look at<br>&gt;&gt;  <a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
&gt;&gt; so that we(I or any real cmake expert) can at least have a chance of<br>&gt;&gt; helping you without wild guesses.<br>&gt;&gt;<br>&gt;&gt; Mattias<br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt;&gt;  Iam sorry that i am not able to explain you properly.<br>
&gt;&gt;<br>&gt; Actually in my shl scripts there are certains commadns that i use. these<br>&gt; commands are nothing but executbale which require some arguments. these<br>&gt; executables are actaully created by cmake. Also certain commands can only<br>
&gt; be<br>&gt; run from some libraries which are build by cmake.<br>&gt;<br>&gt; I am actually getting errors while running that shell script.<br>&gt; Error are like: &lt;command_name&gt; not found.<br>&gt; It is because iam not able to link that shell script or say not able to<br>
&gt; include that library into the shell script. I dotn know how to link a<br>&gt; library with shell script so that while executing it gets all the supor tof<br>&gt; the library which it requires.<br>&gt;<br>&gt; As you have asked about linker  not explicitly iam passing anything to<br>
&gt; linker calling linker from shell script.<br>&gt;<br>&gt; My need is to simple run the shell script which need a support of a<br>&gt; library.<br>&gt; Toa chieve it how to link thast library to shell script i dont know. It<br>
&gt; might be like you said calling linker from shell script. i dontknow how it<br>&gt; can be achieved.<br>&gt;<br>&gt; You tell me in general sense if this the senario how to do it.<br>&gt;<br>&gt; I hope i make problem somewhat clear to you.<br>
&gt;<br>&gt; Ankit<br>&gt;<br>&gt;&gt;<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; If possible plz let me show an example.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Ankit<br>&gt;&gt; &gt;<br>&gt;&gt;<br>&gt;<br></div></div>
</blockquote></div><br>