[CMake] Linking cmake build library to a shell script

ankit jain ankitguddu at gmail.com
Mon Mar 16 07:42:34 EDT 2009


2009/3/16 Mattias Helsing <helsing72 at gmail.com>

> Hi Ankit,
>
> ok, so we have problems with our terminologies. You can't link a shell
> script with anything!
>
> So back to guessing. This time I'm guessing that you (or your script)
> isn't setting LD_LIBRARY_PATH correctly. Could you check this?
>
> Mattias
>



>  Thanks Mattias. There was problem with LD_LIBRARY_PATH only.
>
Thanks for all your support and interest in my query.

Ankit

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


More information about the CMake mailing list