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