<br><br>
<div class="gmail_quote">2009/3/16 Mattias Helsing <span dir="ltr"><<a href="mailto:helsing72@gmail.com">helsing72@gmail.com</a>></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'm wrong.<br><br>Your CMake code produces an executable file (you can'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 <your_executable_target>)<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'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 <<a href="mailto:ankitguddu@gmail.com">ankitguddu@gmail.com</a>> wrote:<br>> 2009/3/13 Mattias Helsing <<a href="mailto:helsing72@gmail.com">helsing72@gmail.com</a>><br>
><br>>> Hello Ankit,<br>>><br>>> On 3/13/09, ankit jain <<a href="mailto:ankitguddu@gmail.com">ankitguddu@gmail.com</a>> wrote:<br>>> > Hi all,<br>>> ><br>>> > I have a shell script. I want to link it with a library that i have<br>
>> > build<br>>> > using cmake. Is it possible to do so.<br>>> > I am running this shell script using cmake.<br>>><br>>> You need to describe what you want to do in much more detail. What<br>
>> kind of link are you talking about? The first interpretation I made<br>>> was that you are using a linker to link a library and a shell script<br>>> into <whatever>. Is it that you<br>>> * want to call the linker from the script?<br>
>> * linking them in the context of packaging so they get installed<br>>> together?<br>>> * <more wild guesses><br>>><br>>> Perhaps you could take a look at<br>>> <a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
>> so that we(I or any real cmake expert) can at least have a chance of<br>>> helping you without wild guesses.<br>>><br>>> Mattias<br>>><br>><br>><br>>> Iam sorry that i am not able to explain you properly.<br>
>><br>> Actually in my shl scripts there are certains commadns that i use. these<br>> commands are nothing but executbale which require some arguments. these<br>> executables are actaully created by cmake. Also certain commands can only<br>
> be<br>> run from some libraries which are build by cmake.<br>><br>> I am actually getting errors while running that shell script.<br>> Error are like: <command_name> not found.<br>> It is because iam not able to link that shell script or say not able to<br>
> include that library into the shell script. I dotn know how to link a<br>> library with shell script so that while executing it gets all the supor tof<br>> the library which it requires.<br>><br>> As you have asked about linker not explicitly iam passing anything to<br>
> linker calling linker from shell script.<br>><br>> My need is to simple run the shell script which need a support of a<br>> library.<br>> Toa chieve it how to link thast library to shell script i dont know. It<br>
> might be like you said calling linker from shell script. i dontknow how it<br>> can be achieved.<br>><br>> You tell me in general sense if this the senario how to do it.<br>><br>> I hope i make problem somewhat clear to you.<br>
><br>> Ankit<br>><br>>><br>>> ><br>>> > If possible plz let me show an example.<br>>> ><br>>> ><br>>> > Ankit<br>>> ><br>>><br>><br></div></div>
</blockquote></div><br>